Skip to content
Snippets Groups Projects
Commit a77d57bf authored by Simone Spinelli's avatar Simone Spinelli
Browse files

Add a role to perform checks after base config

parent 767d19a5
No related branches found
No related tags found
1 merge request!64Add a role to perform checks after base config
Pipeline #85220 canceled
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
- 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:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
---
# tasks file for base_config_checks
- name: Execute post-check command
include_tasks: base_config_single_command.yaml
with_items: "{{commands}}"
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>{{item.command}}</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
---
# 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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment