mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
647ed207af
* Fixes Netconf_config single parameter bug Fixes 56022 fixed get_config to not require multiple parameters to just run a backup * Add Integration test for netconf_config Associated with #56022 tests backup through netconf only using one parameter. * Added debug to the begin and end of file * Fix formatting of save config. #56022 * removed blank line at end: #56022
64 lines
1.4 KiB
YAML
64 lines
1.4 KiB
YAML
---
|
|
- debug: msg="START netconf_config junos/basic.yaml on connection={{ ansible_connection }}"
|
|
|
|
- include_vars: "{{playbook_dir }}/targets/netconf_config/tests/junos/fixtures/config.yml"
|
|
|
|
- name: syslog file config- setup
|
|
junos_config:
|
|
lines:
|
|
- delete system syslog file test_netconf_config
|
|
|
|
- name: configure syslog file
|
|
netconf_config:
|
|
content: "{{ syslog_config }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<name>test_netconf_config</name>' in result.diff.after"
|
|
|
|
- name: configure syslog file (idempotent)
|
|
netconf_config:
|
|
content: "{{ syslog_config }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: configure syslog file replace
|
|
netconf_config:
|
|
content: "{{ syslog_config_replace }}"
|
|
default_operation: 'replace'
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: test backup
|
|
netconf_config:
|
|
content: "{{ syslog_config }}"
|
|
backup: True
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "'backup_path' in result"
|
|
|
|
- name: syslog file config- teardown
|
|
junos_config:
|
|
lines:
|
|
- delete system syslog file test_netconf_config
|
|
|
|
- name: save config
|
|
netconf_config:
|
|
backup: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "'backup_path' in result"
|
|
|
|
- debug: msg="END netconf_config junos/basic.yaml on connection={{ ansible_connection }}"
|