Created
January 11, 2021 19:25
-
-
Save JayDoubleu/ab08876489dabd6244e652e16c935f9d to your computer and use it in GitHub Desktop.
Ansible update toolbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
connection: local | |
tasks: | |
- name: Gather facts on a specific container | |
containers.podman.podman_container_info: | |
name: | |
- fedora-toolbox-33 | |
- fedora-toolbox-34 | |
register: toolbox_facts | |
- name: Add toolbox as ansible host | |
ansible.builtin.add_host: | |
name: "{{ item.Name }}" | |
ansible_host: "{{ item.Id }}" | |
ansible_python_interpreter: /usr/bin/python3 | |
groups: toolbox | |
changed_when: false | |
loop: "{{ toolbox_facts.containers }}" | |
- hosts: toolbox | |
connection: podman | |
tasks: | |
- name: Run full system update on each toolbox container | |
ansible.builtin.dnf: | |
name: "*" | |
state: latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment