Files
vms/ansible/playbook.yml
T

44 lines
1.2 KiB
YAML
Raw Normal View History

2022-05-02 22:03:37 -05:00
- name: install guest additions
hosts: default
pre_tasks:
2023-08-03 14:44:02 -05:00
- name: Pause for a moment in case we need cloud-init to finish
ansible.builtin.pause:
seconds: 20
2022-06-08 01:39:37 -05:00
- name: Update all the things
2022-05-02 22:03:37 -05:00
become: true
2022-05-05 08:17:48 -05:00
ansible.builtin.package: # noqa package-latest
2022-05-02 22:03:37 -05:00
name: "*"
state: latest
2023-08-03 14:44:02 -05:00
update_cache: true
2022-05-02 22:03:37 -05:00
when: ansible_facts.pkg_mgr not in ['atomic_container']
2022-06-22 10:00:04 -05:00
register: _update_all
retries: 3
until: _update_all is success
2022-05-02 22:03:37 -05:00
2022-06-08 01:39:37 -05:00
- name: Update atomic things
2022-05-02 22:03:37 -05:00
become: true
2022-05-05 08:17:48 -05:00
ansible.builtin.command: rpm-ostree upgrade
2022-05-02 22:03:37 -05:00
when: ansible_facts.pkg_mgr in ['atomic_container']
2022-05-05 08:17:48 -05:00
changed_when: false
2022-06-22 10:00:04 -05:00
register: _update_atomic
retries: 3
until: _update_atomic is success
2022-06-08 01:39:37 -05:00
- name: Restart the machine
become: true
ansible.builtin.reboot:
2023-08-03 14:44:02 -05:00
when: (_update_atomic is changed) or (_update_all is changed)
2022-05-02 22:03:37 -05:00
roles:
2022-06-22 10:00:04 -05:00
- role: devroles.system.epel
2022-05-02 22:03:37 -05:00
- role: virtualbox
when: packer_builder_type == 'virtualbox-iso'
- role: vmware
when: packer_builder_type == 'vmware-iso'
2023-08-03 14:44:02 -05:00
- role: qemu
when: packer_builder_type == 'qemu'
2022-05-02 22:03:37 -05:00
- role: init
- role: locale
- role: vagrant
- role: cleanup