Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feature/install module from git #198

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor condition to filter source git and rework parsing of version
christoph2497 committed Oct 20, 2023
commit 09c8b896302753bd69a2e65c5d11dea910d28cda
11 changes: 2 additions & 9 deletions roles/icingaweb2/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -22,23 +22,16 @@
ansible.builtin.set_fact:
icingaweb2_git_packages: "{{ icingaweb2_git_packages + [item] }}"
loop: "{{ icingaweb2_modules | dict2items }}"
when: icingaweb2_modules is defined and item.value.enabled is true and item.value.source.startswith("git")
when: icingaweb2_modules is defined and item.value.enabled is true and (item.value.source | split(','))[0] == "git"

- name: Include OS specific installation
ansible.builtin.include_tasks: "install_on_{{ ansible_os_family | lower }}.yml"

- name: Debug icingaweb2_packages
debug:
msg: "{{ (item.value.source | split (',') )[2] | default('HEAD') }}"
loop: "{{ icingaweb2_git_packages }}"
when: item.value.source.startswith('git')
# msg: "{{ icingaweb2_git_packages['test_module']['value'] }}"

- name: Install Icingaweb2 Module from Git
ansible.builtin.git:
repo: "{{ (item.value.source | split(','))[1] }}"
dest: "{{ icingaweb2_config['global']['module_path'] }}/{{ item.key }}"
version: "{{ (item.value.source | split(',') | last) if (item.value.source | split(',') | length) == 3 else 'HEAD' }}"
version: "{{ (item.value.source | split(',')[2] | default(omit) }}"
loop: "{{ icingaweb2_git_packages }}"
when: icingaweb2_modules is defined and item.value.enabled is true and (item.value.source | split(','))[0] == "git"