INACTIVE - http://mzl.la/ghe-archive - Junos modules for Ansible
Перейти к файлу
Damien a589ad260a Change travis distro 2016-05-18 00:08:51 -07:00
docs Fix Ansible Style documentation 2015-07-24 15:28:59 -05:00
library strip variables from \n\r 2016-05-17 23:40:58 -07:00
meta Fixed galaxy meta 2014-07-08 15:46:07 -07:00
tests Add Ansible config and playbook for Vagrant 2016-05-17 23:41:19 -07:00
tools PEP8 and 2.6 Updates 2014-06-30 15:39:03 -05:00
.gitignore Ignore vagrant files 2016-05-17 23:40:24 -07:00
.travis.yml Change travis distro 2016-05-18 00:08:51 -07:00
COPYRIGHT Copyright update 2014-06-30 16:10:45 -05:00
LICENSE Initial commit 2014-01-23 11:28:58 -08:00
README.md Update README.md 2016-03-31 10:15:34 -04:00
env-setup updates 2014-03-20 09:17:44 -04:00
requirements.txt Add travis test file and requirements 2016-05-17 18:31:02 -07:00
setup.py Docs Template 2014-08-15 14:15:05 -07:00
version.py with 2.0 ansible junos_rpc was not working 2016-02-26 19:45:00 +05:30

README.md

ABOUT

Juniper Networks provides support for using Ansible to deploy devices running the Junos operating system (Junos OS). The Juniper Networks Ansible library, which is hosted on the Ansible Galaxy website under the role junos, enables you to use Ansible to perform specific operational and configuration tasks on devices running Junos OS, including installing and upgrading Junos OS, deploying specific devices in the network, loading configuration changes, retrieving information, and resetting, rebooting, or shutting down managed devices. Please refer to INSTALLATION section for setup.

OVERVIEW OF MODULES

  • junos_get_facts — Retrieve device-specific information from the host.
  • junos_rpc — To execute RPC on device and save output locally
  • junos_cli — To execute CLI on device and save output locally
  • junos_commit — Commit candidate configuration on device.
  • junos_get_config — Retrieve configuration of device.
  • junos_install_config — Modify the configuration of a device running Junos OS.
  • junos_install_os — Install a Junos OS software package.
  • junos_rollback — Rollback configuration of device.
  • junos_shutdown — Shut down or reboot a device running Junos OS.
  • junos_srx_cluster — Enable/Disable cluster mode for SRX devices
  • junos_zeroize — Remove all configuration information on the Routing Engines and reset all key values on a device.

DOCUMENTATION

Official documentation (detailed information, includes examples)

Ansible style documentation

INSTALLATION

This repo assumes you have the DEPENDENCIES installed on your system.

Ansible Galaxy Role

To download the junos role to the Ansible server, execute the ansible-galaxy install command, and specify Juniper.junos.

[root@ansible-cm]# ansible-galaxy install Juniper.junos
- downloading role 'junos', owned by Juniper
- downloading role from https://github.com/Juniper/ansible-junos-stdlib/archive/1.3.1.tar.gz
- extracting Juniper.junos to /usr/local/etc/ansible/roles/Juniper.junos
- Juniper.junos was installed successfully

Git clone

For testing you can git clone this repo and run the env-setup script in the repo directory:

user@ansible-junos-stdlib> source env-setup

This will set your $ANSIBLE_LIBRARY variable to the repo location and the installed Ansible library path. For example:

[jeremy@ansible-junos-stdlib]$ echo $ANSIBLE_LIBRARY
/home/jeremy/Ansible/ansible-junos-stdlib/library:/usr/share/ansible

Example Playbook

This example outlines how to use Ansible to install or upgrade the software image on a device running Junos OS.

---
- name: Install Junos OS
  hosts: dc1
  roles:
    - Juniper.junos
  connection: local
  gather_facts: no
  vars:
    wait_time: 3600
    pkg_dir: /var/tmp/junos-install
    OS_version: 14.1R1.10
    OS_package: jinstall-14.1R1.10-domestic-signed.tgz
    log_dir: /var/log/ansible

  tasks:
    - name: Checking NETCONF connectivity
      wait_for: host={{ inventory_hostname }} port=830 timeout=5
    - name: Install Junos OS package
      junos_install_os:
        host={{ inventory_hostname }}
        reboot=yes
        version={{ OS_version }}
        package={{ pkg_dir }}/{{ OS_package }}
        logfile={{ log_dir }}/software.log
      register: sw
      notify:
        - wait_reboot

  handlers:
    - name: wait_reboot
      wait_for: host={{ inventory_hostname }} port=830 timeout={{ wait_time }}
      when: not sw.check_mode

DEPENDENCIES

Thes modules require the following to be installed on the Ansible server:

LICENSE

Apache 2.0

CONTRIBUTORS

Juniper Networks is actively contributing to and maintaining this repo. Please contact jnpr-community-netdev@juniper.net for any queries.

Contributors:

Nitin Kumar, Stacy W Smith, David Gethings

Former Contributors:

Jeremy Schulman, Rick Sherman