From 3a9f48a908bd4f04a145176cb05945890ab7685f Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 16 Dec 2024 10:15:20 +0100 Subject: [PATCH 1/5] pinned requirements --- prepare.sh | 2 +- roles/requirements.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/prepare.sh b/prepare.sh index 06465f9..a90a516 100755 --- a/prepare.sh +++ b/prepare.sh @@ -1,3 +1,3 @@ #!/bin/bash -ansible-galaxy install -p galaxy_roles -r roles/requirements.yml --force +ansible-galaxy install -p galaxy_roles -r roles/requirements.yml ansible-galaxy collection install -r collections/requirements.yml diff --git a/roles/requirements.yml b/roles/requirements.yml index 52b3e05..0e827ba 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -1,9 +1,15 @@ --- roles: + - src: andrewrothstein.krew + version: v1.2.0 - src: andrewrothstein.opentofu + version: 1.0.9 - src: andrewrothstein.powershell + version: v1.2.2 - src: andrewrothstein.terraform + version: v3.0.38 - src: geerlingguy.docker + version: 7.4.3 - src: bbaassssiiee.postgres_ssl name: postgres version: 1.1.0 From e71ba2f16234990eaba92dce5056be1856fdc25e Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 16 Dec 2024 10:17:05 +0100 Subject: [PATCH 2/5] roles_path unsupported by Semaphore --- ansible.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index 1c5a243..8a6c3be 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,14 +1,14 @@ [defaults] ; don't use smart fact caching because ansible_env changes inbetween plays. -roles_path = galaxy_roles:roles +roles_path = roles ; Debian default shell doesn't support pipefail option. executable = /bin/bash ; set inventory here, or on the command-line when running Ansible. ; dev is for Vagrant with Hyper-V, VMWare Desktop or VirtualBox ; local is for localhost, assuming AlmaLinux or Rocky -inventory = inventory/local/hosts +inventory = inventory/dev/hosts ; Vagrant hosts are ephemeral set to true when promoting beyond test. host_key_checking = False From 00c0ae34ddc218e05094ea36df96b9eb171951fd Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 16 Dec 2024 10:18:40 +0100 Subject: [PATCH 3/5] roles_path unsupported by Semaphore --- prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare.sh b/prepare.sh index a90a516..964505d 100755 --- a/prepare.sh +++ b/prepare.sh @@ -1,3 +1,3 @@ #!/bin/bash -ansible-galaxy install -p galaxy_roles -r roles/requirements.yml +ansible-galaxy install -p roles -r roles/requirements.yml ansible-galaxy collection install -r collections/requirements.yml From dd019e89ebd1cdbd5348c632e92bf180fb67b63b Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 16 Dec 2024 10:34:28 +0100 Subject: [PATCH 4/5] dependencies update --- .gitignore | 4 +++- galaxy_roles/.gitkeep | 3 --- inventory/dev/group_vars/all.yml | 9 +++++++++ inventory/dev/hosts | 9 +++------ inventory/test/group_vars/all.yml | 11 ++++++++++- provision.yml | 11 ++++++++--- roles/requirements.yml | 3 --- 7 files changed, 33 insertions(+), 17 deletions(-) delete mode 100644 galaxy_roles/.gitkeep diff --git a/.gitignore b/.gitignore index b353c20..7ad90dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,9 @@ .output-images/ .vagrant/ .vscode/ -galaxy_roles/* +roles/andrewrothstein.* +roles/bbaassssiiee.* +roles/geerlingguy.* files/* *.iso *.box diff --git a/galaxy_roles/.gitkeep b/galaxy_roles/.gitkeep deleted file mode 100644 index 6fd127a..0000000 --- a/galaxy_roles/.gitkeep +++ /dev/null @@ -1,3 +0,0 @@ -## roles_path: galaxy_roles:roles -# To install -ansible-galaxy install -p galaxy_roles -r roles/requirements.yml diff --git a/inventory/dev/group_vars/all.yml b/inventory/dev/group_vars/all.yml index 5c679a9..29d0deb 100644 --- a/inventory/dev/group_vars/all.yml +++ b/inventory/dev/group_vars/all.yml @@ -3,4 +3,13 @@ docker_users: - "{{ ansible_user }}" docker_install_compose: true docker_install_compose_plugin: true + +kubectl_ver: v1.29.3 +kubectl_install_dir: /usr/bin +use_krew: true +krew_install_plugins: + - ctx + - ns + - stern + server_name: "{{ ansible_fqdn | default(ansible_hostname) }}" diff --git a/inventory/dev/hosts b/inventory/dev/hosts index d212d63..94005c8 100644 --- a/inventory/dev/hosts +++ b/inventory/dev/hosts @@ -1,6 +1,3 @@ -[local] -localhost connection=local - [dev:children] control @@ -10,11 +7,11 @@ semaphore web [database] -controller ansible_host=10.0.0.206 +controller ansible_host=192.168.178.60 [semaphore] -controller ansible_host=10.0.0.206 +controller ansible_host=192.168.178.60 [web] -controller ansible_host=10.0.0.206 +controller ansible_host=192.168.178.60 [dev:vars] ansible_user=vagrant diff --git a/inventory/test/group_vars/all.yml b/inventory/test/group_vars/all.yml index 665e38b..76e6ba3 100644 --- a/inventory/test/group_vars/all.yml +++ b/inventory/test/group_vars/all.yml @@ -1,5 +1,14 @@ --- docker_install_compose: true docker_install_compose_plugin: true -server_name: acsNode + +kubectl_ver: v1.29.3 +kubectl_install_dir: /usr/bin +use_krew: true +krew_install_plugins: + - ctx + - ns + - stern + postgres_listen_addresses: '127.0.0.1' +server_name: acsNode diff --git a/provision.yml b/provision.yml index 8da7451..773dbfb 100755 --- a/provision.yml +++ b/provision.yml @@ -25,7 +25,7 @@ read -sp "Enter database password: " DB_PASS && export DB_PASS ; echo roles: - - role: postgres + - role: bbaassssiiee.postgres_ssl - name: Semaphore in Systemd hosts: semaphore @@ -63,7 +63,7 @@ - name: Install Squid proxy ansible.builtin.import_role: - name: proxy + name: bbaassssiiee.proxy tags: [proxy] - name: Tools @@ -77,6 +77,11 @@ - semaphore tasks: + - name: Install Krew + when: use_krew | bool + ansible.builtin.include_role: + name: andrewrothstein.krew + - name: Install OpenTofu when: use_opentofu | bool ansible.builtin.include_role: @@ -121,5 +126,5 @@ become: true gather_facts: true roles: - - role: nginx + - role: bbaassssiiee.nginx_ssl tags: [nginx] diff --git a/roles/requirements.yml b/roles/requirements.yml index 0e827ba..507718e 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -11,11 +11,8 @@ roles: - src: geerlingguy.docker version: 7.4.3 - src: bbaassssiiee.postgres_ssl - name: postgres version: 1.1.0 - src: bbaassssiiee.nginx_ssl - name: nginx version: 1.0.5 - src: bbaassssiiee.proxy - name: proxy version: 1.0.3 From 9eff7617e6f0f5e623086e91a88dd10bfd2a1460 Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 16 Dec 2024 10:41:21 +0100 Subject: [PATCH 5/5] use_helm boolean to install on controller --- inventory/dev/group_vars/all.yml | 3 ++- inventory/test/group_vars/all.yml | 3 ++- provision.yml | 5 +++++ roles/requirements.yml | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/inventory/dev/group_vars/all.yml b/inventory/dev/group_vars/all.yml index 29d0deb..fb63f2c 100644 --- a/inventory/dev/group_vars/all.yml +++ b/inventory/dev/group_vars/all.yml @@ -4,9 +4,10 @@ docker_users: docker_install_compose: true docker_install_compose_plugin: true +use_helm: true +use_krew: true kubectl_ver: v1.29.3 kubectl_install_dir: /usr/bin -use_krew: true krew_install_plugins: - ctx - ns diff --git a/inventory/test/group_vars/all.yml b/inventory/test/group_vars/all.yml index 76e6ba3..df7d663 100644 --- a/inventory/test/group_vars/all.yml +++ b/inventory/test/group_vars/all.yml @@ -2,9 +2,10 @@ docker_install_compose: true docker_install_compose_plugin: true +use_helm: true +use_krew: true kubectl_ver: v1.29.3 kubectl_install_dir: /usr/bin -use_krew: true krew_install_plugins: - ctx - ns diff --git a/provision.yml b/provision.yml index 773dbfb..51d76bd 100755 --- a/provision.yml +++ b/provision.yml @@ -77,6 +77,11 @@ - semaphore tasks: + - name: Install Helm + when: use_helm | bool + ansible.builtin.include_role: + name: andrewrothstein.kubernetes_helm + - name: Install Krew when: use_krew | bool ansible.builtin.include_role: diff --git a/roles/requirements.yml b/roles/requirements.yml index 507718e..60321a0 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -1,5 +1,7 @@ --- roles: + - src: andrewrothstein.kubernetes_helm + version: 3.0.17 - src: andrewrothstein.krew version: v1.2.0 - src: andrewrothstein.opentofu