Compare commits

...

6 Commits

Author SHA256 Message Date
heath 0502c4f766 my first playbooks! 2026-07-10 17:06:23 -05:00
heath 18b5cbf644 correct error in ansible.cfg 2026-07-10 17:05:33 -05:00
heath 97b9bc97dd have bootstrap upgrade ansible if already installed 2026-07-10 15:33:39 -05:00
heath 723ac0a24d scraps 2026-07-10 15:32:33 -05:00
heath c5bd013060 created inventory/group_vars/heath.yml 2026-07-10 15:26:01 -05:00
heath 993692447b Initial ansible.cfg and inventory files 2026-07-10 15:11:34 -05:00
9 changed files with 102 additions and 1 deletions
+21
View File
@@ -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
View File
@@ -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}\""
+1
View File
@@ -0,0 +1 @@
ntp_server: 0.north-america.pool.ntp.org
+23
View File
@@ -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:
+12
View File
@@ -0,0 +1,12 @@
---
mobile:
children:
laptops:
hosts:
vars:
fixed:
children:
admins:
hosts:
admin-a.hpetersenfamily.com:
vars:
+5
View File
@@ -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
+19
View File
@@ -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
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/bash
ansible-inventory --host "${1}"
+17
View File
@@ -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