From 5ac6618960d6cbbf68b4347a63c5fe465f0fdd8b Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Wed, 27 Jan 2021 00:16:34 -0600 Subject: [PATCH] initial playbooks - updates on Linux servers --- update-playbooks/alpine-update.yaml | 12 ++++++++++++ update-playbooks/centos-update.yaml | 10 ++++++++++ update-playbooks/debian-update.yaml | 11 +++++++++++ update-playbooks/rhel-update.yaml | 10 ++++++++++ update-playbooks/ubuntu-update.yaml | 11 +++++++++++ update.yaml | 6 ++++++ 6 files changed, 60 insertions(+) create mode 100644 update-playbooks/alpine-update.yaml create mode 100644 update-playbooks/centos-update.yaml create mode 100644 update-playbooks/debian-update.yaml create mode 100644 update-playbooks/rhel-update.yaml create mode 100644 update-playbooks/ubuntu-update.yaml create mode 100644 update.yaml diff --git a/update-playbooks/alpine-update.yaml b/update-playbooks/alpine-update.yaml new file mode 100644 index 0000000..8e1b1c6 --- /dev/null +++ b/update-playbooks/alpine-update.yaml @@ -0,0 +1,12 @@ +--- +- name: Update Alpine Linux Systems + hosts: alpine + become: yes + + tasks: + - name: Update apk + command: /sbin/apk update + + tasks: + - name: Upgrade apk + command: /sbin/apk upgrade -U -a diff --git a/update-playbooks/centos-update.yaml b/update-playbooks/centos-update.yaml new file mode 100644 index 0000000..1338f56 --- /dev/null +++ b/update-playbooks/centos-update.yaml @@ -0,0 +1,10 @@ +--- +- name: Update CentOS Linux Systems + hosts: centos + become: yes + + tasks: + - name: Run yum update + yum: + name: "*" + state: latest diff --git a/update-playbooks/debian-update.yaml b/update-playbooks/debian-update.yaml new file mode 100644 index 0000000..f326631 --- /dev/null +++ b/update-playbooks/debian-update.yaml @@ -0,0 +1,11 @@ +--- +- name: Update Debian Linux Systems + hosts: debian + become: yes + + tasks: + - name: Update apt repo and cache + apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 + + - name: Upgrade all packages + apt: upgrade=dist force_apt_get=yes diff --git a/update-playbooks/rhel-update.yaml b/update-playbooks/rhel-update.yaml new file mode 100644 index 0000000..e2ba76c --- /dev/null +++ b/update-playbooks/rhel-update.yaml @@ -0,0 +1,10 @@ +--- +- name: Update RedHat Enterprise Linux Systems + hosts: rhel + become: yes + + tasks: + - name: Run dnf update + dnf: + name: "*" + state: latest diff --git a/update-playbooks/ubuntu-update.yaml b/update-playbooks/ubuntu-update.yaml new file mode 100644 index 0000000..e381704 --- /dev/null +++ b/update-playbooks/ubuntu-update.yaml @@ -0,0 +1,11 @@ +--- +- name: Update Ubuntu Linux Systems + hosts: ubuntu + become: yes + + tasks: + - name: Update apt repo and cache + apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 + + - name: Upgrade all packages + apt: upgrade=dist force_apt_get=yes diff --git a/update.yaml b/update.yaml new file mode 100644 index 0000000..97881b5 --- /dev/null +++ b/update.yaml @@ -0,0 +1,6 @@ +--- +- import_playbook: update-playbooks/ubuntu-update.yaml +- import_playbook: update-playbooks/centos-update.yaml +- import_playbook: update-playbooks/alpine-update.yaml +- import_playbook: update-playbooks/debian-update.yaml +- import_playbook: update-playbooks/rhel-update.yaml