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:
@@ -4,10 +4,13 @@
|
||||
gather_facts: false
|
||||
vars:
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
|
||||
tasks:
|
||||
@@ -18,15 +21,31 @@
|
||||
mode: '755'
|
||||
|
||||
# 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)
|
||||
ansible.builtin.command: git fetch --all
|
||||
args:
|
||||
chdir: "{{agent_s_repo_dir}}"
|
||||
when: agent_s_clone is not changed
|
||||
|
||||
- name: Pull latest changes (Agent-S)
|
||||
ansible.builtin.command: git pull
|
||||
args:
|
||||
chdir: "{{agent_s_repo_dir}}"
|
||||
when: agent_s_clone is not changed
|
||||
|
||||
- name: Create Agent-S archive for specified release
|
||||
ansible.builtin.command: git archive -o "{{agent_s_archive}}" "{{agent_s_rel}}"
|
||||
@@ -34,15 +53,25 @@
|
||||
chdir: "{{agent_s_repo_dir}}"
|
||||
|
||||
# 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)
|
||||
ansible.builtin.command: git fetch --all
|
||||
args:
|
||||
chdir: "{{pulse_xrdp_repo_dir}}"
|
||||
when: pulse_xrdp_clone is not changed
|
||||
|
||||
- name: Pull latest changes (pulseaudio-module-xrdp)
|
||||
ansible.builtin.command: git pull
|
||||
args:
|
||||
chdir: "{{pulse_xrdp_repo_dir}}"
|
||||
when: pulse_xrdp_clone is not changed
|
||||
|
||||
- name: Create pulseaudio-module-xrdp archive for specified release
|
||||
ansible.builtin.command: git archive -o "{{pulse_xrdp_archive}}" "{{pulseaudio_module_xrdp_rel}}"
|
||||
@@ -50,15 +79,31 @@
|
||||
chdir: "{{pulse_xrdp_repo_dir}}"
|
||||
|
||||
# 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)
|
||||
ansible.builtin.command: git fetch --all
|
||||
args:
|
||||
chdir: "{{rommie_repo_dir}}"
|
||||
when: rommie_clone is not changed
|
||||
|
||||
- name: Pull latest changes (rommie)
|
||||
ansible.builtin.command: git pull
|
||||
args:
|
||||
chdir: "{{rommie_repo_dir}}"
|
||||
when: rommie_clone is not changed
|
||||
|
||||
- name: Create rommie archive for specified release
|
||||
ansible.builtin.command: git archive -o "{{rommie_archive}}" "{{rommie_rel}}"
|
||||
|
||||
Reference in New Issue
Block a user