Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[defaults]
localhost_warning=False
retry_files_enabled=False
# Retry files disabled to avoid cluttering CI/CD environments
interpreter_python=auto_silent
host_key_checking=False
timeout=30
library=~/.ansible/plugins/modules:./ansible/plugins/modules:./common/ansible/plugins/modules:/usr/share/ansible/plugins/modules
roles_path=~/.ansible/roles:./ansible/roles:./common/ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
filter_plugins=~/.ansible/plugins/filter:./ansible/plugins/filter:./common/ansible/plugins/filter:/usr/share/ansible/plugins/filter
22 changes: 19 additions & 3 deletions ansible/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,31 @@
hosts: localhost
connection: local
tasks:
- name: Verify pattern.sh exists
ansible.builtin.stat:
path: "{{ playbook_dir }}/../pattern.sh"
register: pattern_script

- name: Fail if pattern.sh does not exist
ansible.builtin.fail:
msg: "pattern.sh not found at {{ playbook_dir }}/../pattern.sh"
when: not pattern_script.stat.exists

# We cannot use .package or .dnf modules because python3 that is used comes
# from a virtualenv
- name: Launch the installation
ansible.builtin.command: ./pattern.sh make install
args:
chdir: "{{ lookup('env', 'PWD') }}"
chdir: "{{ playbook_dir }}/.."
register: output
changed_when: false
changed_when: output.rc == 0
failed_when: output.rc != 0

- name: Print output of installation
ansible.builtin.debug:
msg: "{{ output }}"
msg: "{{ output.stdout_lines }}"

- name: Print errors if any
ansible.builtin.debug:
msg: "{{ output.stderr_lines }}"
when: output.stderr_lines | length > 0