Syncing current state.

This commit is contained in:
2021-12-19 21:32:19 -06:00
parent eb39acaa06
commit 94a4736839
20 changed files with 1599 additions and 180 deletions

View File

@@ -2,11 +2,11 @@
# deploy.yml
#
# This playbook details how an entire datacenter should be deployed
#
#
# Parameters:
# threads: Number of threads to use; default is 8.
- hosts: all
- hosts: managed
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
@@ -14,87 +14,31 @@
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- basics
- networking
- SSH
- Sharingan-Data
- hosts: DarkNet
- hosts: geth-hubs
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- DarkNet
- SSH
- Geth-Hub
- hosts: Core
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- SSL
- Yggdrasil
- WebServer
- Foundation
- IRC
- Sharingan-IDS
- hosts: Maat
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- Maat
- hosts: Sharingan
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- Sharingan
- hosts: MaatBuilder
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- MaatBuilder
- hosts: Nazara
order: sorted
serial: "{{ threads | default('8') }}"
gather_facts: true
ignore_unreachable: true
vars_files:
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
vars:
roles:
- MaatBuilder
# - hosts: Core
# order: sorted
# serial: "{{ threads | default('8') }}"
# gather_facts: true
# ignore_unreachable: true
# vars_files:
# - "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
# vars:
# roles:
# - Yggdrasil
# - WebServer
# - TheRaven

View File

@@ -1,15 +1,13 @@
---
# patching.yml
#
# This playbook can be used to patch all the servers in an inventory to the latest on the repo servers
# This playbook can be used to patch all the servers in an inventory to the latest software available.
# Because we typically encrypt our disk storage, we don't wait for the connection to become available again.
# Variables:
# - hosts: the host grouper in the inventory -- default: all
# - action: update or upgrade -- default: update
# - delay: minutes to wait after a reboot -- default 5
#
# - target: the host grouper in the inventory -- default: all
#
# Patch then restart a node
- hosts: "{{ hosts | default('all') }}"
- hosts: "{{ target | default('all') }}"
order: sorted
ignore_unreachable: true
serial: 1
@@ -18,7 +16,7 @@
ansible_become_user: root
ansible_become_method: sudo
vars_files:
- "{{ playbook_dir }}/../.vault"
- "{{ lookup('env', 'ANSIBLE_VAULT_FILE') }}"
tasks:
- name: Check /var free percentage
command: /bin/bash -c "df -m /var | tail -n 1 | awk '{ print $5; }' | sed 's/%//' "
@@ -31,22 +29,22 @@
- 90 > {{ df_output.stdout }}
fail_msg: "Not enough free space"
- name: Patching
- name: Patching all packages (ArchLinux)
ignore_errors: yes
yum:
name: '*'
state: latest
when: ansible_os_family == "Archlinux"
pacman:
upgrade: yes
update_cache: yes
# disablerepo: '*'
enablerepo: rhel-7-server-rpms-nist
register: patching_output
- debug:
msg: "{{ patching_output }}"
- name: Patching all packages (Debian)
ignore_errors: yes
when: ansible_os_family == "Debian"
apt:
upgrade: yes
update_cache: yes
- name: Reboot
ignore_errors: yes
reboot:
- name: Wait for reboot
wait_for_connection:
reboot_timeout: 2