Releases: Juniper/ansible-junos-stdlib
Release 1.4.3
Summary
This is primarily a maintenance release to provide compatibility with the latest Ansible 2.4.0 release.
New Features
Add the force_host
argument to junos_install_os
. #233/#234
- By default, the Host Software package on QFX-series platforms is not
upgraded by the<request-package-add>
RPC. Adding the<force-host/>
argument to the RPC forces the Host Software package to also be upgraded.
This PR adds the ability to pass theforce_host
argument to the
junos_install_os
module. This optional boolean argument defaults
toFalse
. When set toTrue
, it passes the<force-host/>
argument to
the underlying<request-package-add>
RPC.
Add new re_name
and master_state
facts to junos_get_facts
. #239
- These new facts are based on the
dev.re_name
anddev.master
PyEZ device properties.
ignore_warning
support for junos_install_config
. #248
- The new
ignore_warning
parameter can be used to ignore warnings generated
when loading a configuration withjunos_install_config
- If
ignore_warning=True
then ALL warnings are ignored - If
ignore_warning=<string_val>
then all warnings matching<string_val>
are ignored. - If
ignore_warning=<list_of_string_vals>
then all warnings matching any of the
<string_vals>
in the list are ignored.
- If
Add do_not_fragment
argument to junos_ping
. #262
Add new junos_pmtud
module. #263
check_commit
option added added to junos_commit
. #163
Add a parameter to only do a commit check. #109
Maintainability
Verified functionality with Ansible 2.4.0
Add text for ansible-galaxy installation from GitHub. #204
Bugs Fixed
junos_install_os used to fail without 'logfile' parameter. #247
version finding regex in case version is not provided. #249
Fix do_not_fragment argument to junos_ping module. #264
Test fixes for junos_pmtud fixes. #265
Fix junos_commit
commit_check
argument. #266
Fix doc string in junos_install_config
and documentation generation on Ansible 2.4. #267
Release 1.4.2
Summary
This is primarily a maintenance release to provide compatibility with the latest Ansible 2.3.0 release.
New Features
Non-default SSH private key files with the ssh_private_key_file
argument
- Priv ssh key #205
Example:
- name: gather facts
junos_get_facts:
host={{ inventory_hostname }}
user='xxxx'
passwd='Test123'
ssh_private_key_file='/Users/nitinkr/.ssh/id_rsa_vmx'
register: junos
- name: Verify JUNOS version
debug: msg="{{junos.facts.version}}"
where passwd='Test123'
is the passphrase for the ssh private key file. (If passwd
is ommitted, the key is tried with an empty passphrase.)
Support the update
argument for configuration loading with junos_install_config
- "update" action for config load #218
This feature is equivalent to aload update
from the Junos CLI. When theupdate=True
argument is specified for junos_install_config, the complete loaded configuration is compared against the candidate configuration. For each hierarchy level or configuration object that is different in the two configurations, the version in the loaded configuration replaces the version in the candidate configuration. When the configuration is later committed, only system processes that are affected by the changed configuration elements parse the new configuration. This action is supported from PyEZ 2.1.0.
Example:
- name: Install the config using load update
junos_install_config:
host: "{{ inventory_hostname }}"
user: "{{ username }}"
passwd: "{{ password }}"
file: "{{ inventory_hostname }}.conf"
diffs_file: "{{ inventory_hostname }}.diff"
ISSU/NSSU support for junos_install_os
- ISSU/NSSU support #219
Support the ability to perform a unified in-service software upgrade from the junos_install_os module by adding theissu
argument. For Juniper Networks EX Series devices which support the nonstop software upgrade feature, thenssu
argument is added.
Example:
- name: Perform an ISSU of Junos
junos_install_os:
host: "{{ inventory_hostname }}"
user: "{{ username }}"
passwd: "{{ password }}"
issu: True
version: "16.1R4.7"
package: "junos-install-mx-x86-64-16.1R4.7.tgz"
Maintainability
- Add Unitest for Ansible modules using Virtual Devices in the Cloud #187
Bugs Fixed
- junos_jsnapy: snap_pre was broken & snapcheck was expecting testfiles full path #171/#172
- setup.py: Fix missing interpreter: (on Rhel7) #176
- junos_jsnapy: Add Jsnapy library to Dockerfile for junos_jsnapy #184
- junos_jsnapy: Add more checks to callback_plugin to make sure info returned by modules is valid #186
- README.md: Update README.md #188
- Don't log password #183
- junos_cli: Add test before writing output to dest #193
- junos_rpc: To support kwargs as dict into junos_rpc #196
- junos_jsnapy: Clean up the inline documentation #197
- junos_cli: Fix for > global name 'dest' is not defined #198
- junos_get_facts: Modify junos_get_facts to be compatible with Juniper/py-junos-eznc#638. #210
- junos_get_config: options type defined for Ansible >=2.1 #211
- JSON dump of Junos facts requires native Python data types. #223/#224
- All: Compatibility with Ansible 2.3. Allow modules to import cleanly #215
- All: Fix docs for Ansible 2.3 #230
Release 1.4.0
New Features
Dockerfile for junos ansible modules
- New Dockerfile added to automatically build a docker container for junos ansible modules #165
Console connection support
- Modules to work with console connections too using PyEZ 2.0 #162. For example
- name: Get configs
junos_get_config:
user: "{{ USERNAME }}"
passwd: "{{ PASSWORD }}"
port: 7011
mode: "telnet"
format: xml
junos_jsnapy
- Integrate JSNAPy to ansible which helps audit network devices
- name: Test based on a test_file directly
junos_jsnapy:
host: "{{ junos_host }}"
user: "{{ ansible_ssh_user }}"
passwd: "{{ ansible_ssh_pass }}"
test_files: tests/test_junos_interface.yaml
action: snapcheck
register: test1
- name: Check JSNAPy tests results
assert:
that:
- "test1.passPercentage == 100"
junos_ping
- Execute ping on junos devices
- name: "Execute ping peer"
junos_ping:
host={{ junos_host }}
user={{ ansible_ssh_user }}
passwd={{ ansible_ssh_pass }}
dest_ip=8.8.8.8
junos_get_table
- Retrieve data from a Junos device using Tables/Views.
- name: "Get neighbour info using std lldp table"
junos_get_table:
host={{ junos_host }}
user={{ ansible_ssh_user }}
passwd={{ ansible_ssh_pass }}
table=LLDPNeighborTable
file=lldp.yml
Updates/Enhancement
- ImportError to show proper message #158. For example
$ ansible-playbook facts_gather.yml
PLAY ***************************************************************************
TASK [gather facts] ************************************************************
fatal: [x.x.x.x]: FAILED! => {"changed": false, "failed": true, "msg": "ImportError: No module named lxml"}
- junos_shutdown to support delayed reboot and shutdown #150
- junos_install_config->check_commit_wait: Set number of seconds to wait between check and commit. #140
- Timeout option for junos_cli and junos_rpc #133
- timeout parameter to junos_rollback #131
Bugs Fixed
Release 1.3.1
Bug Fix
junos_rpc was not working with anisble 2.0.1.0 #114
For junos >=14.2 json config can be register to rpc_reply
- name: Get Device Configuration
hosts: all
roles:
- Juniper.junos
connection: local
gather_facts: no
tasks:
- name: Get interface information
junos_rpc:
host={{ inventory_hostname }}
rpc=get-interface-information
kwargs={interface_name:em0,media:True}
format=json
dest=get_interface_information.conf
register: junos
- name: Print configuration
debug: msg="{{ junos.rpc_reply }}"
Release 1.3.0
New Features
Added junos_rpc
-
To execute RPC on device and save output locally.
Example
- junos_rpc: host={{ inventory_hostname }} rpc=get-interface-information dest=get_interface_information.conf - junos_rpc: host={{ inventory_hostname }} rpc=get-interface-information kwargs="interface_name=em0" format=text dest=get_interface_information.conf
Added junos_cli
-
To execute CLI on device and save output locally
Example
- junos_cli: host: "{{ inventory_hostname }}" cli: "show chassis hardware" logfile: cli.log dest: "{{ inventory_hostname }}.xml" format: xml
Updates/Enhancement
junos_get_config diff option #100
-
junos_get_config now supports check_mode (as opposed to claiming that it did, but overwriting the dest file anyway).
Properly reports 'changed' attribute for junos_get_config module.Fixed the requirement status for the dest argument in junos_get_config (docs claimed True, but set to False when module was called).
If --diff on cmdline*, return diff diff with results.
In junos_get_config, sets before and after attributes and lets Ansible do the diff.
In junos_install_config, sets prepared with the output of commit check.
Add a timeout argument to the junos_commit module #97
- Add a timeout argument to the junos_commit module to support confirming a commit on a device which is slow and/or has a large config.
Bugs Fixed
Ansible 2.0 support #103
- junos_get_facts module was returning a junos.version_info object
which caused this new feature to raise a TypeError.
Exception handling #101
- Fix exception handling line in junos_install_config
Proper log message for junos_srx_cluster #98
- Fixing log message and setting results variable when enabling cluster
shebang path changed, modules to work in virtualenv environment too #93 #77
- Update all the shebangs in library/ to use /usr/bin/env python instead of hardcoding to /usr/bin/python.
Release 1.2.0
New Features
Added junos_srx_cluster
-
SRX devices can be joined or removed from a cluster
Example
-junos_srx_cluster: host={{ inventory_hostname }} console="--port={{ serial }}" cluster_enable=true logfile=cluster.log cluster_id={{ cluster_id }} node={{ node_id }} -junos_srx_cluster: host={{ inventory_hostname }} cluster_enable=false logfile=cluster.log
Added junos_get_config
-
Configuration can be retrieved from a device and stored as a file. Supports text (default) and XML format. Configuration
filter
andoptions
supported.Example
- junos_get_config: host: "{{ inventory_hostname }}" logfile: get_config.log dest: "{{ inventory_hostname }}.xml" format: xml filter: "interfaces" options: {inherit: inherit, groups: groups}
Added junos_rollback
-
Configuration will be rolled back and committed to Rollback Id provided. Module supports commit comments and confirm.
Example
- junos_rollback: host: "{{ inventory_hostname }}" logfile=rollback.log diffs_file=rollback.diff rollback=1 comment="Rolled back by Ansible" confirm=5
Added junos_commit
-
Execute a commit independently of loading a configuration.
Example
- junos_commit: host: "{{ inventory_hostname }}" logfile=changes.log comment="Non load commit"
Updated junos_install_config
-
Now supports
Load Replace
-
Now supports
Commit Confirmed
Example
- junos_install_config: host={{ inventory_hostname }} file=snmp.conf replace=yes confirm=5
Bugs Fixed
junos_install_config
- Underlying PyEZ exceptions were not being properly captured and logged. #56
- Warnings (RpcError) were not triggering rollback. Warning will now prevent a configuration from loading. (Per PyEZ functionality). #58
2015-07-29 17:12:48,505:CONFIG:pabst.englab.juniper.net:pushing file: /home/rsherman/workspace/warning.set
2015-07-29 17:12:48,505:CONFIG:pabst.englab.juniper.net:taking lock
2015-07-29 17:12:48,828:CONFIG:pabst.englab.juniper.net:loading config
2015-07-29 17:12:49,980:CONFIG:pabst.englab.juniper.net:doing a commit-check, please be patient
2015-07-29 17:12:51,467:CONFIG:pabst.englab.juniper.net:Unable to commit configuration: CommitError(edit_path: [edit security policies from-zone corp to-zone], bad_element: corp, message: mgd: Security zone must be defined)
Release 1.1.0
New Features
Add Ability to specify NETCONF Port
-
User can specify port other than default 830
Example
junos_install_config: host={{ inventory_hostname }} user=user passwd=pass port=22 file=load.conf
Commit comment junos_install_config
-
Add ability to specify a comment with config commit
Example
- junos_install_config: host={{ inventory_hostname }} file=banner.conf comment="configured by ansible"
Check mode added to junos_install_config and junos_get_facts
- Allows use of --check when executing ansible-playbook
- junos_get_facts will return facts as normal
- junos_install_config will load config, commit check and automatically rollback on exit.
Write configuration diff to file junos_install_config
-
Allows user to specify a file to write configuration diff to
Example
junos_install_config: host={{ inventory_hostname }} file=load.conf diffs_file=diff.log
Bugs Fixed
Rename facts 2RE to has_2RE
- Per Ansible convention all variables should start with a letter.
Console mode logging
- Underlying netconify errors were not captured
junos_install_config Exception Handling
-
Capture and log PyEZ ConfigLoadError and CommitError
2015-01-15 13:13:33,861:CONFIG:device:connecting to host: regress@device:22 2015-01-15 13:13:40,657:CONFIG:device:pushing file: /home/rsherman/workspace/bad-script.conf 2015-01-15 13:13:40,657:CONFIG:device:taking lock 2015-01-15 13:13:40,878:CONFIG:device:loading config 2015-01-15 13:13:41,101:CONFIG:device:unable to load config:error,op1,syntax error 2015-01-15 13:13:41,101:CONFIG:device:Unable to make changes
Release 1.0.0
Production Release 1.0.0
Early Adopter Release 0.4.0
Bugfix:
Updates for junos_install_config to do merge by default via Netconf
Introduced version 1.6
Early Adopter Release 0.3.0
Test release to confirm Autodoc feature does not break Galaxy Install.