initial checkin

This commit is contained in:
Radar231 2021-07-23 18:45:44 -04:00
commit bc58dc6038
3 changed files with 136 additions and 0 deletions

90
del_inventory.yml Normal file
View File

@ -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

14
do_updates.sh Executable file
View File

@ -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

32
updates.yml Normal file
View File

@ -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 <inventory file | IP,> 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