-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role: ansible - Local fact management optimisation
- Loading branch information
Showing
8 changed files
with
87 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
--- | ||
- name: Load role related variables | ||
ansible.builtin.include_vars: main.yml | ||
ansible.builtin.include_vars: main.yml | ||
|
||
# - name: Include update local facts tasks for initiation | ||
# ansible.builtin.include_tasks: update_local_facts.yml | ||
# vars: | ||
# ansible__local_fact_updates: | ||
# - path: ansible.init | ||
# value: | ||
# when: | ||
# - linux_role_ansible_enabled | bool | ||
# - linux_role_ansible_manage_local_facts | bool | ||
# - ansible_local[ansible__local_fact_name] is undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% set facts_ansible_settled = ansible_local[ansible__local_fact_name] | default({}) %} | ||
{% set facts_role_update_settled = ansible__update_local_facts | default({}) %} | ||
{% set facts_role_update_settled = ansible__update_local_facts.ansible_local[ansible__local_fact_name] | default({}) %} | ||
{% set list_merge_strategy = ansible__local_fact_list_merge_strategy | default('prepend') %} | ||
{% set final_local_facts = facts_ansible_settled | combine(facts_role_update_settled, recursive=true, list_merge=list_merge_strategy) %} | ||
{{ final_local_facts | to_nice_json }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# {{ ansible_managed }} | ||
{% if package_manager__repo_list_disabled_comment is defined %} | ||
{{ package_manager__repo_list_disabled_comment | comment }} | ||
{% end if %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters