-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
system { | ||
host-name pynet-test1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |