From 6587463aa6b63c822aeeac7df1e67aa12d06e425 Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Mon, 4 Nov 2024 19:05:34 -0500 Subject: [PATCH] restructuring --- .gitignore | 2 ++ ansible.cfg | 1 + inventory/inventory | 11 ++++--- playbooks/{ => caddy}/setup_webserver.yml | 2 +- playbooks/{ => common}/secure_server.yml | 0 playbooks/{ => common}/setup_keys.yml | 0 playbooks/{ => common}/update_upgrade.yml | 30 +++++++++---------- .../{ => gitea}/setup_database_gitea.yml | 3 -- playbooks/helm/install_helm.yaml | 6 ++++ playbooks/{ => k8s}/control_node.yml | 3 -- playbooks/{ => k8s}/setup_nodes.yml | 0 playbooks/{ => nextcloud}/setup_nextcloud.yml | 0 12 files changed, 32 insertions(+), 26 deletions(-) rename playbooks/{ => caddy}/setup_webserver.yml (93%) rename playbooks/{ => common}/secure_server.yml (100%) rename playbooks/{ => common}/setup_keys.yml (100%) rename playbooks/{ => common}/update_upgrade.yml (65%) rename playbooks/{ => gitea}/setup_database_gitea.yml (99%) create mode 100644 playbooks/helm/install_helm.yaml rename playbooks/{ => k8s}/control_node.yml (99%) rename playbooks/{ => k8s}/setup_nodes.yml (100%) rename playbooks/{ => nextcloud}/setup_nextcloud.yml (100%) diff --git a/.gitignore b/.gitignore index 769c244..9642d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ secrets.yml +roles/* +collections/* diff --git a/ansible.cfg b/ansible.cfg index 9a6f5a1..3b5da2d 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -2,3 +2,4 @@ inventory=./inventory remote_user="ansible" roles_path=./roles +collections_path=./collections diff --git a/inventory/inventory b/inventory/inventory index 4980be2..d9caafa 100644 --- a/inventory/inventory +++ b/inventory/inventory @@ -1,15 +1,19 @@ -[docker] -192.168.2.240 - [control] localhost [dns] 192.168.2.236 +[docker] +192.168.1.236 ansible_user=ansible + [aws] aws ansible_user=ubuntu +[helm] +192.168.1.233 ansible_user=ansible +192.168.1.237 ansible_user=ansible + [dhcp] 192.168.2.191 @@ -30,4 +34,3 @@ bane ansible_user=ansible ansible_connection=winrm ansible_winrm_transport=basic [servers:children] doc aws -local diff --git a/playbooks/setup_webserver.yml b/playbooks/caddy/setup_webserver.yml similarity index 93% rename from playbooks/setup_webserver.yml rename to playbooks/caddy/setup_webserver.yml index 57a5f56..10049c1 100644 --- a/playbooks/setup_webserver.yml +++ b/playbooks/caddy/setup_webserver.yml @@ -1,5 +1,5 @@ --- -- name: installs and setups nginx on hosts +- name: installs and setups caddy on hosts hosts: aws become: true vars: diff --git a/playbooks/secure_server.yml b/playbooks/common/secure_server.yml similarity index 100% rename from playbooks/secure_server.yml rename to playbooks/common/secure_server.yml diff --git a/playbooks/setup_keys.yml b/playbooks/common/setup_keys.yml similarity index 100% rename from playbooks/setup_keys.yml rename to playbooks/common/setup_keys.yml diff --git a/playbooks/update_upgrade.yml b/playbooks/common/update_upgrade.yml similarity index 65% rename from playbooks/update_upgrade.yml rename to playbooks/common/update_upgrade.yml index 614e1b0..3a4b159 100644 --- a/playbooks/update_upgrade.yml +++ b/playbooks/common/update_upgrade.yml @@ -36,23 +36,23 @@ name: "*" state: latest -- name: Upgrade pihole on dns using docker compose - hosts: pihole - tasks: - - name: pull new images via docker compose - command: - cmd: docker compose -f pihole_compose.yml pull - chdir: /home/pollen/pihole +#- name: Upgrade pihole on dns using docker compose + #hosts: pihole + #tasks: + #- name: pull new images via docker compose + #command: + #cmd: docker compose -f pihole_compose.yml pull + #chdir: /home/pollen/pihole - - name: remove the currently running container - command: - cmd: docker compose -f pihole_compose.yml down - chdir: /home/pollen/pihole + #- name: remove the currently running container + #command: + #cmd: docker compose -f pihole_compose.yml down + #chdir: /home/pollen/pihole - - name: bring back pihole container - command: - cmd: docker compose -f pihole_compose.yml up -d - chdir: /home/pollen/pihole + #- name: bring back pihole container + #command: + #cmd: docker compose -f pihole_compose.yml up -d + #chdir: /home/pollen/pihole # work in progress for windows host # - name: Upgrade software on windows hosts diff --git a/playbooks/setup_database_gitea.yml b/playbooks/gitea/setup_database_gitea.yml similarity index 99% rename from playbooks/setup_database_gitea.yml rename to playbooks/gitea/setup_database_gitea.yml index b0b6b0a..5150741 100644 --- a/playbooks/setup_database_gitea.yml +++ b/playbooks/gitea/setup_database_gitea.yml @@ -147,6 +147,3 @@ name: gitea state: started enabled: yes - - - diff --git a/playbooks/helm/install_helm.yaml b/playbooks/helm/install_helm.yaml new file mode 100644 index 0000000..062d160 --- /dev/null +++ b/playbooks/helm/install_helm.yaml @@ -0,0 +1,6 @@ +--- +- name: use Jeff GeerlingGuy's role to install helm + become: true + hosts: helm + roles: + - role: geerlingguy.helm diff --git a/playbooks/control_node.yml b/playbooks/k8s/control_node.yml similarity index 99% rename from playbooks/control_node.yml rename to playbooks/k8s/control_node.yml index c1a808f..c1abe9f 100644 --- a/playbooks/control_node.yml +++ b/playbooks/k8s/control_node.yml @@ -32,6 +32,3 @@ groups: - kvm - libvirt - - - diff --git a/playbooks/setup_nodes.yml b/playbooks/k8s/setup_nodes.yml similarity index 100% rename from playbooks/setup_nodes.yml rename to playbooks/k8s/setup_nodes.yml diff --git a/playbooks/setup_nextcloud.yml b/playbooks/nextcloud/setup_nextcloud.yml similarity index 100% rename from playbooks/setup_nextcloud.yml rename to playbooks/nextcloud/setup_nextcloud.yml