Compare commits
6 Commits
fd4b1e0fea
...
0502c4f766
| Author | SHA256 | Date | |
|---|---|---|---|
| 0502c4f766 | |||
| 18b5cbf644 | |||
| 97b9bc97dd | |||
| 723ac0a24d | |||
| c5bd013060 | |||
| 993692447b |
+21
@@ -0,0 +1,21 @@
|
|||||||
|
[defaults]
|
||||||
|
|
||||||
|
inventory = ./inventory
|
||||||
|
|
||||||
|
remote_user = hpf-ans
|
||||||
|
host_key_checking = False
|
||||||
|
|
||||||
|
timeout = 30
|
||||||
|
|
||||||
|
stdout_callback = default
|
||||||
|
callback_result_format = yaml
|
||||||
|
|
||||||
|
#[privilege_escalation]
|
||||||
|
#become = True
|
||||||
|
#become_method = sudo
|
||||||
|
#become_user = root
|
||||||
|
#become_ask_pass = False
|
||||||
|
|
||||||
|
[ssh_connection]
|
||||||
|
pipelining = True
|
||||||
|
|
||||||
+1
-1
@@ -115,7 +115,7 @@ as_hpf_ans "if [ ! -d \"${HPF_ANS_ansible_venv}\" ] ; then python3 -m venv \"${H
|
|||||||
as_hpf_ans "pip install --upgrade pip"
|
as_hpf_ans "pip install --upgrade pip"
|
||||||
|
|
||||||
# Make sure ansible is installed
|
# Make sure ansible is installed
|
||||||
as_hpf_ans "pip install ansible"
|
as_hpf_ans "pip install --upgrade ansible"
|
||||||
|
|
||||||
# Make sure bin exists
|
# Make sure bin exists
|
||||||
as_hpf_ans "mkdir -p \"${HPF_ANS_bin}\""
|
as_hpf_ans "mkdir -p \"${HPF_ANS_bin}\""
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ntp_server: 0.north-america.pool.ntp.org
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
heath:
|
||||||
|
children:
|
||||||
|
mobile:
|
||||||
|
children:
|
||||||
|
laptops:
|
||||||
|
hosts:
|
||||||
|
iris.heath.hpetersenfamily.com:
|
||||||
|
vars:
|
||||||
|
cellphones:
|
||||||
|
hosts:
|
||||||
|
vars:
|
||||||
|
fixed:
|
||||||
|
children:
|
||||||
|
clusters:
|
||||||
|
children:
|
||||||
|
pve:
|
||||||
|
children:
|
||||||
|
pve_heath_hpetersenfamily_com:
|
||||||
|
hosts:
|
||||||
|
pve01.heath.hpetersenfamily.com:
|
||||||
|
pve02.heath.hpetersenfamily.com:
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
mobile:
|
||||||
|
children:
|
||||||
|
laptops:
|
||||||
|
hosts:
|
||||||
|
vars:
|
||||||
|
fixed:
|
||||||
|
children:
|
||||||
|
admins:
|
||||||
|
hosts:
|
||||||
|
admin-a.hpetersenfamily.com:
|
||||||
|
vars:
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
$ ansible-playbook --limit iris.heath.hpetersenfamily.com --list-hosts scraps/update_software.yml
|
||||||
|
$ ansible-playbook --limit iris.heath.hpetersenfamily.com --syntax-check scraps/update_software.yml
|
||||||
|
$ ansible-inventory --list
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# CHANGEME - handle multiple software packaging systems (apt, yum, dnf, rpm, etc.)
|
||||||
|
|
||||||
|
- name: Update software
|
||||||
|
hosts: all
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
post_tasks:
|
||||||
|
|
||||||
|
- name: Remove packages installed as dependencies that are no longer required and purge their configuration files
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoremove: yes
|
||||||
|
purge: true
|
||||||
|
|
||||||
|
- name: Remove old downloaded packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
clean: yes
|
||||||
|
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
ansible-inventory --host "${1}"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# CHANGEME - handle multiple software packaging systems (apt, yum, dnf, rpm, etc.)
|
||||||
|
|
||||||
|
- name: Update software
|
||||||
|
hosts: all
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
|
||||||
|
- name: Update package repositories
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Upgrade all packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
upgrade: full
|
||||||
Reference in New Issue
Block a user