I am trying to hold multiple packages using ansible-playbook but it doesn't work with me.
Using the below code it holds the first package then un-hold it then hold the second package
Here is my code
- name: Prevent packages from being upgraded
dpkg_selections:
name: "{{ item }}"
selection: hold
with_items:
- postgresql
- docker
Here is the output from the server side while the code executing
the first line before executing
the second line is the output when the first package was hold
the third line when the second package was held and it is stoped
I don't understand why the behavior is like that? and how can I hold multiple packages at a time using ansible?
NOTE: I already followed the instruction from Anible doc https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dpkg_selections_module.html Thanks in advance