--- - hosts: freebsdservers gather_facts: true become: true vars: jails: - aa-torrenting - blocky - unbound tasks: - name: Update all installed packages community.general.pkgng: name: "*" state: latest - name: Update all installed packages in jails community.general.pkgng: name: "*" state: latest jail: "{{ item }}" with_items: "{{ jails }}" - name: Fetch and install updates ansible.builtin.shell: freebsd-update fetch install register: updated changed_when: '"No updates are available to install." not in updated.stdout' - name: Fetch and install updates in aa-torrenting jail ansible.builtin.shell: freebsd-update -j aa-torrenting fetch install register: updated_aa_torrenting changed_when: '"No updates are available to install." not in updated_aa_torrenting.stdout' - name: Fetch and install updates in blocky jail ansible.builtin.shell: freebsd-update -j blocky fetch install register: updated_blocky changed_when: '"No updates are available to install." not in updated_blocky.stdout' - name: Fetch and install updates in unbound jail ansible.builtin.shell: freebsd-update -j unbound fetch install register: updated_unbound changed_when: '"No updates are available to install." not in updated_unbound.stdout'