Apt module pass arguments

31 views
Skip to first unread message

Jeroen Rijken

unread,
Jun 21, 2023, 8:37:43 AM6/21/23
to ansible...@googlegroups.com
Hi,

Is it currently possible to pass apt options to the apt module? The dpkg_options are only for dpkg, I'd like to pass apt specific options like so:

`apt-get -o Dir::Etc::SourceList=/tmp/sources.list -o Dir::Etc::SourceParts=/nonexistent -o Dir::State::Lists=/tmp/lists/ update`

This doesn't work because the apt module only supports dpkg options:
```
- name: Parallel download packages | Download all required packages in parallel | Update cache
ansible.builtin.apt:
update_cache: true
dpkg_options: "Dir::Etc::SourceList=/tmp/sources.list,Dir::Etc::SourceParts=/nonexistent,Dir::State::Lists=/tmp/lists/"
when:
- ansible_facts['distribution_major_version'] != "22"
```


Kind regards, Jeroen Rijken

Andrew Latham

unread,
Jun 21, 2023, 10:52:12 AM6/21/23
to ansible...@googlegroups.com
Jeroen

There are several issues related and a PR at https://github.com/ansible/ansible/pull/76632 that you may want to look at. Feel free to do a search of https://github.com/ansible/ansible/issues for related topics.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAz2EOm%3DqbE0CjfYC6TB9knf%2BfKv6B8hNWGvAyL3T0i3YFi97A%40mail.gmail.com.


--
- Andrew "lathama" Latham -
Reply all
Reply to author
Forward
0 new messages