From 11fbaf0b558400264c95026c70ed938a97f1673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 3 May 2021 20:27:13 +0200 Subject: roles/update: Init default usages and actions --- roles/update/tasks/_alpine.yml | 6 ++++++ roles/update/tasks/_freebsd.yml | 11 +++++++++++ roles/update/tasks/_freebsd_full.yml | 10 ++++++++++ roles/update/tasks/_openbsd.yml | 10 ++++++++++ roles/update/tasks/_openbsd_full.yml | 4 ++++ roles/update/tasks/main.yml | 12 ++++++++++++ 6 files changed, 53 insertions(+) create mode 100644 roles/update/tasks/_alpine.yml create mode 100644 roles/update/tasks/_freebsd.yml create mode 100644 roles/update/tasks/_freebsd_full.yml create mode 100644 roles/update/tasks/_openbsd.yml create mode 100644 roles/update/tasks/_openbsd_full.yml create mode 100644 roles/update/tasks/main.yml (limited to 'roles/update/tasks') diff --git a/roles/update/tasks/_alpine.yml b/roles/update/tasks/_alpine.yml new file mode 100644 index 0000000..8f9a293 --- /dev/null +++ b/roles/update/tasks/_alpine.yml @@ -0,0 +1,6 @@ +--- + +- name: update packages + shell: | + apk update + apk upgrade diff --git a/roles/update/tasks/_freebsd.yml b/roles/update/tasks/_freebsd.yml new file mode 100644 index 0000000..29d88ba --- /dev/null +++ b/roles/update/tasks/_freebsd.yml @@ -0,0 +1,11 @@ +--- + +- name: apply freebsd system updates + shell: | + freebsd-update --not-running-from-cron fetch + freebsd-update install + +- name: update freebsd packages + shell: | + pkg update + pkg upgrade diff --git a/roles/update/tasks/_freebsd_full.yml b/roles/update/tasks/_freebsd_full.yml new file mode 100644 index 0000000..0cfcfc9 --- /dev/null +++ b/roles/update/tasks/_freebsd_full.yml @@ -0,0 +1,10 @@ +--- + +- name: upgrade freebsd to next release + shell: | + yes | freebsd-update update -r "{{ update_version_freebsd }}-RELEASE" + +- name: ensure packages are rebuild + shell: | + pkg-static -af + freebsd-update install diff --git a/roles/update/tasks/_openbsd.yml b/roles/update/tasks/_openbsd.yml new file mode 100644 index 0000000..9f0c1c5 --- /dev/null +++ b/roles/update/tasks/_openbsd.yml @@ -0,0 +1,10 @@ +--- + +- name: update openbsd ports + shell: pkg_add -IUu + +- name: apply binary patches + shell: syspatch + +- name: cleanup unused packages + shell: pkg_delete -Iac diff --git a/roles/update/tasks/_openbsd_full.yml b/roles/update/tasks/_openbsd_full.yml new file mode 100644 index 0000000..9a73cfb --- /dev/null +++ b/roles/update/tasks/_openbsd_full.yml @@ -0,0 +1,4 @@ +--- + +- name: upgrade openbsd to next release + shell: sysupgrade diff --git a/roles/update/tasks/main.yml b/roles/update/tasks/main.yml new file mode 100644 index 0000000..8c5fed8 --- /dev/null +++ b/roles/update/tasks/main.yml @@ -0,0 +1,12 @@ + +# update +# update package to latest + +--- + +- name: include per-distro update + include: "_{{ ansible_distribution | lower }}.yml" + +- name: include per-distro update-update/upgrade + include: "_{{ ansible_distribution | lower }}_full.yml" + when: update_full -- cgit v1.2.3