diff --git a/execution-environment/execution-environment.yml b/execution-environment/execution-environment.yml index dd5cdcd..b7228b7 100644 --- a/execution-environment/execution-environment.yml +++ b/execution-environment/execution-environment.yml @@ -1,12 +1,12 @@ --- version: 1 -ansible_config: 'ansible.cfg' +ansible_config: ansible.cfg dependencies: galaxy: requirements.yml python: requirements.txt additional_build_steps: - prepend: | - RUN pip3 install --upgrade pip setuptools \ No newline at end of file + prepend: |- + RUN pip3 install --upgrade pip setuptools diff --git a/playbooks/get_incident_id.yml b/playbooks/get_incident_id.yml index 5ab8978..642158b 100644 --- a/playbooks/get_incident_id.yml +++ b/playbooks/get_incident_id.yml @@ -5,6 +5,6 @@ tasks: - name: print incident id - set_stats: + ansible.builtin.set_stats: data: incident_id: "{{ incident_id }}" diff --git a/playbooks/inventory/hosts.yml b/playbooks/inventory/hosts.yml index 773c630..e15a82b 100644 --- a/playbooks/inventory/hosts.yml +++ b/playbooks/inventory/hosts.yml @@ -1,9 +1,9 @@ +--- all: children: now_dev: hosts: dev87069.service-now.com: - branch: hosts: rtr_branch1: diff --git a/playbooks/test-ospf.yml b/playbooks/test-ospf.yml index f39c062..c54cca0 100644 --- a/playbooks/test-ospf.yml +++ b/playbooks/test-ospf.yml @@ -21,7 +21,7 @@ # when: "'error' in ospf_neighbors" rescue: - name: print which device has errors on show ip ospf neighbors - debug: + ansible.builtin.debug: msg: "{{ inventory_hostname }} did not return ospf neighbors" - name: parse show ip ospf interface brief @@ -31,7 +31,7 @@ name: ansible.netcommon.pyats set_fact: ospf_interface - name: print ospf interface - debug: + ansible.builtin.debug: msg: "{{ ospf_interface['instance'] }}" - name: validate ospf interface @@ -44,10 +44,10 @@ register: result - name: print validate results - debug: - msg: "{{ inventory_hostname }}: {{ item['data_path'].split('.')[7] }} is not in DR or BDR state" loop: "{{ result['errors'] }}" when: "'errors' in result" + ansible.builtin.debug: + msg: "{{ inventory_hostname }}: {{ item['data_path'].split('.')[7] }} is not in DR or BDR state" - name: validate interfaces ansible.utils.cli_parse: @@ -59,13 +59,13 @@ - name: show int status # include_tasks: test-int.yml - debug: - msg: "{{ item.key }} {{ item.value.enabled }} {{item.value.line_protocol }}" loop: "{{ (iosxe_show_interface | dict2items) }}" tags: interface + ansible.builtin.debug: + msg: "{{ item.key }} {{ item.value.enabled }} {{item.value.line_protocol }}" - name: set stats - set_stats: + ansible.builtin.set_stats: data: interface_report: "{{ iosxe_show_interface }}" diff --git a/playbooks/test_branch_ping.yml b/playbooks/test_branch_ping.yml index b577586..9d36e1e 100644 --- a/playbooks/test_branch_ping.yml +++ b/playbooks/test_branch_ping.yml @@ -12,7 +12,7 @@ set_fact: ios_ping_core - name: print ping info - debug: + ansible.builtin.debug: msg: "{{ ios_ping_core }}" - name: evaluate if ping is responsive @@ -33,12 +33,10 @@ - name: add dict keys for router names - set_fact: + ansible.builtin.set_fact: hostname_ping_result_data: "{{ ping_result_data | default ({}) | combine({inventory_hostname: ios_ping_result }) }}" - name: create one dictionary of default route data - set_fact: - ping_result_data: "{{ ping_result_data | default ({}) | combine(item) }}" loop: >- {{ groups['branch'] @@ -47,6 +45,8 @@ | list }} run_once: true + ansible.builtin.set_fact: + ping_result_data: "{{ ping_result_data | default ({}) | combine(item) }}" - name: set fact for use in workflow ansible.builtin.set_stats: diff --git a/playbooks/test_def_route.yml b/playbooks/test_def_route.yml index 75c3110..42644f9 100644 --- a/playbooks/test_def_route.yml +++ b/playbooks/test_def_route.yml @@ -27,12 +27,10 @@ ospf_def_route: { default_route: false } - name: add dict keys for router names - set_fact: + ansible.builtin.set_fact: hostname_def_route_data: "{{ def_route_data | default ({}) | combine({inventory_hostname: ospf_def_route }) }}" - name: create one dictionary of default route data - set_fact: - def_route_data: "{{ def_route_data | default ({}) | combine(item) }}" loop: >- {{ groups['branch'] @@ -41,6 +39,8 @@ | list }} run_once: true + ansible.builtin.set_fact: + def_route_data: "{{ def_route_data | default ({}) | combine(item) }}" - name: set fact for use in workflow ansible.builtin.set_stats: diff --git a/playbooks/test_interface.yml b/playbooks/test_interface.yml index 9caf946..7368aae 100644 --- a/playbooks/test_interface.yml +++ b/playbooks/test_interface.yml @@ -13,12 +13,10 @@ set_fact: iosxe_show_interface - name: combine - set_fact: + ansible.builtin.set_fact: hostname_interface_data: "{{ interface_data | combine({inventory_hostname: iosxe_show_interface.interface }) }}" - name: data - set_fact: - interface_data: "{{ interface_data | combine(item) }}" loop: >- {{ groups['routers'] @@ -27,8 +25,10 @@ | list }} run_once: true + ansible.builtin.set_fact: + interface_data: "{{ interface_data | combine(item) }}" - name: set dictionary as stats for use in workflow - set_stats: + ansible.builtin.set_stats: data: interface_data: "{{ interface_data }}" diff --git a/playbooks/test_ospf_int.yml b/playbooks/test_ospf_int.yml index 1f98b26..df69930 100644 --- a/playbooks/test_ospf_int.yml +++ b/playbooks/test_ospf_int.yml @@ -29,19 +29,18 @@ rescue: - name: print which device has errors on show ip ospf neighbors - debug: + ansible.builtin.debug: msg: "{{ inventory_hostname }} did not return ospf neighbors" + - name: print result - set_fact: + ansible.builtin.set_fact: ospf_int_result: "{{ result }}" - name: add dict keys for router names - set_fact: + ansible.builtin.set_fact: ospf_int_error_data: "{{ ospf_error_data | default ({}) | combine({inventory_hostname: ospf_int_result }) }}" - name: create one dictionary of ospf neighbor data - set_fact: - ospf_error_data: "{{ ospf_error_data | combine(item) }}" loop: >- {{ groups['routers'] @@ -50,8 +49,10 @@ | list }} run_once: true + ansible.builtin.set_fact: + ospf_error_data: "{{ ospf_error_data | combine(item) }}" - name: set stats for ospf int data to use in workflow - set_stats: + ansible.builtin.set_stats: data: ospf_error_data: "{{ ospf_error_data }}" diff --git a/playbooks/test_ospf_nei.yml b/playbooks/test_ospf_nei.yml index f7e6345..9b1f98e 100644 --- a/playbooks/test_ospf_nei.yml +++ b/playbooks/test_ospf_nei.yml @@ -21,16 +21,14 @@ ospf_neighbors: "{{ ospf_neighbors }}" rescue: - name: if router has no neighbors create custom error dict - set_fact: + ansible.builtin.set_fact: ospf_neighbors: "{{ ospf_neighbors | default ({}) | combine(no_ospf_nei_dict) }}" - name: add dict keys for router names - set_fact: + ansible.builtin.set_fact: hostname_ospf_data: "{{ ospf_nei_data | combine({inventory_hostname: ospf_neighbors.interfaces }) }}" - name: create one dictionary of ospf neighbor data - set_fact: - ospf_nei_data: "{{ ospf_nei_data | combine(item) }}" loop: >- {{ groups['routers'] @@ -39,8 +37,10 @@ | list }} run_once: true + ansible.builtin.set_fact: + ospf_nei_data: "{{ ospf_nei_data | combine(item) }}" - name: set stats to send ospf nei info to workflow - set_stats: + ansible.builtin.set_stats: data: ospf_nei_data: "{{ ospf_nei_data }}"