Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

offline - how could I install a snap package via Ansible on an air-gapped system

Installing snap packages via Ansible on systems that are connected to internet is rather simple. EG:

  - name: Install microk8s
    become: yes
    snap:
      name: microk8s
      classic: yes
      channel: "{{ microk8s_version }}"

Now I would need to do the same on a set of nodes that are air-gapped (no direct connection to internet). I can do a 'snap download' for the required packages, and move them to the target machine(s). But then how to do this in Ansible? Is there any support for this? Or do I have to use the shell/command module ?

thx

question from:https://stackoverflow.com/questions/65886281/how-could-i-install-a-snap-package-via-ansible-on-an-air-gapped-system

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have not tested this, but this method works with other modules.

  - name: install microk8s, file on local disk
    become: yes
    snap:
      name: /path/to/file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...