chore!: separated galaxy deps and own collections; modified ansible script generation to use two paths for collections

REQUIRES REGENERATING ansible.cfg!
This commit is contained in:
NaeiKinDus 2025-02-23 00:00:00 +00:00
parent 4af69c31ce
commit 888590ed9f
Signed by: WoodSmellParticle
GPG key ID: 8E52ADFF7CA8AE56
188 changed files with 30 additions and 30 deletions

View file

@ -0,0 +1,18 @@
---
- name: load provisioner facts
block:
- name: save current provisioner hostname
ansible.builtin.set_fact:
provisioner_hostname: '{{ lookup("ansible.builtin.pipe", "hostname") }}'
- name: retrieve hostnames and IP addresses of all provisioners
ansible.builtin.set_fact:
provisioner_controllers_list:
'{{ provisioner_controllers_list | default({}) | combine({hostvars[item]["ansible_host"]: lookup("community.general.dig", hostvars[item]["ansible_host"])}) }}'
loop: '{{ groups["provisioner"] }}'
- name: retrieve provisioner inventory facts
ansible.builtin.set_fact:
provisioner_facts: '{{ dict(hostvars[provisioner_hostname]) | combine({"provisioner_controllers_list": provisioner_controllers_list}) | moreati.jq.jq(JSON_MATCH_QUERY) }}'
when: inventory_hostname == ansible_play_hosts_all[0]
run_once: true
vars:
JSON_MATCH_QUERY: 'to_entries | map(select(.key | match("^provisioner_.+")) | .key |= ltrimstr("provisioner_")) | from_entries'

View file

@ -0,0 +1,57 @@
---
# add https://github.com/databus23/helm-diff
- name: set default facts
ansible.builtin.set_fact:
provisioner_playbook_user: '{{ lookup("env", "USER") }}'
changed_when: false
- name: install helm
ansible.builtin.include_role:
name: nullified.infrastructure.helm
vars:
helm_binary_path: '{{ provisioner_helm_binary_path }}'
helm_install_version: '{{ provisioner_helm_version }}'
- name: install kubectl
ansible.builtin.include_role:
name: nullified.infrastructure.kubectl
vars:
kubectl_binary_path: '{{ provisioner_kubectl_binary_path }}'
kubectl_install_version: '{{ provisioner_kubectl_version }}'
- name: install OpenTofu
become: true
nullified.infrastructure.github_artifact:
github_token: '{{ provisioner_github_token }}'
asset_name: 'tofu_{version}_amd64.deb'
asset_type: release
creates: '{{ provisioner_tofu_binary_path }}' # path used by the .deb, no control over it
repository: opentofu/opentofu
force: true
cmds:
- 'dpkg -i {asset_dirname}/{asset_filename}'
- name: retrieve k3sup on Ansible controller
become: true
nullified.infrastructure.github_artifact:
asset_name: k3sup
asset_type: release
repository: alexellis/k3sup
github_token: "{{ provisioner_github_token }}"
creates: '{{ provisioner_k3sup_binary_path }}'
force: true
cmds:
- "install --mode=755 {asset_dirname}/{asset_filename} {{ provisioner_k3sup_binary_path }}"
- name: create storage directories
become: true
ansible.builtin.file:
path: '{{ item }}'
mode: '0700'
owner: '{{ provisioner_playbook_user }}'
group: '{{ provisioner_playbook_user }}'
state: directory
loop:
- '{{ provisioner_artifacts_dir }}'
- '{{ provisioner_k8s_states_dir }}'
- '{{ provisioner_kubeconfig_repository }}'