commit bc58dc6038fdd48fdfebadacbabe9ccdae06cc85 Author: Radar231 Date: Fri Jul 23 18:45:44 2021 -0400 initial checkin diff --git a/del_inventory.yml b/del_inventory.yml new file mode 100644 index 0000000..8469808 --- /dev/null +++ b/del_inventory.yml @@ -0,0 +1,90 @@ +--- +########################################################################### +# +# Inventory for delfax package updates (using updates.yml) +# +########################################################################### + +all: + hosts: + children: + local: + hosts: + reddwarf: + ansible_host: 192.168.7.10 + starbug: + ansible_host: 192.168.7.15 + kryten: + ansible_host: 192.168.7.20 + delans: + ansible_host: 192.168.7.31 + docker1: + ansible_host: 192.168.7.32 + docker2: + ansible_host: 192.168.7.33 + pihole1: + ansible_host: 192.168.7.41 + pihole2: + ansible_host: 192.168.7.42 + lister: + ansible_host: 192.168.7.120 + cat: + ansible_host: 192.168.7.121 + holly: + ansible_host: 192.168.7.122 + remote: + hosts: + fubar: + ansible_host: 172.97.69.70 + ansible_port: 50022 + snafu: + ansible_host: 192.210.140.178 + ansible_port: 50022 + k8s: + hosts: + node1: + ansible_host: 192.168.7.51 + node2: + ansible_host: 192.168.7.52 + node3: + ansible_host: 192.168.7.53 + pi4-1: + ansible_host: 192.168.7.21 + pi4-2: + ansible_host: 192.168.7.22 + pi4-3: + ansible_host: 192.168.7.23 + pi4-4: + ansible_host: 192.168.7.24 + nagios_agents: + hosts: + reddwarf: + ansible_host: 192.168.7.10 + starbug: + ansible_host: 192.168.7.15 + pi4-1: + ansible_host: 192.168.7.21 + pi4-2: + ansible_host: 192.168.7.22 + pi4-3: + ansible_host: 192.168.7.23 + pi4-4: + ansible_host: 192.168.7.24 + delans: + ansible_host: 192.168.7.31 + docker1: + ansible_host: 192.168.7.32 + docker2: + ansible_host: 192.168.7.33 + pihole1: + ansible_host: 192.168.7.41 + pihole2: + ansible_host: 192.168.7.42 + node1: + ansible_host: 192.168.7.51 + node2: + ansible_host: 192.168.7.52 + node3: + ansible_host: 192.168.7.53 + +# EOF diff --git a/do_updates.sh b/do_updates.sh new file mode 100755 index 0000000..7a4a4b1 --- /dev/null +++ b/do_updates.sh @@ -0,0 +1,14 @@ +#!/bin/bash +########################################################################### +# +# This is a helper script for the updates.yml ansible playbook. +# +########################################################################### + +curDate=$(date +%Y%m%d) +logDir='/home/rmorrow/logs' + +mkdir -p $logDir + +ansible-playbook -i del_inventory.yml --limit local,remote,k8s updates.yml 2>&1 | tee -a ${logDir}/updates_${curDate}.log + diff --git a/updates.yml b/updates.yml new file mode 100644 index 0000000..82f4c20 --- /dev/null +++ b/updates.yml @@ -0,0 +1,32 @@ +--- +########################################################################### +# +# This is the top level playbook to perform a system update for the target +# host. +# +# This playbook will first call the 'update_cache' role, and will then call +# the 'chk_upgrades' role to display what packages are waiting for update. +# It then calls the 'upgrade_pkgs' role to perform the actual package +# upgrade. +# +########################################################################### +# +# This playbook can be run using the following command line; +# +# ansible-playbook -i updates.yml +# +# ie, +# ansible-playbook -i 192.168.1.123, updates.yml +# +########################################################################### + +- hosts: all + gather_facts: true + user: root + + roles: + - update_cache + - chk_upgrades + - upgrade_pkgs + +# EOF