sros_config – Manage Nokia SR OS device configuration¶
Synopsis¶
Nokia SR OS configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with SR OS configuration sections in a deterministic way.
Parameters¶
Notes¶
Note
For more information on using Ansible to manage Nokia SR OS Network devices see https://www.ansible.com/ansible-nokia.
Examples¶
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
---
vars:
cli:
host: "{{ inventory_hostname }}"
username: admin
password: admin
transport: cli
---
- name: enable rollback location
sros_config:
lines: configure system rollback rollback-location "cf3:/ansible"
provider: "{{ cli }}"
- name: set system name to {{ inventory_hostname }} using one line
sros_config:
lines:
- configure system name "{{ inventory_hostname }}"
provider: "{{ cli }}"
- name: set system name to {{ inventory_hostname }} using parents
sros_config:
lines:
- 'name "{{ inventory_hostname }}"'
parents:
- configure
- system
provider: "{{ cli }}"
backup: yes
- name: load config from file
sros_config:
src: "{{ inventory_hostname }}.cfg"
provider: "{{ cli }}"
save: yes
- name: invalid use of lines
sros_config:
lines:
- service
- vpls 1000 customer foo 1 create
- description "invalid lines example"
provider: "{{ cli }}"
- name: valid use of lines
sros_config:
lines:
- description "invalid lines example"
parents:
- service
- vpls 1000 customer foo 1 create
provider: "{{ cli }}"
- name: configurable backup path
sros_config:
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
backup_path
string
|
when backup is yes |
The full path to the backup file
Sample:
/playbooks/ansible/backup/[email protected]:28:34
|
commands
list
|
always |
The set of commands that will be pushed to the remote device
Sample:
['config system name "sros01"']
|
updates
list
|
always |
The set of commands that will be pushed to the remote device
Sample:
['config system name "sros01"']
|
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by an Ansible Partner. [certified]
Authors¶
Peter Sprygada (@privateip)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.