feat(ansible): add conditional git cloning and fix vault variable names

- Add repo URLs and conditional clone tasks for Agent-S, pulseaudio-module-xrdp, and rommie repositories
- Create required directories (github_dir and repo_dir) before cloning
- Update fetch/pull commands to only execute when repositories are not freshly cloned
- Fix vault variable naming inconsistencies in host_vars files (rosalind.incus.yml, titania.incus.yml)
This commit is contained in:
2026-04-11 09:18:25 -04:00
parent 915851acda
commit 82f5e3e094
3 changed files with 50 additions and 5 deletions

View File

@@ -4,10 +4,13 @@
gather_facts: false gather_facts: false
vars: vars:
agent_s_archive: "{{rel_dir}}/agent_s_{{agent_s_rel}}.tar" agent_s_archive: "{{rel_dir}}/agent_s_{{agent_s_rel}}.tar"
agent_s_repo_url: "https://github.com/simular-ai/Agent-S.git"
agent_s_repo_dir: "{{github_dir}}/Agent-S" agent_s_repo_dir: "{{github_dir}}/Agent-S"
pulse_xrdp_archive: "{{rel_dir}}/pulseaudio_module_xrdp_{{pulseaudio_module_xrdp_rel}}.tar" pulse_xrdp_archive: "{{rel_dir}}/pulseaudio_module_xrdp_{{pulseaudio_module_xrdp_rel}}.tar"
pulse_xrdp_repo_url: "https://github.com/neutrinolabs/pulseaudio-module-xrdp.git"
pulse_xrdp_repo_dir: "{{github_dir}}/pulseaudio-module-xrdp" pulse_xrdp_repo_dir: "{{github_dir}}/pulseaudio-module-xrdp"
rommie_archive: "{{rel_dir}}/rommie_{{rommie_rel}}.tar" rommie_archive: "{{rel_dir}}/rommie_{{rommie_rel}}.tar"
rommie_repo_url: "ssh://git@git.helu.ca:22022/r/rommie.git"
rommie_repo_dir: "{{repo_dir}}/rommie" rommie_repo_dir: "{{repo_dir}}/rommie"
tasks: tasks:
@@ -18,15 +21,31 @@
mode: '755' mode: '755'
# Agent-S # Agent-S
- name: Ensure github directory exists
file:
path: "{{github_dir}}"
state: directory
mode: '755'
- name: Clone Agent-S repository if not present
ansible.builtin.git:
repo: "{{agent_s_repo_url}}"
dest: "{{agent_s_repo_dir}}"
version: "{{agent_s_rel}}"
accept_hostkey: true
register: agent_s_clone
- name: Fetch all remote branches and tags (Agent-S) - name: Fetch all remote branches and tags (Agent-S)
ansible.builtin.command: git fetch --all ansible.builtin.command: git fetch --all
args: args:
chdir: "{{agent_s_repo_dir}}" chdir: "{{agent_s_repo_dir}}"
when: agent_s_clone is not changed
- name: Pull latest changes (Agent-S) - name: Pull latest changes (Agent-S)
ansible.builtin.command: git pull ansible.builtin.command: git pull
args: args:
chdir: "{{agent_s_repo_dir}}" chdir: "{{agent_s_repo_dir}}"
when: agent_s_clone is not changed
- name: Create Agent-S archive for specified release - name: Create Agent-S archive for specified release
ansible.builtin.command: git archive -o "{{agent_s_archive}}" "{{agent_s_rel}}" ansible.builtin.command: git archive -o "{{agent_s_archive}}" "{{agent_s_rel}}"
@@ -34,15 +53,25 @@
chdir: "{{agent_s_repo_dir}}" chdir: "{{agent_s_repo_dir}}"
# pulseaudio-module-xrdp # pulseaudio-module-xrdp
- name: Clone pulseaudio-module-xrdp repository if not present
ansible.builtin.git:
repo: "{{pulse_xrdp_repo_url}}"
dest: "{{pulse_xrdp_repo_dir}}"
version: "{{pulseaudio_module_xrdp_rel}}"
accept_hostkey: true
register: pulse_xrdp_clone
- name: Fetch all remote branches and tags (pulseaudio-module-xrdp) - name: Fetch all remote branches and tags (pulseaudio-module-xrdp)
ansible.builtin.command: git fetch --all ansible.builtin.command: git fetch --all
args: args:
chdir: "{{pulse_xrdp_repo_dir}}" chdir: "{{pulse_xrdp_repo_dir}}"
when: pulse_xrdp_clone is not changed
- name: Pull latest changes (pulseaudio-module-xrdp) - name: Pull latest changes (pulseaudio-module-xrdp)
ansible.builtin.command: git pull ansible.builtin.command: git pull
args: args:
chdir: "{{pulse_xrdp_repo_dir}}" chdir: "{{pulse_xrdp_repo_dir}}"
when: pulse_xrdp_clone is not changed
- name: Create pulseaudio-module-xrdp archive for specified release - name: Create pulseaudio-module-xrdp archive for specified release
ansible.builtin.command: git archive -o "{{pulse_xrdp_archive}}" "{{pulseaudio_module_xrdp_rel}}" ansible.builtin.command: git archive -o "{{pulse_xrdp_archive}}" "{{pulseaudio_module_xrdp_rel}}"
@@ -50,15 +79,31 @@
chdir: "{{pulse_xrdp_repo_dir}}" chdir: "{{pulse_xrdp_repo_dir}}"
# Rommie # Rommie
- name: Ensure repo directory exists
file:
path: "{{repo_dir}}"
state: directory
mode: '755'
- name: Clone rommie repository if not present
ansible.builtin.git:
repo: "{{rommie_repo_url}}"
dest: "{{rommie_repo_dir}}"
version: "{{rommie_rel}}"
accept_hostkey: true
register: rommie_clone
- name: Fetch all remote branches and tags (rommie) - name: Fetch all remote branches and tags (rommie)
ansible.builtin.command: git fetch --all ansible.builtin.command: git fetch --all
args: args:
chdir: "{{rommie_repo_dir}}" chdir: "{{rommie_repo_dir}}"
when: rommie_clone is not changed
- name: Pull latest changes (rommie) - name: Pull latest changes (rommie)
ansible.builtin.command: git pull ansible.builtin.command: git pull
args: args:
chdir: "{{rommie_repo_dir}}" chdir: "{{rommie_repo_dir}}"
when: rommie_clone is not changed
- name: Create rommie archive for specified release - name: Create rommie archive for specified release
ansible.builtin.command: git archive -o "{{rommie_archive}}" "{{rommie_rel}}" ansible.builtin.command: git archive -o "{{rommie_archive}}" "{{rommie_rel}}"

View File

@@ -234,6 +234,6 @@ searxng_oauth2_oidc_issuer_url: "https://id.ouranos.helu.ca"
searxng_oauth2_redirect_url: "https://searxng.ouranos.helu.ca/oauth2/callback" searxng_oauth2_redirect_url: "https://searxng.ouranos.helu.ca/oauth2/callback"
# OAuth2 Credentials (from vault) # OAuth2 Credentials (from vault)
searxng_oauth2_client_id: "{{ vault_searxng_oauth2_client_id }}" searxng_oauth2_client_id: "{{ vault_searxng_oauth_client_id }}"
searxng_oauth2_client_secret: "{{ vault_searxng_oauth2_client_secret }}" searxng_oauth2_client_secret: "{{ vault_searxng_oauth_client_secret }}"
searxng_oauth2_cookie_secret: "{{ vault_searxng_oauth2_cookie_secret }}" searxng_oauth2_cookie_secret: "{{ vault_searxng_oauth_cookie_secret }}"

View File

@@ -259,7 +259,7 @@ openwebui_oauth2_client_id: "{{ vault_openwebui_oauth_client_id }}"
openwebui_oauth2_client_secret: "{{ vault_openwebui_oauth_client_secret }}" openwebui_oauth2_client_secret: "{{ vault_openwebui_oauth_client_secret }}"
pgadmin_oauth_client_id: "{{ vault_pgadmin_oauth_client_id }}" pgadmin_oauth_client_id: "{{ vault_pgadmin_oauth_client_id }}"
pgadmin_oauth_client_secret: "{{ vault_pgadmin_oauth_client_secret }}" pgadmin_oauth_client_secret: "{{ vault_pgadmin_oauth_client_secret }}"
searxng_oauth2_client_id: "{{ vault_searxng_oauth2_client_id }}" searxng_oauth2_client_id: "{{ vault_searxng_oauth_client_id }}"
searxng_oauth2_client_secret: "{{ vault_searxng_oauth2_client_secret }}" searxng_oauth2_client_secret: "{{ vault_searxng_oauth_client_secret }}"
spelunker_oauth2_client_id: "{{ vault_spelunker_oauth_client_id }}" spelunker_oauth2_client_id: "{{ vault_spelunker_oauth_client_id }}"
spelunker_oauth2_client_secret: "{{ vault_spelunker_oauth_client_secret }}" spelunker_oauth2_client_secret: "{{ vault_spelunker_oauth_client_secret }}"