From e37d84c60d5629e5da4af836c3aaab2a2deb2d23 Mon Sep 17 00:00:00 2001 From: Dario <446-dario@users.noreply.gitlab.hamburg.ccc.de> Date: Sun, 21 May 2023 15:12:42 +0200 Subject: [PATCH] clean up foobazdmx role make git repo url and version to check out a variable instead of a hard-coded value the role, and update host_vars to match. --- inventories/z9/host_vars/light.yaml | 4 +++- playbooks/roles/foobazdmx/defaults/main.yaml | 1 + playbooks/roles/foobazdmx/meta/argument_specs.yaml | 8 ++++++++ playbooks/roles/foobazdmx/tasks/main.yaml | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 playbooks/roles/foobazdmx/defaults/main.yaml diff --git a/inventories/z9/host_vars/light.yaml b/inventories/z9/host_vars/light.yaml index 1e69d9f..6957969 100644 --- a/inventories/z9/host_vars/light.yaml +++ b/inventories/z9/host_vars/light.yaml @@ -1,3 +1,6 @@ +foobazdmx__art_net_host: localhost +foobazdmx_version: main +foobazdmx_repo_url: "https://ccchh-ansible:glpat-istRKj5ivdBs_u9Tsdbp@gitlab.hamburg.ccc.de/ccchh/foobazdmx.git" ola__configs: - name: ola-artnet content: "{{ lookup('ansible.builtin.file', 'configs/light/ola/ola-artnet.conf') }}" @@ -47,7 +50,6 @@ ola__configs: content: "{{ lookup('ansible.builtin.file', 'configs/light/ola/ola-usbdmx.conf') }}" - name: ola-usbserial content: "{{ lookup('ansible.builtin.file', 'configs/light/ola/ola-usbserial.conf') }}" -foobazdmx__art_net_host: localhost nginx__version_spec: "" nginx__deploy_redirect_conf: false nginx__configurations: diff --git a/playbooks/roles/foobazdmx/defaults/main.yaml b/playbooks/roles/foobazdmx/defaults/main.yaml new file mode 100644 index 0000000..9d005b7 --- /dev/null +++ b/playbooks/roles/foobazdmx/defaults/main.yaml @@ -0,0 +1 @@ +foobazdmx_version: main diff --git a/playbooks/roles/foobazdmx/meta/argument_specs.yaml b/playbooks/roles/foobazdmx/meta/argument_specs.yaml index 1e7d417..9a5d256 100644 --- a/playbooks/roles/foobazdmx/meta/argument_specs.yaml +++ b/playbooks/roles/foobazdmx/meta/argument_specs.yaml @@ -2,6 +2,14 @@ argument_specs: main: options: + foobazdmx_version: + description: git branch, tag, or commit to check out from the foobazdmx repo + type: str + default: main + foobazdmx_repo_url: + description: git repo to pull foobazdmx from + type: str + required: true foobazdmx__art_net_host: description: IP oder hostname of the Art-Net server type: str diff --git a/playbooks/roles/foobazdmx/tasks/main.yaml b/playbooks/roles/foobazdmx/tasks/main.yaml index b6c65af..407bab0 100644 --- a/playbooks/roles/foobazdmx/tasks/main.yaml +++ b/playbooks/roles/foobazdmx/tasks/main.yaml @@ -24,9 +24,9 @@ - name: Clone foobazdmx repository become: true ansible.builtin.git: - repo: https://ccchh-ansible:glpat-istRKj5ivdBs_u9Tsdbp@gitlab.hamburg.ccc.de/ccchh/foobazdmx.git + repo: "{{ foobazdmx_repo_url }}" dest: /opt/foobazdmx - version: main + version: "{{ foobazdmx_version }}" - name: Install python dependencies become: true become_user: foobazdmx