Skip to content

Commit

Permalink
fix lintering issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarmu committed Nov 7, 2023
1 parent 2f79c15 commit 23c5431
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 19 deletions.
3 changes: 3 additions & 0 deletions playbooks/flatten_filetree_create_output.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: "Flatten the filetree_create output into unique files per each object type"
hosts: localhost
connection: local
Expand Down Expand Up @@ -31,10 +32,12 @@
ansible.builtin.file:
path: "{{ filetree_create_output_dir }}_flatten"
state: directory
mode: "0755"

- name: "Write all the objects to the corresponding file"
ansible.builtin.copy:
dest: "{{ filetree_create_output_dir }}_flatten/{{ item.name }}.yaml"
mode: "0644"
content: |
---
{{ item.value | to_nice_yaml(indent=2) }}
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current applications to the applications flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -43,7 +44,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/applications output directory for applications in {{ output_path }}"
ansible.builtin.file:
Expand Down
5 changes: 3 additions & 2 deletions roles/filetree_create/tasks/constructed_inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
register: __constructed_inventories_file

- name: "Remove the yaml finalizer if it's already present"
lineinfile:
ansible.builtin.lineinfile:
path: "{{ __dest }}"
line: "..."
state: absent
Expand All @@ -33,6 +33,7 @@
- name: "Add current constructed inventory to the inventories flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -55,7 +56,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/inventories output directory for inventories in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current credentials to the credentials flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -43,7 +44,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/credentials output directory for credentials in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- name: "Add current groups to the groups flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -21,7 +22,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for groups: {{ groups_output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- name: "Add current hosts to the hosts flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -21,7 +22,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for hosts: {{ hosts_output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- name: "Add current inventories to the inventories flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ''
Expand All @@ -56,7 +57,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/inventories output directory for inventories in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/inventory_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- name: "Add current inventory source to the inventory sources flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ inventory_sources_output_path }}"
marker: ""
Expand All @@ -21,7 +22,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for inventory sources: {{ inventory_sources_output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/job_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current job_templates to the job_templates flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand Down Expand Up @@ -56,7 +57,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME> output directories for job templates in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current labels to the labels flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -43,7 +44,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/labels output directory for labels in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/notification_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current notification_templates to the notification_templates flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -40,7 +41,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/notification_templates output directory for notification templates in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/organizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current organizations to the organizations flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand Down Expand Up @@ -53,7 +54,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for organizations: {{ output_path + '/' + current_organization_dir.name }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current projects to the projects flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand Down Expand Up @@ -53,7 +54,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/projects output directory for projects in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/schedules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- name: "Add current schedules to the schedules flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand Down Expand Up @@ -47,7 +48,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the schedules output directory for schedules in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/team_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- name: "Add current team roles to the team roles flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -38,7 +39,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for team roles: {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/teams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current teams to the teams flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -43,7 +44,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/teams output directory for teams in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/user_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- name: "Add current user roles to the user roles flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -38,7 +39,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the output directory for user roles: {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- name: "Add current users to the users flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand All @@ -53,7 +54,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME> output directory for users in {{ output_path }}"
ansible.builtin.file:
Expand Down
3 changes: 2 additions & 1 deletion roles/filetree_create/tasks/workflow_job_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- name: "Add current workflow_job_templates to the workflow_job_templates flat file"
ansible.builtin.blockinfile:
create: true
mode: "0644"
insertafter: EOF
path: "{{ __dest }}"
marker: ""
Expand Down Expand Up @@ -59,7 +60,7 @@
state: absent

- name: "Block for to generate the filetre_create normal output"
when: flatten_output is not defined or (flatten_output | bool) == false
when: flatten_output is not defined or not (flatten_output | bool)
block:
- name: "Create the <ORGANIZATION_NAME>/workflow_job_templates output directory for workflow job templates in {{ output_path }}"
ansible.builtin.file:
Expand Down
1 change: 1 addition & 0 deletions roles/object_diff/tasks/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- name: "Get the API list of all roles"
ansible.builtin.set_fact:
# noqa jinja[spacing]
__controller_api_roles: "{{ (__controller_api_roles | default([])) + [{
'users': current_users,
'teams': current_teams,
Expand Down

0 comments on commit 23c5431

Please sign in to comment.