From a2a5f6eedc5a7fa499ff02d3627450e9e85b8cd6 Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 23 Aug 2021 20:20:59 -0500 Subject: [PATCH] Begin a refactor of playbook naming and organization --- .gitlab-ci.yml | 4 ++-- playbooks/{pistorage.yml => pik8s-storage.yml} | 4 +++- playbooks/pik8s.yml | 6 +++--- playbooks/{ansible-pull.yml => tags_ansible-pull.yml} | 0 site.yml | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) rename playbooks/{pistorage.yml => pik8s-storage.yml} (94%) rename playbooks/{ansible-pull.yml => tags_ansible-pull.yml} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12f97c3..6846bd9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,10 +60,10 @@ Test: - if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi - if [ -n "$error" ]; then echo "Return code $error"; false; fi -Play_Against_Pis: +Play_Against_PiK8S: stage: play script: - - ansible-playbook -l tags_pis site.yml --vault-password-file /vaultpw || error="$?" + - ansible-playbook -l device_roles_pik8s-master,device_roles_pik8s-node,device_roles_pik8s-storage site.yml --vault-password-file /vaultpw || error="$?" - if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi - if [ -n "$error" ]; then echo "Return code $error"; false; fi Play_Against_Desktops: diff --git a/playbooks/pistorage.yml b/playbooks/pik8s-storage.yml similarity index 94% rename from playbooks/pistorage.yml rename to playbooks/pik8s-storage.yml index 1601e75..a8c6834 100755 --- a/playbooks/pistorage.yml +++ b/playbooks/pik8s-storage.yml @@ -2,8 +2,10 @@ # vim:ft=ansible: --- # Mass storage Pis -- hosts: tags_pistorage +- hosts: device_roles_pik8s-storage tasks: + # The specific mount here is because each storage node as an M.2 SSD hooked up to it + # So we mount that and use the SD card for normal OS shenanigans - name: assure mount directory file: path=/data state=directory mode=0755 tags: [ pis, storage ] diff --git a/playbooks/pik8s.yml b/playbooks/pik8s.yml index 54f73a8..0b5398e 100755 --- a/playbooks/pik8s.yml +++ b/playbooks/pik8s.yml @@ -2,7 +2,7 @@ # vim:ft=ansible: --- # k8s -- hosts: tags_pik8s +- hosts: device_roles_pik8s-master,device_roles_pik8s-node gather_facts: no roles: - role: k8s @@ -12,13 +12,13 @@ backup_s3backup_list_extra: - /etc/kubernetes tags: [ k8s, backup ] -- hosts: tags_pik8s-master +- hosts: device_roles_pik8s-master gather_facts: no tasks: - name: install openshift pip: name=openshift state=latest tags: [ k8s, packages, pip ] -- hosts: tags_pik8s-node +- hosts: device_roles_pik8s-node gather_facts: no roles: - role: keepalived diff --git a/playbooks/ansible-pull.yml b/playbooks/tags_ansible-pull.yml similarity index 100% rename from playbooks/ansible-pull.yml rename to playbooks/tags_ansible-pull.yml diff --git a/site.yml b/site.yml index a11b85e..6f686b7 100755 --- a/site.yml +++ b/site.yml @@ -46,10 +46,10 @@ - import_playbook: playbooks/web.yml - import_playbook: playbooks/game.yml - import_playbook: playbooks/pis.yml -- import_playbook: playbooks/pistorage.yml +- import_playbook: playbooks/pik8s-storage.yml - import_playbook: playbooks/pik8s.yml - import_playbook: playbooks/desktop.yml # Background task configuration -- import_playbook: playbooks/ansible-pull.yml +- import_playbook: playbooks/tags_ansible-pull.yml # Housekeeping - import_playbook: playbooks/docker-prune.yml