Matrix debugging

This commit is contained in:
2023-12-21 19:50:19 +01:00
parent c676ab4c81
commit d9c9b9ddd0
4 changed files with 112 additions and 75 deletions

View File

@@ -23,11 +23,13 @@
- name: protect inventory directory
file:
path: "{{ matrix_inventory_tmp_dir.path }}"
mode: '0700' # Nur der Besitzer kann lesen, schreiben und ausführen
mode: '0700'
delegate_to: localhost
become: false
- name: set the hosts path
# Host file
- name: set the hosts files path
set_fact:
hosts_path: "{{ matrix_inventory_tmp_dir.path }}/hosts.yml"
@@ -38,6 +40,31 @@
become: false
delegate_to: localhost
# Vars file
- name: set the vars folder path
set_fact:
vars_folder_path: "{{ matrix_inventory_tmp_dir.path }}/host_vars/{{inventory_hostname}}/"
- name: create vars directory
file:
path: "{{vars_folder_path}}"
mode: '0700'
delegate_to: localhost
become: false
- name: set the vars path
set_fact:
vars_file_path: "{{ vars_folder_path }}vars.yml"
- name: create vars.yml
template:
src: "vars.yml.j2"
dest: "{{vars_file_path}}"
become: false
delegate_to: localhost
- name: show variable information
debug:
msg: "hosts_path: {{hosts_path}}\nmatrix_inventory_tmp_dir:{{ matrix_inventory_tmp_dir }}"
@@ -49,6 +76,12 @@
chdir: "{{ local_repository_directory }}"
become: false
- name: play matrix-docker-ansible-deploy
local_action: "command ansible-playbook -i {{hosts_path}} {{local_repository_directory}}/setup.yml -vvv --tags={{matrix_playbook_tags}}"
become: false
#- name: delete inventory directory
# file:
# path: "{{ matrix_inventory_tmp_dir.path }}"