From 5a57880c65e690bd1cba0196f2d1def15a996464 Mon Sep 17 00:00:00 2001 From: Simone Spinelli <simone.spinelli@geant.org> Date: Mon, 8 Jan 2024 13:04:43 +0100 Subject: [PATCH] Make ansible-lint happy --- geant/gap_ansible/meta/runtime.yml | 2 +- .../playbooks/base_config_checks.yaml | 2 +- .../tasks/base_config_single_command.yaml | 6 ++-- .../roles/base_config_checks/tasks/main.yml | 6 ++-- .../roles/base_config_checks/vars/main.yml | 28 +++++++++---------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/geant/gap_ansible/meta/runtime.yml b/geant/gap_ansible/meta/runtime.yml index 2fe301c6..f3589f4f 100644 --- a/geant/gap_ansible/meta/runtime.yml +++ b/geant/gap_ansible/meta/runtime.yml @@ -1,7 +1,7 @@ --- # Collections must specify a minimum required ansible version to upload # to galaxy -requires_ansible: '>=2.9.10' +requires_ansible: '>=2.15.0' # Content that Ansible needs to load from another location or that has # been deprecated/removed diff --git a/geant/gap_ansible/playbooks/base_config_checks.yaml b/geant/gap_ansible/playbooks/base_config_checks.yaml index 5f447d88..493e0547 100644 --- a/geant/gap_ansible/playbooks/base_config_checks.yaml +++ b/geant/gap_ansible/playbooks/base_config_checks.yaml @@ -4,4 +4,4 @@ gather_facts: false remote_user: admin roles: - - ../roles/base_config_checks \ No newline at end of file + - ../roles/base_config_checks diff --git a/geant/gap_ansible/roles/base_config_checks/tasks/base_config_single_command.yaml b/geant/gap_ansible/roles/base_config_checks/tasks/base_config_single_command.yaml index 8552009d..0e713647 100644 --- a/geant/gap_ansible/roles/base_config_checks/tasks/base_config_single_command.yaml +++ b/geant/gap_ansible/roles/base_config_checks/tasks/base_config_single_command.yaml @@ -1,10 +1,10 @@ -- name: "Execute {{item.command}}" +- name: "Execute {{ item.command }}" ansible.netcommon.netconf_rpc: rpc: action xmlns: "urn:ietf:params:xml:ns:yang:1" content: "{{ lookup('ansible.builtin.template', './base_config_single_command.j2') }}" display: json register: out -- name: "Results of {{item.command}}" - debug: +- name: "Results of {{ item.command }}" + ansible.builtin.debug: msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}" diff --git a/geant/gap_ansible/roles/base_config_checks/tasks/main.yml b/geant/gap_ansible/roles/base_config_checks/tasks/main.yml index 122da68e..c72cfdf9 100644 --- a/geant/gap_ansible/roles/base_config_checks/tasks/main.yml +++ b/geant/gap_ansible/roles/base_config_checks/tasks/main.yml @@ -1,5 +1,5 @@ --- -# tasks file for base_config_checks + - name: Execute post-check command - include_tasks: base_config_single_command.yaml - with_items: "{{commands}}" + ansible.builtin.include_tasks: base_config_single_command.yaml + with_items: "{{ commands }}" diff --git a/geant/gap_ansible/roles/base_config_checks/vars/main.yml b/geant/gap_ansible/roles/base_config_checks/vars/main.yml index 335e8e41..732cf342 100644 --- a/geant/gap_ansible/roles/base_config_checks/vars/main.yml +++ b/geant/gap_ansible/roles/base_config_checks/vars/main.yml @@ -1,17 +1,17 @@ --- # vars file for base_config_checks commands: -- command: show version - description: "Shows the version of SROS" -- command: show chassis - description: "Shows the status of the chassis" -- command: show card - description: "Shows the status of the cards" -- command: show port - description: "Shows the status of the ports" -- command: show mda - description: "Shows the status of the mdas" -- command: show sfm - description: "Shows the status of Switching Fabric Modules" -- command: show redundancy synchronization - description: "Shows the status of the syncronization" + - command: show version + description: "Shows the version of SROS" + - command: show chassis + description: "Shows the status of the chassis" + - command: show card + description: "Shows the status of the cards" + - command: show port + description: "Shows the status of the ports" + - command: show mda + description: "Shows the status of the mdas" + - command: show sfm + description: "Shows the status of Switching Fabric Modules" + - command: show redundancy synchronization + description: "Shows the status of the syncronization" -- GitLab