Add Archlinux

This commit is contained in:
Greg Hellings
2023-08-13 18:44:20 -05:00
parent 14413542f5
commit c2a53828a1
13 changed files with 225 additions and 40 deletions
+3 -36
View File
@@ -1,46 +1,13 @@
- name: install guest additions
hosts: default
vars:
ansible_remote_tmp: /tmp
pre_tasks:
- name: Pause for a moment in case we need cloud-init to finish
ansible.builtin.pause:
seconds: 20
- name: Update all the things
become: true
ansible.builtin.package: # noqa package-latest
name: "*"
state: latest
update_cache: true
when: ansible_facts.pkg_mgr not in ['atomic_container']
register: _update_all
retries: 3
until: _update_all is success
- name: Update atomic things
become: true
ansible.builtin.command: rpm-ostree upgrade
when: ansible_facts.pkg_mgr in ['atomic_container']
changed_when: false
register: _update_atomic
retries: 3
until: _update_atomic is success
- name: Reboot, but don't care if it doesn't
block:
- name: Restart the machine
become: true
ansible.builtin.reboot:
when: (_update_atomic is changed) or (_update_all is changed)
failed_when: false # This module is buggy and can't always understand a reboot
- name: Wait for reboot to finish
ansible.builtin.wait_for_connection:
delay: 15
rescue:
- name: Reboot failed? lol
ansible.builtin.debug:
msg: Reboot failed. lol.
roles:
- role: latest
- role: devroles.system.epel
- role: virtualbox
when: packer_builder_type == 'virtualbox-iso'
+6
View File
@@ -0,0 +1,6 @@
- name: Update on Arch
become: true
community.general.pacman:
upgrade: true
update_cache: true
state: latest
@@ -0,0 +1,7 @@
- name: Update atomic things
become: true
ansible.builtin.command: rpm-ostree upgrade
changed_when: false
register: _update_atomic
retries: 3
until: _update_atomic is success
+9
View File
@@ -0,0 +1,9 @@
- name: Update all the things
become: true
ansible.builtin.package: # noqa package-latest
name: "*"
state: latest
update_cache: true
register: _update_all
retries: 3
until: _update_all is success
+25
View File
@@ -0,0 +1,25 @@
- name: Load update sciprt for proper distro
ansible.builtin.include_tasks:
file: "{{ item }}"
with_first_found:
- files:
- "{{ role_path }}/tasks/{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_version'] }}.yml"
- "{{ role_path }}/tasks/{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_major_version'] }}.yml"
- "{{ role_path }}/tasks/{{ ansible_facts['distribution'] }}.yml"
- "{{ role_path }}/tasks/{{ ansible_facts['os_family'] }}.yml"
- "{{ role_path }}/tasks/default.yml"
- name: Reboot, but don't care if it doesn't
block:
- name: Restart the machine
become: true
ansible.builtin.reboot:
failed_when: false # This module is buggy and can't always understand a reboot
- name: Wait for reboot to finish
ansible.builtin.wait_for_connection:
delay: 15
rescue:
- name: Reboot failed? lol
ansible.builtin.debug:
msg: Reboot failed. lol.
+1
View File
@@ -54,6 +54,7 @@
ansible.builtin.package:
name: "{{ virtualbox_remove_packages | default([]) }}"
state: absent
when: virtualbox_remove_packages
- name: Remove file
ansible.builtin.file:
@@ -0,0 +1,6 @@
virtualbox_packages:
- virtualbox-guest-utils-nox
virtualbox_services:
- vboxservice
virtualbox_from_iso: false
virtualbox_remove_packages: []