aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/upgrade/tasks/main.yml18
-rw-r--r--site.all.yml6
-rw-r--r--site.prerequisites.yml6
-rw-r--r--site.system.yml5
-rw-r--r--site.upgrade.yml6
5 files changed, 36 insertions, 5 deletions
diff --git a/roles/upgrade/tasks/main.yml b/roles/upgrade/tasks/main.yml
new file mode 100644
index 0000000..c8a041b
--- /dev/null
+++ b/roles/upgrade/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+
+- name: apply system upgrade
+ community.general.sysupgrade:
+ register: upgrade__result_sysupgrade
+
+- name: reboot to apply upgrade
+ ansible.builtin.reboot:
+ reboot_timeout: 1200
+ when: upgrade__result_sysupgrade.changed
+
+- name: apply post-upgrade update
+ ansible.builtin.command: pkg_add -Uu
+ when: upgrade__result_sysupgrade.changed
+
+- name: update dependencies
+ ansible.builtin.include_role:
+ name: update
diff --git a/site.all.yml b/site.all.yml
index 73acbef..83a35c7 100644
--- a/site.all.yml
+++ b/site.all.yml
@@ -1,5 +1,11 @@
---
+- name: include prerequisites playbook
+ ansible.builtin.import_playbook: site.prerequisites.yml
+
+- name: include upgrade playbook
+ ansible.builtin.import_playbook: site.upgrade.yml
+
- name: include system playbook
ansible.builtin.import_playbook: site.system.yml
diff --git a/site.prerequisites.yml b/site.prerequisites.yml
new file mode 100644
index 0000000..1acc3fa
--- /dev/null
+++ b/site.prerequisites.yml
@@ -0,0 +1,6 @@
+---
+
+- hosts: servers
+ gather_facts: false
+ roles:
+ - role: prerequisites
diff --git a/site.system.yml b/site.system.yml
index 721d244..8c08624 100644
--- a/site.system.yml
+++ b/site.system.yml
@@ -1,11 +1,6 @@
---
- hosts: servers
- gather_facts: false
- roles:
- - role: prerequisites
-
-- hosts: servers
roles:
- role: hostname
- role: unix_users
diff --git a/site.upgrade.yml b/site.upgrade.yml
new file mode 100644
index 0000000..d635140
--- /dev/null
+++ b/site.upgrade.yml
@@ -0,0 +1,6 @@
+---
+
+- hosts: servers
+ roles:
+ - role: upgrade
+ when: ansible_distribution == "OpenBSD"
remember that computers suck.