Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ jobs:
- name: Install Ansible Galaxy collection dependencies
run: ansible-galaxy collection install -r requirements.yml

# Collection modules are referenced by short name inside this collection.
# ansible-lint syntax-check does not always get collection context, so point
# ANSIBLE_LIBRARY at plugins/modules (same as Ansible local library lookup).
- name: Run ansible-lint
env:
ANSIBLE_LIBRARY: ${{ github.workspace }}/plugins/modules
run: ansible-lint roles playbooks plugins
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ super-linter: ## Runs super linter locally
.PHONY: ansible-lint
ansible-lint: ## run ansible lint on ansible/ folder
podman run -it -v $(PWD):/workspace:rw,z --workdir /workspace \
-e ANSIBLE_LIBRARY=/workspace/plugins/modules \
--entrypoint "/usr/local/bin/ansible-lint" quay.io/ansible/creator-ee:latest "-vvv" "roles" "plugins" "playbooks"

.PHONY: ansible-sanitytest
Expand Down
31 changes: 30 additions & 1 deletion playbooks/display_secrets_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,35 @@
kubernetes_secret_objects: "{{ secrets_results_late.kubernetes_secret_objects | default([]) }}"
unique_vault_prefixes: "{{ secrets_results_late.unique_vault_prefixes | default([]) }}"

- name: Display secrets data (early and late phases)
- name: Resolve stdout callback for secrets display
ansible.builtin.set_fact:
_vp_stdout_callback: "{{ lookup('config', 'DEFAULT_STDOUT_CALLBACK') | default('default', true) }}"
_vp_default_result_format: >-
{{ lookup('config', 'result_format', plugin_type='callback', plugin_name='default')
| default('json', true) }}

- name: Display secrets data as pretty JSON text
ansible.builtin.debug:
msg: "{{ secrets_display_by_phase | to_nice_json }}"
when: >-
_vp_stdout_callback in ['community.general.yaml', 'yaml']
or (
_vp_stdout_callback in ['default', 'ansible.builtin.default']
and _vp_default_result_format == 'yaml'
)
or _vp_stdout_callback not in [
'community.general.null', 'minimal', 'community.general.dense',
'community.general.yaml', 'yaml',
'default', 'ansible.builtin.default',
'ansible.posix.json', 'ansible.posix.jsonl'
]

- name: Display secrets data as JSON structure
ansible.builtin.debug:
var: secrets_display_by_phase
when: >-
_vp_stdout_callback in ['ansible.posix.json', 'ansible.posix.jsonl']
or (
_vp_stdout_callback in ['default', 'ansible.builtin.default']
and _vp_default_result_format == 'json'
)