Skip to content

Commit cad7da7

Browse files
Fix for ReadMe (#653)
* Fix for ReadMe * Fix for ReadMe * Fix for ReadMe * Fix for ReadMe
1 parent de15a23 commit cad7da7

File tree

2 files changed

+85
-37
lines changed

2 files changed

+85
-37
lines changed

README.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,30 @@
11
[![Documentation Status](https://readthedocs.org/projects/junos-ansible-modules/badge/?version=stable)](https://junos-ansible-modules.readthedocs.io/en/2.3.0/)
22

3-
NOTE : The collection for Ansible is under development and changes are expected in the namespace/module implementation.
4-
One may use it but it is recommended to currently use juniper.junos roles for professional implementation.
5-
Refer - https://github.com/Juniper/ansible-junos-stdlib/tree/roles for more info.
6-
73
# Juniper Ansible collection for Junos
84

9-
The repo is under active development. If you take a clone, you are getting the latest, and perhaps not entirely stable code.
10-
115
## About
126

13-
Juniper Networks supports Ansible for managing devices running the Junos operating system (Junos OS).
7+
Juniper Networks supports Ansible for managing devices running the Junos operating system (Junos OS and Junos Evolved).
148
This collection is hosted on the Ansible Galaxy website under the collection
15-
[juniper.device](https://galaxy.ansible.com/Juniper/junos/). The juniper.device collection includes
16-
a set of Ansible modules that perform specific operational and configuration tasks on devices running Junos OS.
17-
These tasks include:
18-
installing and upgrading Junos OS, provisioning new Junos devices in the network, loading configuration changes,
9+
[juniper.device](https://galaxy.ansible.com/ui/repo/published/juniper/device/).
10+
11+
The `juniper.device` collection includes a set of Ansible modules that perform specific operational and configuration tasks on devices running Junos OS.
12+
These tasks include: installing and upgrading Junos OS, provisioning new Junos devices in the network, loading configuration changes,
1913
retrieving information, and resetting, rebooting, or shutting down managed devices. Please refer to the
2014
[INSTALLATION](#installation) section for instructions on installing this collection.
2115

22-
## juniper.junos roles by Juniper Networks
23-
24-
Ansible galaxy is upgrading to collections and plans to deprecate roles in future. The master branch will now have
25-
juniper.device collection support. Juniper.junos roles have been moved to roles branch.
26-
For more information for roles, check:
27-
https://github.com/Juniper/ansible-junos-stdlib/tree/roles
28-
2916
## Two Sets of Ansible Modules for Junos devices
3017

3118
Since Ansible version >= 2.1, Ansible also natively includes
32-
[core modules for Junos](http://docs.ansible.com/ansible/list_of_network_modules.html#junos). The Junos modules included
33-
in Ansible core have names which begin with the prefix `junos_`. The Junos modules included in this Juniper.device
19+
[core modules for Junos](https://docs.ansible.com/ansible/latest/collections/junipernetworks/junos/index.html#plugins-in-junipernetworks-junos). The Junos modules included
20+
in Ansible core have names which begin with the prefix `junos_`. The Junos modules included in this `Juniper.device`
3421
collection have names starting with module types. These two sets of Junos modules can coexist on the same
35-
Ansible control machine, and an Ansible play may invoke a module from either (or both) sets. Juniper Networks recommends
36-
using the modules in this collection when writing new playbooks that manage Junos devices.
22+
Ansible control machine, and an Ansible playbook may invoke a module from either (or both) sets. Juniper Networks recommends
23+
using the modules in `juniper.device` collection when writing new playbooks that manage Junos devices.
3724

3825
## Overview of Modules
3926

40-
This juniper.device collection includes the following modules:
27+
This `juniper.device` collection includes the following modules:
4128

4229
- **command** — Execute one or more CLI commands on a Junos device.
4330
- **config** — Manipulate the configuration of a Junos device.
@@ -53,11 +40,11 @@ This juniper.device collection includes the following modules:
5340

5441
### PyEZ Version Requirement
5542

56-
For ansible collection juniper.device we will need to install junos-eznc(PyEZ) version 2.6.0 or higher.
43+
For ansible collection `juniper.device` we will need to install [junos-eznc](https://github.com/Juniper/py-junos-eznc) version 2.6.0 or higher.
5744

5845
### Overview of Plugins
5946

60-
In addition to the modules listed above, a callback_plugin `jsnapy` is available for the module `jsnapy`.
47+
In addition to the modules listed above, a callback_plugin `jsnapy` is available for the module [jsnapy](https://github.com/Juniper/jsnapy).
6148

6249
The callback_plugin `jsnapy` helps to print on the screen additional information regarding jsnapy failed tests.
6350
For each failed test, a log will be printed after the RECAP of the playbook as shown in this example:
@@ -75,8 +62,6 @@ For each failed test, a log will be printed after the RECAP of the playbook as s
7562
JSNAPy Results for: qfx10002-02 ************************************************
7663
Value of 'peer-state' not 'is-equal' at '//bgp-information/bgp-peer' with {"peer-as": "65200", "peer-state": "Active", "peer-address": "100.0.0.21"}
7764

78-
The `jsnapy` plugin is currently in **Experimental** stage, please provide feedback.
79-
8065
Callback plugins are not activated by default. They must be manually added to the Ansible
8166
configuration file under the `[defaults]` section using the variable `callback_whitelist`. Specifically, these lines
8267
should be added to the Ansible configuration file in order to allow the jsnapy callback plugin:
@@ -88,7 +73,7 @@ should be added to the Ansible configuration file in order to allow the jsnapy c
8873

8974
[Official Juniper documentation](http://www.juniper.net/techpubs/en_US/release-independent/junos-ansible/information-products/pathway-pages/index.html) (detailed information, including examples)
9075

91-
[Ansible style documentation](http://junos-ansible-modules.readthedocs.org)
76+
[Ansible style documentation](https://ansible-juniper-collection.readthedocs.io/en/latest/)
9277

9378
## INSTALLATION
9479

@@ -108,13 +93,13 @@ In MacOS Mojave and newer (>=10.14), ssh keys created with the system `ssh-keyge
10893
### Ansible Galaxy collection
10994

11095
You can use the ansible-galaxy install command to install the latest
111-
version of the juniper.device collection.
96+
version of the `juniper.device` collection.
11297

11398
```bash
11499
sudo ansible-galaxy collection install juniper.device
115100
```
116101

117-
You can also use the ansible-galaxy install command to install the latest development version of the junos role directly from GitHub.
102+
You can also use the ansible-galaxy install command to install the latest development version of the junos collections directly from GitHub.
118103

119104
```bash
120105
sudo ansible-galaxy collection install git+https://github.com/Juniper/ansible-junos-stdlib.git#/ansible_collections/juniper/device
@@ -167,7 +152,7 @@ You may have noticed that the base command is almost always the same. We can als
167152

168153
### Extending the container with additional packages
169154

170-
It's possible to install additional OS (Alpine) packages, Python packages (via pip), and Ansible roles or collections at container instantiation. This can be done by passing in environment variables or bind mounting files.
155+
It's possible to install additional OS (Alpine) packages, Python packages (via pip), and Ansible collections at container instantiation. This can be done by passing in environment variables or binding mount files.
171156

172157
#### OS Packages
173158

@@ -188,7 +173,7 @@ As a bind mount.
188173

189174
Environment Variable: `$REQ`
190175
Bind Mount: `/extras/requirements.txt`
191-
File Format: pip [requirements](https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format) file
176+
File Format: pip [requirements](https://pip.pypa.io/en/stable/reference/requirements-file-format/) file
192177

193178
Examples:
194179

@@ -256,19 +241,21 @@ This example outlines how to use Ansible to install or upgrade the software imag
256241
257242
This modules requires the following to be installed on the Ansible control machine:
258243
259-
- Python >= 3.7
244+
- Python >= 3.8
260245
- [Ansible](http://www.ansible.com) 2.9 or later
261246
- Junos [py-junos-eznc](https://github.com/Juniper/py-junos-eznc) 2.6.0 or later
262247
- [jxmlease](https://github.com/Juniper/jxmlease) 1.0.1 or later
248+
- [xmltodict](https://pypi.org/project/xmltodict/) 0.13.0 or later
249+
- [jsnapy](https://github.com/Juniper/jsnapy) 1.3.7 or later
263250
264251
## LICENSE
265252
266253
Apache 2.0
267254
268255
## SUPPORT
269256
270-
Support for this juniper.device collection is provided by the community and Juniper Networks. If you have an
271-
issue with a module in the juniper.device collection, you may:
257+
Support for this `juniper.device` collection is provided by the community and Juniper Networks. If you have an
258+
issue with a module in the `juniper.device` collection, you may:
272259

273260
- Open a [GitHub issue](https://github.com/Juniper/ansible-junos-stdlib/issues).
274261
- Post a question on our [Google Group](https://groups.google.com/forum/#!forum/junos-python-ez)
@@ -284,8 +271,8 @@ Juniper Networks is actively contributing to and maintaining this repo. Please c
284271
285272

286273
*Contributors:*
287-
[Nitin Kumar](https://github.com/vnitinv), [Rahul Kumar](https://github.com/rahkumar651991), [Stephen Steiner](https://github.com/ntwrkguru)
274+
[Stephen Steiner](https://github.com/ntwrkguru), [Dinesh Babu](https://github.com/dineshbaburam91), [Chidanand Pujar](https://github.com/chidanandpujar)
288275

289276
*Former Contributors:*
290277

291-
[Stacy W Smith](https://github.com/stacywsmith), [Jeremy Schulman](https://github.com/jeremyschulman), [Rick Sherman](https://github.com/shermdog), [Damien Garros](https://github.com/dgarros), [David Gethings](https://github.com/dgjnpr)
278+
[Stacy W Smith](https://github.com/stacywsmith), [Jeremy Schulman](https://github.com/jeremyschulman), [Rick Sherman](https://github.com/shermdog), [Damien Garros](https://github.com/dgarros), [David Gethings](https://github.com/dgjnpr), [Nitin Kumar](https://github.com/vnitinv), [Rahul Kumar](https://github.com/rahkumar651991)

tests/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Functional Tests for Juniper Ansible collection for Junos
2+
3+
Following are the steps to execute Ansible Functional test playbooks
4+
5+
## Steps to execute Ansible Functional test playbooks
6+
7+
1. Git clone the functional tests
8+
```
9+
git clone https://github.com/Juniper/ansible-junos-stdlib.git
10+
```
11+
2. Change directory to ansible-junos-stdlib/tests
12+
```
13+
cd ansible-junos-stdlib/tests/
14+
```
15+
3. Update the ansible.cfg under tests directory
16+
```
17+
[defaults]
18+
hash_behaviour=merge
19+
inventory = inventory
20+
host_key_checking = False
21+
log_path = ./ansible.log
22+
23+
[persistent_connection]
24+
command_timeout = 300
25+
```
26+
4. To execute test playbook with Local connection, you need to update the inventory file for local connection test cases by setting ansible_connection=local
27+
```
28+
[junos]
29+
local_connection_testcases ansible_host=xx.xx.xx.xx ansible_user=xyz ansible_pass=xyz ansible_port=22 ansible_connection=local ansible_command_timeout=300
30+
31+
[all:vars]
32+
ansible_python_interpreter=<Python interpreter path>
33+
```
34+
5. To execute test playbook with PyEZ persistent connection, you need to update the inventory file for persistent connection test cases by setting ansible_connection=juniper.device.pyez
35+
```
36+
[junos]
37+
pyez_connection_testcases ansible_host=xx.xx.xx.xx ansible_user=xyz ansible_ssh_pass=xyz ansible_port=22 ansible_connection=juniper.device.pyez ansible_command_timeout=300
38+
39+
[all:vars]
40+
ansible_python_interpreter=<Python interpreter path>
41+
```
42+
6. To execute Functional test playbooks
43+
ansible-playbook <playbook name>
44+
```
45+
ansible-playbook pb.juniper_junos_system.yml
46+
```
47+
### NOTE:
48+
49+
To execute pb.juniper_junos_software_member.yml playbook, you have to use the following devices
50+
51+
Virtual Chassis - EX-VC, MX-VC
52+
53+
To execute pb.juniper_junos_srx_cluster.yml playbook, you have to use the following devices
54+
55+
SRX HA Cluster enabled devices
56+
57+
### Ansible Fixes :
58+
For the PyEZ persistent connection support, you need to apply the following fix for Ansible issue
59+
```
60+
https://github.com/Juniper/ansible-junos-stdlib/issues/606
61+
```

0 commit comments

Comments
 (0)