-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all the objects has been updated to let flatten output
- Loading branch information
Showing
37 changed files
with
1,038 additions
and
386 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
minor_changes: | ||
- The role 'filetree_create' will now allow to export all the objects of one kind into a single file, so it can be loaded by both ansible `group_vars` syntax and `filetree_read` tool. | ||
... |
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
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,14 +1,38 @@ | ||
--- | ||
- name: "Create the output directory for groups: {{ groups_output_path }}" | ||
ansible.builtin.file: | ||
path: "{{ groups_output_path }}" | ||
state: directory | ||
mode: '0755' | ||
- name: "Block for to generate flatten output" | ||
when: | ||
- flatten_output is defined | ||
- flatten_output | bool | ||
vars: | ||
__dest: "{{ groups_output_path }}" | ||
block: | ||
- name: "Add current groups to the groups flat file" | ||
ansible.builtin.blockinfile: | ||
create: true | ||
insertafter: EOF | ||
path: "{{ __dest }}" | ||
marker: "" | ||
block: "{{ lookup('template', 'templates/current_groups.j2') }}" | ||
|
||
- name: "Add current groups to the current_groups.yaml output file in {{ groups_output_path }}" | ||
ansible.builtin.template: | ||
src: "templates/current_groups.j2" | ||
dest: "{{ groups_output_path }}/current_groups.yaml" | ||
mode: '0644' | ||
when: current_groups_asset_value | length > 0 | ||
- name: "Remove all the blank lines introduced by the last task" | ||
ansible.builtin.lineinfile: | ||
path: "{{ __dest }}" | ||
line: '' | ||
state: absent | ||
|
||
- name: "Block for to generate the filetre_create normal output" | ||
when: flatten_output is not defined or (flatten_output | bool) == false | ||
block: | ||
- name: "Create the output directory for groups: {{ groups_output_path }}" | ||
ansible.builtin.file: | ||
path: "{{ groups_output_path }}" | ||
state: directory | ||
mode: '0755' | ||
|
||
- name: "Add current groups to the current_groups.yaml output file in {{ groups_output_path }}" | ||
ansible.builtin.template: | ||
src: "templates/current_groups.j2" | ||
dest: "{{ groups_output_path }}/current_groups.yaml" | ||
mode: '0644' | ||
when: current_groups_asset_value | length > 0 | ||
... |
Oops, something went wrong.