Skip to content

Commit

Permalink
Adding Juniper ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Oct 7, 2015
1 parent 9c16ff7 commit f4e83e5
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/ansible-hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[local]
localhost ansible_connection=local

[juniper]
pynet-sf-srx ansible_ssh_host=10.10.10.227 juniper_user=pyclass juniper_passwd=password

[juniper:vars]
ansible_connection=local
ansible_python_interpreter=~/applied_python/bin/python

11 changes: 11 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/ex1_facts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Print out Juniper Facts
hosts: juniper
gather_facts: false
tasks:
- name: Retrieve Juniper Facts
junos_get_facts: host={{ ansible_ssh_host }} user={{ juniper_user }} passwd={{ juniper_passwd }}
register: srx_info

- name: Print SRX information
debug: msg="{{ srx_info.facts }}"
13 changes: 13 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/ex2_hostname_conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Set hostname using conf notation
hosts: juniper
gather_facts: false
tasks:
- name: Set system hostname
junos_install_config:
host={{ ansible_ssh_host }}
file=set_hostname.conf
overwrite=false
user={{ juniper_user }}
passwd={{ juniper_passwd }}

13 changes: 13 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/ex3_hostname_xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Set hostname using XML
hosts: juniper
gather_facts: false
tasks:
- name: Set system hostname
junos_install_config:
host={{ ansible_ssh_host }}
file=set_hostname.xml
overwrite=false
user={{ juniper_user }}
passwd={{ juniper_passwd }}

4 changes: 4 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/set_hostname.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

system {
host-name pynet-test1;
}
5 changes: 5 additions & 0 deletions pyth_ans_ecourse/juniper_ansible/set_hostname.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<configuration>
<system>
<host-name>pynet-jnpr-srx1</host-name>
</system>
</configuration>

0 comments on commit f4e83e5

Please sign in to comment.