docs(ansible): Document basic functionality
This commit is contained in:
1
ansible/group_vars/all/vars.yml.example
Normal file
1
ansible/group_vars/all/vars.yml.example
Normal file
@@ -0,0 +1 @@
|
||||
ansible_user: 'root'
|
8
ansible/hosts.yml.example
Normal file
8
ansible/hosts.yml.example
Normal file
@@ -0,0 +1,8 @@
|
||||
all:
|
||||
children:
|
||||
groupone:
|
||||
hosts:
|
||||
fully.qualified.domain.name:
|
||||
grouptwo:
|
||||
hosts:
|
||||
anotherfully.qualified.domain.name
|
4
ansible/playbook.yml
Normal file
4
ansible/playbook.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: 'Upgrade packages and reboot where needed'
|
||||
hosts: all
|
||||
roles:
|
||||
- '20-common-40-package-upgrades'
|
@@ -0,0 +1,17 @@
|
||||
- name: 'Upgrade the OS (apt-get dist-upgrade)'
|
||||
ansible.builtin.apt:
|
||||
update_cache: 'yes'
|
||||
upgrade: 'dist'
|
||||
|
||||
|
||||
|
||||
- name: 'Check if reboot required'
|
||||
register: reboot_required_file
|
||||
ansible.builtin.stat:
|
||||
path: '/var/run/reboot-required'
|
||||
|
||||
|
||||
|
||||
- name: 'Reboot if required'
|
||||
when: '(reboot_required_file.stat.exists == true)'
|
||||
ansible.builtin.reboot:
|
@@ -0,0 +1 @@
|
||||
- import_tasks: '40-packages.yml'
|
Reference in New Issue
Block a user