From dd4a795e3ae2b90a420e9b285d6ff49ed0217d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Mendiz=C3=A1bal?= Date: Fri, 22 Sep 2023 12:54:29 -0400 Subject: [PATCH] Unpin ansible-lint This patch unpins ansible-lint to fix the failing gate. All lint errors have been fixed. Change-Id: I8d8b67ba5db19464470fc4c3887fd8dd78800e7a --- handlers/main.yaml | 4 +- tasks/main.yaml | 94 +++++++++++++++++++++++-------------------- test-requirements.txt | 6 +-- 3 files changed, 53 insertions(+), 51 deletions(-) diff --git a/handlers/main.yaml b/handlers/main.yaml index b857c94..dfe489b 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -1,5 +1,5 @@ --- -- name: legacy vars warning - debug: +- name: Legacy vars warning + ansible.builtin.debug: msg: "WARNING: Using legacy atos_server_cert_location and atos_hsm_ip_address variables. Please udpate your vars file." diff --git a/tasks/main.yaml b/tasks/main.yaml index 90e8c0e..0e02661 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,29 +1,31 @@ --- - name: Create working directory - file: - path: "{{ atos_client_working_dir }}" - state: directory - mode: 0755 + ansible.builtin.file: + path: "{{ atos_client_working_dir }}" + state: directory + mode: '755' - name: Download ATOS client ISO - get_url: - url: "{{ atos_client_iso_location }}" - dest: "{{ atos_client_working_dir }}/{{ atos_client_iso_name }}" - force: no + ansible.builtin.get_url: + url: "{{ atos_client_iso_location }}" + dest: "{{ atos_client_working_dir }}/{{ atos_client_iso_name }}" + mode: '644' + force: false - name: Mount the iso for ATOS - mount: - path: /mnt/atos_iso - src: "{{ atos_client_working_dir }}/{{ atos_client_iso_name }}" - fstype: iso9660 - state: mounted + ansible.posix.mount: + path: /mnt/atos_iso + src: "{{ atos_client_working_dir }}/{{ atos_client_iso_name }}" + fstype: iso9660 + state: mounted -- name: check for client software installation - stat: path=/etc/proteccio/proteccio.rc.example +- name: Check for client software installation + ansible.builtin.stat: + path: /etc/proteccio/proteccio.rc.example register: atos_client -- name: install client software - expect: +- name: Install client software + ansible.builtin.expect: chdir: /mnt/atos_iso/Linux command: ./install.sh responses: @@ -32,40 +34,44 @@ "Press the key to exit the installation program": "\n" when: not atos_client.stat.exists -- name: allow using legacy variables for backwards compatibility - set_fact: - args: - atos_hsms: - - name: Legacy variables HSM - server_cert_location: "{{ atos_server_cert_location }}" - ip: "{{ atos_hsm_ip_address }}" +- name: Allow using legacy variables for backwards compatibility + ansible.builtin.set_fact: + atos_hsms: + - name: Legacy variables HSM + server_cert_location: "{{ atos_server_cert_location }}" + ip: "{{ atos_hsm_ip_address }}" when: atos_hsms is not defined and atos_hsm_ip_address is defined - notify: legacy vars warning + notify: Legacy vars warning -- name: create proteccio.rc - template: - src: proteccio.rc.j2 - dest: /etc/proteccio/proteccio.rc - mode: 0644 +- name: Create proteccio.rc + ansible.builtin.template: + src: proteccio.rc.j2 + dest: /etc/proteccio/proteccio.rc + mode: '644' - name: Get the client cert - get_url: - url: "{{ atos_client_cert_location }}" - dest: /etc/proteccio/proteccio_client.crt - force: no + ansible.builtin.get_url: + url: "{{ atos_client_cert_location }}" + dest: /etc/proteccio/proteccio_client.crt + mode: '644' + force: false - name: Get the client key - get_url: - url: "{{ atos_client_key_location }}" - dest: /etc/proteccio/proteccio_client.key - force: no + ansible.builtin.get_url: + url: "{{ atos_client_key_location }}" + dest: /etc/proteccio/proteccio_client.key + mode: '644' + force: false - name: Get the server cert - get_url: - url: "{{ item.server_cert_location }}" - dest: "/etc/proteccio/{{ item.ip | replace('.', '_') }}.CRT" - force: no + ansible.builtin.get_url: + url: "{{ item.server_cert_location }}" + dest: "/etc/proteccio/{{ item.ip | replace('.', '_') }}.CRT" + mode: '644' + force: false loop: "{{ atos_hsms }}" -- name: run nethsmstatus to confirm connection # noqa 301 - command: nethsmstatus +- name: Run nethsmstatus to confirm connection + ansible.builtin.command: nethsmstatus + register: out + changed_when: out.rc != 0 diff --git a/test-requirements.txt b/test-requirements.txt index e508ba3..89e2495 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,2 @@ -# NOTE(elod.illes): ansible 6.0.0 introduced new rules that needs to be -# fixed, like fqcn-builtins, etc. Due to Yoga release happens soon -# let's just cap ansible-lint. This needs a separate fix in the future -# to be able to remove the cap. -ansible-lint<6.0.0 +ansible-lint reno