From what I know using apt-get upgrade -d only downloads the packages in the /var/cache/apt/archives directory source
Based on the documentation there is no explicit mention of download parameter. Does someone have any information about this. I would like to avoid using command module for something that already has a module in ansible-core.
Hi
It seems there’s no options to make it works or workaround like you need.
So probably you’ll go for command or script-like.
What’s the purpose to download package without installing it ?
Some people already try to ask a PR about that :
https://github.com/ansible/ansible/issues/23220
I have certain air-gapped devices which I would like to update on a timely basis. Having the debian packages downloaded on a device connected with internet and then tarballing it to be shipped to the air-gapped environment would be something interesting to tackle.
From what I understand setting up a file-server on a gateway device which is connected to an air-gapped Ansible group would act similar to APT repositories on the internet.
Ok that makes sense.
Another solution but it’s more a networking-oriented solution, should be to get your own apt mirror (like a server that get access to internet) then configure your sources.list on your air-gapped devices to this mirror.
Then you can easily manage available packages and/or update/upgrade rythm with Ansible playbook that only make update/upgrade tasks.
We set up that kind of solution for different purpose (to avoid to get a bunch of VM that have access to internet) and it works pretty well.
Any documentation on how to achieve the mirror settings? I am looking into similar lines of implementation too.
Sure, that kind of tutorial is a good basis :
Depends on mirror you need (Deb10,11,12 or others) you may face some issues related to “Translation” but there’s some tips & tricks to resolve this.
About storage, in our case we got Deb11 & Deb12 (without src) mirroring and it takes around 500GB. So you need to properly size your storage parts before mirroring, cause it can takes a lot of space if you didn’t handle it well 