From 109b0c18937634c69d8abe3577119b087ba8bb62 Mon Sep 17 00:00:00 2001 From: "ansible-code-bot[bot]" <145416087+ansible-code-bot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:12:23 +0000 Subject: [PATCH] Fix ansible-lint rule violations --- roles/run/tasks/health_checks/eos.yaml | 2 +- roles/run/tasks/health_checks/ios.yaml | 2 +- roles/run/tasks/health_checks/iosxr.yaml | 2 +- roles/run/tasks/health_checks/junos.yaml | 3 +-- roles/run/tasks/health_checks/nxos.yaml | 2 +- roles/run/tasks/health_checks/vyos.yaml | 2 +- roles/run/tasks/includes/configure.yaml | 2 +- roles/run/tasks/includes/deploy.yaml | 2 +- roles/run/tasks/includes/detect.yaml | 4 ++-- roles/run/tasks/includes/gather.yaml | 2 +- roles/run/tasks/includes/health_check.yaml | 4 ++-- roles/run/tasks/includes/health_checks/eos.yaml | 2 +- roles/run/tasks/includes/health_checks/ios.yaml | 2 +- roles/run/tasks/includes/health_checks/iosxr.yaml | 2 +- roles/run/tasks/includes/health_checks/junos.yaml | 3 +-- roles/run/tasks/includes/health_checks/nxos.yaml | 2 +- roles/run/tasks/includes/health_checks/vyos.yaml | 2 +- roles/run/tasks/includes/list.yaml | 2 +- roles/run/tasks/includes/persist.yaml | 2 +- roles/run/tasks/includes/remediate.yaml | 4 ++-- roles/run/tasks/includes/resources.yaml | 10 +++++----- roles/run/tasks/main.yml | 2 +- 22 files changed, 29 insertions(+), 31 deletions(-) diff --git a/roles/run/tasks/health_checks/eos.yaml b/roles/run/tasks/health_checks/eos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/health_checks/eos.yaml +++ b/roles/run/tasks/health_checks/eos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/health_checks/ios.yaml b/roles/run/tasks/health_checks/ios.yaml index d2e66f2..3b3b27e 100644 --- a/roles/run/tasks/health_checks/ios.yaml +++ b/roles/run/tasks/health_checks/ios.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/health_checks/iosxr.yaml b/roles/run/tasks/health_checks/iosxr.yaml index d2e66f2..3b3b27e 100644 --- a/roles/run/tasks/health_checks/iosxr.yaml +++ b/roles/run/tasks/health_checks/iosxr.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/health_checks/junos.yaml b/roles/run/tasks/health_checks/junos.yaml index bf80e6c..42251a2 100644 --- a/roles/run/tasks/health_checks/junos.yaml +++ b/roles/run/tasks/health_checks/junos.yaml @@ -1,12 +1,11 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health - - name: Show Summary facts ansible.builtin.debug: msg: "{{ bgp_health }}" diff --git a/roles/run/tasks/health_checks/nxos.yaml b/roles/run/tasks/health_checks/nxos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/health_checks/nxos.yaml +++ b/roles/run/tasks/health_checks/nxos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/health_checks/vyos.yaml b/roles/run/tasks/health_checks/vyos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/health_checks/vyos.yaml +++ b/roles/run/tasks/health_checks/vyos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/configure.yaml b/roles/run/tasks/includes/configure.yaml index 5ed5f8d..a3464f9 100644 --- a/roles/run/tasks/includes/configure.yaml +++ b/roles/run/tasks/includes/configure.yaml @@ -3,4 +3,4 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'configure' + operation: configure diff --git a/roles/run/tasks/includes/deploy.yaml b/roles/run/tasks/includes/deploy.yaml index 19beb88..4b5f82b 100644 --- a/roles/run/tasks/includes/deploy.yaml +++ b/roles/run/tasks/includes/deploy.yaml @@ -6,5 +6,5 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'deploy' + operation: deploy resources: "{{ bgp_resources }}" diff --git a/roles/run/tasks/includes/detect.yaml b/roles/run/tasks/includes/detect.yaml index f87154a..4259211 100644 --- a/roles/run/tasks/includes/detect.yaml +++ b/roles/run/tasks/includes/detect.yaml @@ -6,6 +6,6 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'detect' - state: 'replaced' + operation: detect + state: replaced resources: "{{ bgp_resources }}" diff --git a/roles/run/tasks/includes/gather.yaml b/roles/run/tasks/includes/gather.yaml index c441774..2549529 100644 --- a/roles/run/tasks/includes/gather.yaml +++ b/roles/run/tasks/includes/gather.yaml @@ -6,5 +6,5 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'gather' + operation: gather resources: "{{ bgp_resources }}" diff --git a/roles/run/tasks/includes/health_check.yaml b/roles/run/tasks/includes/health_check.yaml index 77f1ce8..04cc16f 100644 --- a/roles/run/tasks/includes/health_check.yaml +++ b/roles/run/tasks/includes/health_check.yaml @@ -4,9 +4,9 @@ - name: Set health checks fact ansible.builtin.set_fact: - health_checks: "{{ bgp_health | network.bgp.health_check_view(operation) }}" + health_checks: "{{ bgp_health | network.bgp.health_check_view(operation) }}" - name: BGP health checks ansible.builtin.debug: - var: health_checks + var: health_checks failed_when: "'unsuccessful' == health_checks.status" diff --git a/roles/run/tasks/includes/health_checks/eos.yaml b/roles/run/tasks/includes/health_checks/eos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/includes/health_checks/eos.yaml +++ b/roles/run/tasks/includes/health_checks/eos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/health_checks/ios.yaml b/roles/run/tasks/includes/health_checks/ios.yaml index d2e66f2..3b3b27e 100644 --- a/roles/run/tasks/includes/health_checks/ios.yaml +++ b/roles/run/tasks/includes/health_checks/ios.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/health_checks/iosxr.yaml b/roles/run/tasks/includes/health_checks/iosxr.yaml index d2e66f2..3b3b27e 100644 --- a/roles/run/tasks/includes/health_checks/iosxr.yaml +++ b/roles/run/tasks/includes/health_checks/iosxr.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/health_checks/junos.yaml b/roles/run/tasks/includes/health_checks/junos.yaml index bf80e6c..42251a2 100644 --- a/roles/run/tasks/includes/health_checks/junos.yaml +++ b/roles/run/tasks/includes/health_checks/junos.yaml @@ -1,12 +1,11 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show bgp summary" + command: show bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health - - name: Show Summary facts ansible.builtin.debug: msg: "{{ bgp_health }}" diff --git a/roles/run/tasks/includes/health_checks/nxos.yaml b/roles/run/tasks/includes/health_checks/nxos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/includes/health_checks/nxos.yaml +++ b/roles/run/tasks/includes/health_checks/nxos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/health_checks/vyos.yaml b/roles/run/tasks/includes/health_checks/vyos.yaml index b71a087..0336c8d 100644 --- a/roles/run/tasks/includes/health_checks/vyos.yaml +++ b/roles/run/tasks/includes/health_checks/vyos.yaml @@ -1,7 +1,7 @@ --- - name: Parse bgp summary ansible.utils.cli_parse: - command: "show ip bgp summary" + command: show ip bgp summary parser: name: ansible.netcommon.content_templates set_fact: bgp_health diff --git a/roles/run/tasks/includes/list.yaml b/roles/run/tasks/includes/list.yaml index 03d5bd3..c794b39 100644 --- a/roles/run/tasks/includes/list.yaml +++ b/roles/run/tasks/includes/list.yaml @@ -3,4 +3,4 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'list' + operation: list diff --git a/roles/run/tasks/includes/persist.yaml b/roles/run/tasks/includes/persist.yaml index c27e14f..a44eb28 100644 --- a/roles/run/tasks/includes/persist.yaml +++ b/roles/run/tasks/includes/persist.yaml @@ -6,6 +6,6 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'persist' + operation: persist resources: "{{ bgp_resources }}" ignore_empty: "{{ persist_empty | default(true) }}" diff --git a/roles/run/tasks/includes/remediate.yaml b/roles/run/tasks/includes/remediate.yaml index 63a7aa2..406b0cc 100644 --- a/roles/run/tasks/includes/remediate.yaml +++ b/roles/run/tasks/includes/remediate.yaml @@ -6,6 +6,6 @@ ansible.builtin.include_role: name: network.base.resource_manager vars: - operation: 'remediate' - state: 'replaced' + operation: remediate + state: replaced resources: "{{ bgp_resources }}" diff --git a/roles/run/tasks/includes/resources.yaml b/roles/run/tasks/includes/resources.yaml index b0332cf..0dfda14 100644 --- a/roles/run/tasks/includes/resources.yaml +++ b/roles/run/tasks/includes/resources.yaml @@ -2,14 +2,14 @@ - name: Set resources ansible.builtin.set_fact: bgp_resources: - - 'bgp_global' - - 'bgp_address_family' - - 'bgp_neighbor_address_family' + - bgp_global + - bgp_address_family + - bgp_neighbor_address_family when: ansible_network_os == 'cisco.nxos.nxos' - name: Set resources ansible.builtin.set_fact: bgp_resources: - - 'bgp_global' - - 'bgp_address_family' + - bgp_global + - bgp_address_family when: ansible_network_os != 'cisco.nxos.nxos' diff --git a/roles/run/tasks/main.yml b/roles/run/tasks/main.yml index e5e90dd..e58e9a2 100644 --- a/roles/run/tasks/main.yml +++ b/roles/run/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: include tasks +- name: Include tasks ansible.builtin.include_tasks: includes/{{operation.name}}.yaml loop: "{{operations}}" loop_control: