diff options
author | Ganesh Nalawade <ganesh634@gmail.com> | 2017-04-25 23:09:55 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-25 23:09:55 +0530 |
commit | 09b8badc5e1340e7affb3338b4aa89f4dce518dc (patch) | |
tree | 57e8bf8623e62aed9f670214c9b0f6211003b509 | |
parent | 15c19367d6e49e18d578c5868ff7733bfe5559f2 (diff) | |
download | ansible-09b8badc5e1340e7affb3338b4aa89f4dce518dc.tar.gz |
Minor junos_config module changes (#23972)
* Minor junos_config module changes
* Add note for json config support
* Add example for lines argument
* Fix future warning for ElementTree
* Remove unwanted space
-rw-r--r-- | lib/ansible/modules/network/junos/junos_config.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/ansible/modules/network/junos/junos_config.py b/lib/ansible/modules/network/junos/junos_config.py index a60098ab8f..9f49e14d38 100644 --- a/lib/ansible/modules/network/junos/junos_config.py +++ b/lib/ansible/modules/network/junos/junos_config.py @@ -45,7 +45,7 @@ options: src: description: - The I(src) argument provides a path to the configuration file - to load into the remote system. The path can either be a full + to load into the remote system. The path can either be a full system path to the configuration file if the value starts with / or relative to the root of the implemented role or playbook. This argument is mutually exclusive with the I(lines) argument. @@ -142,6 +142,8 @@ requirements: notes: - This module requires the netconf system service be enabled on the remote device being managed. + - Loading JSON-formatted configuration I(json) is supported + starting in Junos OS Release 16.1 onwards. """ EXAMPLES = """ @@ -151,6 +153,14 @@ EXAMPLES = """ comment: update config provider: "{{ netconf }}" +- name: load configure lines into device + junos_config: + lines: + - set interfaces ge-0/0/1 unit 0 description "Test interface" + - set vlans vlan01 description "Test vlan" + comment: update config + provider: "{{ netconf }}" + - name: rollback the configuration to id 10 junos_config: rollback: 10 @@ -330,7 +340,7 @@ def main(): else: diff = configure_device(module, warnings) - if diff: + if diff is not None: if module._diff: result['diff'] = {'prepared': diff} result['changed'] = True |