Try to fix access to var item result

Changed files
+4 -14
+4 -14
freebsd-update.yml
···
- name: Run freebsd-update fetch
ansible.builtin.command: freebsd-update fetch
-
- name: Check if updates are ready
-
ansible.builtin.command: freebsd-update updatesready
-
register: updatesready
-
- name: Upgrade the system
ansible.builtin.command: freebsd-update install
register: upgraded
-
when:
-
- updatesready.rc == 0
- name: Reboot may be necessary
ansible.builtin.debug:
···
ansible.builtin.command: "freebsd-update fetch -j {{ item }}"
with_items: "{{ jails }}"
-
- name: Check if updates are ready in jails
-
ansible.builtin.command: "freebsd-update updatesready -j {{ item }}"
-
register: updatesready_jails
-
with_items: "{{ jails }}"
-
- name: Upgrade the jails
ansible.builtin.command: "freebsd-update install -j {{ item }}"
register: upgraded_jails
with_items: "{{ jails }}"
-
when:
-
- updatesready_jails.rc == 0
- name: Reboot of jail may be necessary
ansible.builtin.debug:
msg: "A system reboot may be necessary for this jail."
when:
-
- upgraded_jails.rc == 0
···
- name: Run freebsd-update fetch
ansible.builtin.command: freebsd-update fetch
- name: Upgrade the system
ansible.builtin.command: freebsd-update install
register: upgraded
+
changed_when: upgraded.rc == 0
- name: Reboot may be necessary
ansible.builtin.debug:
···
ansible.builtin.command: "freebsd-update fetch -j {{ item }}"
with_items: "{{ jails }}"
- name: Upgrade the jails
ansible.builtin.command: "freebsd-update install -j {{ item }}"
register: upgraded_jails
+
changed_when: upgraded_jails.item.rc == 0
with_items: "{{ jails }}"
- name: Reboot of jail may be necessary
ansible.builtin.debug:
msg: "A system reboot may be necessary for this jail."
when:
+
- upgraded_jails.item.rc == 0
+
with_items: "{{ jails }}"