From 84202836b5f28af49e2832ada6953b79229c1cea Mon Sep 17 00:00:00 2001 From: Dawa Ometto Date: Mon, 6 Jan 2025 13:58:44 +0100 Subject: [PATCH] chore: fix linting --- playbooks/irods_server.yml | 2 +- playbooks/roles/agisoft/tasks/main.yml | 2 ++ playbooks/roles/anaconda/tasks/dependencies_yum.yml | 2 +- playbooks/roles/anaconda/tasks/main.yml | 2 ++ playbooks/roles/camunda_modeler/tasks/main.yml | 1 + playbooks/roles/camunda_server/tasks/main.yml | 2 ++ playbooks/roles/desktop_file/tasks/main.yml | 2 ++ .../roles/fact_regular_users/molecule/default/prepare.yml | 1 + playbooks/roles/install_role/molecule/default/prepare.yml | 2 ++ playbooks/roles/irods_repo/tasks/main.yml | 1 + playbooks/roles/keycloak/tasks/main.yml | 1 + playbooks/roles/nginx_uwsgi/molecule/_prepare.yml | 3 ++- playbooks/roles/nginx_uwsgi/tasks/main.yml | 1 + playbooks/roles/pipx_install_systemwide/tasks/main.yml | 1 + playbooks/roles/robotuser/molecule/default/converge.yml | 4 ++-- playbooks/roles/rstudio/tasks/redhat.yml | 2 +- playbooks/roles/security_updates/tasks/main.yml | 1 + playbooks/roles/sshfs_cleanup/tasks/main.yml | 3 ++- playbooks/roles/sshfs_mount/tasks/main.yml | 1 + playbooks/roles/stata18/molecule/default/prepare.yml | 1 + 20 files changed, 28 insertions(+), 7 deletions(-) diff --git a/playbooks/irods_server.yml b/playbooks/irods_server.yml index 10b6184b..a98088d7 100644 --- a/playbooks/irods_server.yml +++ b/playbooks/irods_server.yml @@ -3,7 +3,7 @@ hosts: localhost gather_facts: true - # irods server will use a local postgresql database + # irods server will use a local postgresql database roles: - irods_server diff --git a/playbooks/roles/agisoft/tasks/main.yml b/playbooks/roles/agisoft/tasks/main.yml index 01af695f..d0f3fd35 100644 --- a/playbooks/roles/agisoft/tasks/main.yml +++ b/playbooks/roles/agisoft/tasks/main.yml @@ -11,6 +11,7 @@ ansible.builtin.file: path: "{{ agisoft_download_dest }}" state: directory + mode: "0755" - name: Download agisoft installation files ansible.builtin.get_url: @@ -29,6 +30,7 @@ ansible.builtin.copy: dest: "{{ agisoft_install_dir }}/license.lic" content: "{{ license }}" + mode: "0644" - name: Install desktop file menu item through role ansible.builtin.include_role: diff --git a/playbooks/roles/anaconda/tasks/dependencies_yum.yml b/playbooks/roles/anaconda/tasks/dependencies_yum.yml index 0fc29c5f..b11d2e49 100644 --- a/playbooks/roles/anaconda/tasks/dependencies_yum.yml +++ b/playbooks/roles/anaconda/tasks/dependencies_yum.yml @@ -1,6 +1,6 @@ --- - name: Install dependencies - ansible.builtin.yum: + ansible.builtin.dnf: name: - libXcomposite - libXcursor diff --git a/playbooks/roles/anaconda/tasks/main.yml b/playbooks/roles/anaconda/tasks/main.yml index 58a1acab..da0c6339 100644 --- a/playbooks/roles/anaconda/tasks/main.yml +++ b/playbooks/roles/anaconda/tasks/main.yml @@ -3,10 +3,12 @@ --- - name: Install dependencies ansible.builtin.include_tasks: dependencies_{{ ansible_pkg_mgr }}.yml + - name: Ensure download dir exists ansible.builtin.file: path: "{{ anaconda_download_dest }}" state: directory + mode: "0750" - name: Add users to anaconda multiple user group by default ansible.builtin.include_role: diff --git a/playbooks/roles/camunda_modeler/tasks/main.yml b/playbooks/roles/camunda_modeler/tasks/main.yml index 9a51e675..902b8a22 100644 --- a/playbooks/roles/camunda_modeler/tasks/main.yml +++ b/playbooks/roles/camunda_modeler/tasks/main.yml @@ -8,6 +8,7 @@ ansible.builtin.get_url: url: "{{ camunda_modeler_urldir }}/{{ camunda_modeler_urlfile_prefix }}.tar.gz" dest: /tmp/{{ camunda_modeler_urlfile_prefix }}.tar.gz + mode: "0640" - name: Unpack modeler tar.gz file in tmp location ansible.builtin.unarchive: diff --git a/playbooks/roles/camunda_server/tasks/main.yml b/playbooks/roles/camunda_server/tasks/main.yml index 32edb872..2d2ce5a8 100644 --- a/playbooks/roles/camunda_server/tasks/main.yml +++ b/playbooks/roles/camunda_server/tasks/main.yml @@ -30,12 +30,14 @@ src: "{{ camunda_tomcatdir }}/conf/bpm-platform.xml" remote_src: true dest: "{{ catalina_home }}/conf/bpm-platform.xml" + mode: "0644" - name: Copy camunda jars to tomcat lib ansible.builtin.copy: src: "{{ camunda_dir }}/lib/" remote_src: true dest: "{{ catalina_home }}/lib/" + mode: "0644" # a copy with remore_src preserves file attribs regardless of mode # hence we need to set these props using a separate command diff --git a/playbooks/roles/desktop_file/tasks/main.yml b/playbooks/roles/desktop_file/tasks/main.yml index 77dc4e3f..ddd81c71 100644 --- a/playbooks/roles/desktop_file/tasks/main.yml +++ b/playbooks/roles/desktop_file/tasks/main.yml @@ -2,10 +2,12 @@ - name: Check if required variables are present when: (desktopfile_app_name is not defined) or (desktopfile_sizes is not defined) ansible.builtin.meta: end_play + - name: Preventing bug - Ensure directory exists ansible.builtin.file: path: /usr/share/desktop-directories/ state: directory + mode: "0755" - name: Install xdg utilities ansible.builtin.package: diff --git a/playbooks/roles/fact_regular_users/molecule/default/prepare.yml b/playbooks/roles/fact_regular_users/molecule/default/prepare.yml index 60bd3c4f..ebb93f1f 100644 --- a/playbooks/roles/fact_regular_users/molecule/default/prepare.yml +++ b/playbooks/roles/fact_regular_users/molecule/default/prepare.yml @@ -8,6 +8,7 @@ dest: /etc/rsc/managedgroups content: > src_ws_admin + mode: "0644" - name: Ensure group "src_ws_admin" exists ansible.builtin.group: diff --git a/playbooks/roles/install_role/molecule/default/prepare.yml b/playbooks/roles/install_role/molecule/default/prepare.yml index cb3ee3d0..1f315897 100644 --- a/playbooks/roles/install_role/molecule/default/prepare.yml +++ b/playbooks/roles/install_role/molecule/default/prepare.yml @@ -7,6 +7,7 @@ ansible.builtin.file: dest: /rsc/roles state: directory + mode: "0755" - name: Copy the role to the workspace ansible.posix.synchronize: @@ -19,6 +20,7 @@ - name: Copy test playbook to the workspace ansible.builtin.copy: dest: /rsc/test.yml + mode: "0644" content: | - name: Test dependency installation hosts: localhost diff --git a/playbooks/roles/irods_repo/tasks/main.yml b/playbooks/roles/irods_repo/tasks/main.yml index e1b724cd..a21e28da 100644 --- a/playbooks/roles/irods_repo/tasks/main.yml +++ b/playbooks/roles/irods_repo/tasks/main.yml @@ -14,6 +14,7 @@ ansible.builtin.get_url: url: "{{ irods_repo_url }}/irods-signing-key.asc" dest: "{{ irods_key_location }}" + mode: "0644" when: ansible_pkg_mgr == 'apt' - name: Add iRODS repository for apt package manager diff --git a/playbooks/roles/keycloak/tasks/main.yml b/playbooks/roles/keycloak/tasks/main.yml index b1ed907d..9b3d3962 100644 --- a/playbooks/roles/keycloak/tasks/main.yml +++ b/playbooks/roles/keycloak/tasks/main.yml @@ -20,6 +20,7 @@ ansible.builtin.get_url: url: "{{ keycloak_tardir }}{{ keycloak_tarfile }}" dest: "{{ keycloak_dir }}" + mode: "0644" - name: Extract keycloak tar ansible.builtin.unarchive: diff --git a/playbooks/roles/nginx_uwsgi/molecule/_prepare.yml b/playbooks/roles/nginx_uwsgi/molecule/_prepare.yml index faa41359..149b96b9 100644 --- a/playbooks/roles/nginx_uwsgi/molecule/_prepare.yml +++ b/playbooks/roles/nginx_uwsgi/molecule/_prepare.yml @@ -4,9 +4,10 @@ update_cache: true - name: Create uwsgi dir - file: + ansible.builtin.file: path: /var/www/uwsgi state: directory + mode: "0750" - name: Add uwsgi test app ansible.builtin.copy: diff --git a/playbooks/roles/nginx_uwsgi/tasks/main.yml b/playbooks/roles/nginx_uwsgi/tasks/main.yml index 0fb00c6e..69b75cc4 100644 --- a/playbooks/roles/nginx_uwsgi/tasks/main.yml +++ b/playbooks/roles/nginx_uwsgi/tasks/main.yml @@ -85,6 +85,7 @@ copytruncate } create: true + mode: "0644" - name: Start app service ansible.builtin.systemd_service: diff --git a/playbooks/roles/pipx_install_systemwide/tasks/main.yml b/playbooks/roles/pipx_install_systemwide/tasks/main.yml index a5024b39..280b6377 100644 --- a/playbooks/roles/pipx_install_systemwide/tasks/main.yml +++ b/playbooks/roles/pipx_install_systemwide/tasks/main.yml @@ -12,6 +12,7 @@ when: pipx_install_systemwide_profile | length > 0 ansible.builtin.copy: dest: /etc/profile.d/{{ pipx_install_systemwide_profile }} + mode: "0644" content: | export PATH="{{ pipx_install_systemwide_location }}/bin${PATH:+:${PATH}}" diff --git a/playbooks/roles/robotuser/molecule/default/converge.yml b/playbooks/roles/robotuser/molecule/default/converge.yml index 4d14151b..762dd76b 100644 --- a/playbooks/roles/robotuser/molecule/default/converge.yml +++ b/playbooks/roles/robotuser/molecule/default/converge.yml @@ -5,10 +5,10 @@ roles: - role: robotuser vars: - robotuser_generate_ssh_key: "yes" + robotuser_generate_ssh_key: "true" - role: robotuser vars: - robotuser_generate_ssh_key: "no" + robotuser_generate_ssh_key: "false" robotuser_key: foo robotuser_server: localhost robotuser_sourcepath: /tmp/ diff --git a/playbooks/roles/rstudio/tasks/redhat.yml b/playbooks/roles/rstudio/tasks/redhat.yml index 34dbafe5..f8a6edfa 100644 --- a/playbooks/roles/rstudio/tasks/redhat.yml +++ b/playbooks/roles/rstudio/tasks/redhat.yml @@ -2,7 +2,7 @@ - name: Update extra packages ansible.builtin.package: name: epel-release - state: latest + state: present - name: Install R ansible.builtin.package: diff --git a/playbooks/roles/security_updates/tasks/main.yml b/playbooks/roles/security_updates/tasks/main.yml index 89257a3e..f17bdd94 100644 --- a/playbooks/roles/security_updates/tasks/main.yml +++ b/playbooks/roles/security_updates/tasks/main.yml @@ -42,6 +42,7 @@ ansible.builtin.template: src: upgrade-bootstrap.timer dest: /etc/systemd/system/upgrade-bootstrap.timer + mode: "0644" - name: Enable bootstrap timer ansible.builtin.command: "{{ item }}" diff --git a/playbooks/roles/sshfs_cleanup/tasks/main.yml b/playbooks/roles/sshfs_cleanup/tasks/main.yml index 97386489..4631763f 100644 --- a/playbooks/roles/sshfs_cleanup/tasks/main.yml +++ b/playbooks/roles/sshfs_cleanup/tasks/main.yml @@ -5,8 +5,9 @@ - name: Wait until mounted filesystem is at rest tags: molecule-idempotence-notest ansible.builtin.command: sync + - name: Umount remote filesystem - tags: molecule-idempotence-notest + tags: molecule-notest ansible.posix.mount: path: "{{ sshfs_connection_info.mountpoint }}" state: unmounted diff --git a/playbooks/roles/sshfs_mount/tasks/main.yml b/playbooks/roles/sshfs_mount/tasks/main.yml index 0a24b035..3760fa72 100644 --- a/playbooks/roles/sshfs_mount/tasks/main.yml +++ b/playbooks/roles/sshfs_mount/tasks/main.yml @@ -9,6 +9,7 @@ path: "{{ sshfs_connection_info.mountpoint }}" state: directory owner: "{{ sshfs_connection_info.username }}" + mode: "0755" - name: Enable user_allow_other in fuse config tags: molecule-idempotence-notest diff --git a/playbooks/roles/stata18/molecule/default/prepare.yml b/playbooks/roles/stata18/molecule/default/prepare.yml index 995e7176..2258baff 100644 --- a/playbooks/roles/stata18/molecule/default/prepare.yml +++ b/playbooks/roles/stata18/molecule/default/prepare.yml @@ -21,6 +21,7 @@ ansible.builtin.copy: dest: /tmp/unix/linux64/setrwxp content: mock + mode: "0755" - name: Create mock stata archive1 ansible.builtin.command: