I want to to install some packages to several almalinux hosts
- name: "docker=install"
delegate_to: "{{ item }}"
dnf:
name:
- yum-utils
- device-mapper-persistent-data
- lvm2
state: present
loop:
- k8s-master
- k8s-node-1
this TASK works, but I was thinking whether I could put the packages
into a loop also (which would result into 2 loops in one TASK)
Can this be done? If so ... 'how'?
I tried to nest it like this
- name: "docker=install"
delegate_to: "{{ item }}"
dnf:
name: "{{ item }}"
state: present
loop:
- yum-utils
- device-mapper-persistent-data
- lvm2
loop:
- k8s-master
- k8s-node-1
but execution failed with an
"unsupported paramter for dnf
module: loop" error