From 23c5431671e7212ec9ca935811d1e0bb66f2b8b8 Mon Sep 17 00:00:00 2001 From: ivarmu <26822043+ivarmu@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:49:20 +0100 Subject: [PATCH] fix lintering issues --- playbooks/flatten_filetree_create_output.yaml | 3 +++ roles/filetree_create/tasks/applications.yml | 3 ++- roles/filetree_create/tasks/constructed_inventory.yml | 5 +++-- roles/filetree_create/tasks/credentials.yml | 3 ++- roles/filetree_create/tasks/groups.yml | 3 ++- roles/filetree_create/tasks/hosts.yml | 3 ++- roles/filetree_create/tasks/inventory.yml | 3 ++- roles/filetree_create/tasks/inventory_sources.yml | 3 ++- roles/filetree_create/tasks/job_templates.yml | 3 ++- roles/filetree_create/tasks/labels.yml | 3 ++- roles/filetree_create/tasks/notification_templates.yml | 3 ++- roles/filetree_create/tasks/organizations.yml | 3 ++- roles/filetree_create/tasks/projects.yml | 3 ++- roles/filetree_create/tasks/schedules.yml | 3 ++- roles/filetree_create/tasks/team_roles.yml | 3 ++- roles/filetree_create/tasks/teams.yml | 3 ++- roles/filetree_create/tasks/user_roles.yml | 3 ++- roles/filetree_create/tasks/users.yml | 3 ++- roles/filetree_create/tasks/workflow_job_templates.yml | 3 ++- roles/object_diff/tasks/roles.yml | 1 + 20 files changed, 41 insertions(+), 19 deletions(-) diff --git a/playbooks/flatten_filetree_create_output.yaml b/playbooks/flatten_filetree_create_output.yaml index a72fb663f..cdaacec4e 100644 --- a/playbooks/flatten_filetree_create_output.yaml +++ b/playbooks/flatten_filetree_create_output.yaml @@ -1,3 +1,4 @@ +--- - name: "Flatten the filetree_create output into unique files per each object type" hosts: localhost connection: local @@ -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) }} diff --git a/roles/filetree_create/tasks/applications.yml b/roles/filetree_create/tasks/applications.yml index df7eb9cbd..1d8b7a9c9 100644 --- a/roles/filetree_create/tasks/applications.yml +++ b/roles/filetree_create/tasks/applications.yml @@ -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: "" @@ -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 /applications output directory for applications in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/constructed_inventory.yml b/roles/filetree_create/tasks/constructed_inventory.yml index dc1a2fbaf..fdee02e91 100644 --- a/roles/filetree_create/tasks/constructed_inventory.yml +++ b/roles/filetree_create/tasks/constructed_inventory.yml @@ -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 @@ -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: "" @@ -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 /inventories output directory for inventories in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/credentials.yml b/roles/filetree_create/tasks/credentials.yml index defb91b04..97e27b956 100644 --- a/roles/filetree_create/tasks/credentials.yml +++ b/roles/filetree_create/tasks/credentials.yml @@ -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: "" @@ -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 /credentials output directory for credentials in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/groups.yml b/roles/filetree_create/tasks/groups.yml index e868ac5a7..cec0dbfb7 100644 --- a/roles/filetree_create/tasks/groups.yml +++ b/roles/filetree_create/tasks/groups.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/hosts.yml b/roles/filetree_create/tasks/hosts.yml index aac7b35a7..514929fcf 100644 --- a/roles/filetree_create/tasks/hosts.yml +++ b/roles/filetree_create/tasks/hosts.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/inventory.yml b/roles/filetree_create/tasks/inventory.yml index e0708dd39..fd05db1f9 100644 --- a/roles/filetree_create/tasks/inventory.yml +++ b/roles/filetree_create/tasks/inventory.yml @@ -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: '' @@ -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 /inventories output directory for inventories in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/inventory_sources.yml b/roles/filetree_create/tasks/inventory_sources.yml index aae7d80ae..0c67ca6cf 100644 --- a/roles/filetree_create/tasks/inventory_sources.yml +++ b/roles/filetree_create/tasks/inventory_sources.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/job_templates.yml b/roles/filetree_create/tasks/job_templates.yml index c49b34b5f..90f7076bf 100644 --- a/roles/filetree_create/tasks/job_templates.yml +++ b/roles/filetree_create/tasks/job_templates.yml @@ -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: "" @@ -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 output directories for job templates in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/labels.yml b/roles/filetree_create/tasks/labels.yml index b8976eced..d54144e74 100644 --- a/roles/filetree_create/tasks/labels.yml +++ b/roles/filetree_create/tasks/labels.yml @@ -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: "" @@ -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 /labels output directory for labels in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/notification_templates.yml b/roles/filetree_create/tasks/notification_templates.yml index 2a6edd8a0..5aa2da2d9 100644 --- a/roles/filetree_create/tasks/notification_templates.yml +++ b/roles/filetree_create/tasks/notification_templates.yml @@ -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: "" @@ -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 /notification_templates output directory for notification templates in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/organizations.yml b/roles/filetree_create/tasks/organizations.yml index c34c119c0..f2de44b6f 100644 --- a/roles/filetree_create/tasks/organizations.yml +++ b/roles/filetree_create/tasks/organizations.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/projects.yml b/roles/filetree_create/tasks/projects.yml index 69710f79a..4cf7a838b 100644 --- a/roles/filetree_create/tasks/projects.yml +++ b/roles/filetree_create/tasks/projects.yml @@ -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: "" @@ -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 /projects output directory for projects in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/schedules.yml b/roles/filetree_create/tasks/schedules.yml index f1dc8f921..0fc38b364 100644 --- a/roles/filetree_create/tasks/schedules.yml +++ b/roles/filetree_create/tasks/schedules.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/team_roles.yml b/roles/filetree_create/tasks/team_roles.yml index 760d7c106..19a003d6f 100644 --- a/roles/filetree_create/tasks/team_roles.yml +++ b/roles/filetree_create/tasks/team_roles.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/teams.yml b/roles/filetree_create/tasks/teams.yml index bfbe25896..e84807768 100644 --- a/roles/filetree_create/tasks/teams.yml +++ b/roles/filetree_create/tasks/teams.yml @@ -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: "" @@ -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 /teams output directory for teams in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/user_roles.yml b/roles/filetree_create/tasks/user_roles.yml index 018d3053d..24eab4c86 100644 --- a/roles/filetree_create/tasks/user_roles.yml +++ b/roles/filetree_create/tasks/user_roles.yml @@ -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: "" @@ -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: diff --git a/roles/filetree_create/tasks/users.yml b/roles/filetree_create/tasks/users.yml index f78c95a21..aee2d8f17 100644 --- a/roles/filetree_create/tasks/users.yml +++ b/roles/filetree_create/tasks/users.yml @@ -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: "" @@ -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 users in {{ output_path }}" ansible.builtin.file: diff --git a/roles/filetree_create/tasks/workflow_job_templates.yml b/roles/filetree_create/tasks/workflow_job_templates.yml index 87901364d..32e3c56ef 100644 --- a/roles/filetree_create/tasks/workflow_job_templates.yml +++ b/roles/filetree_create/tasks/workflow_job_templates.yml @@ -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: "" @@ -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 /workflow_job_templates output directory for workflow job templates in {{ output_path }}" ansible.builtin.file: diff --git a/roles/object_diff/tasks/roles.yml b/roles/object_diff/tasks/roles.yml index f284ccbfa..97d56dabc 100644 --- a/roles/object_diff/tasks/roles.yml +++ b/roles/object_diff/tasks/roles.yml @@ -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,