-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding all new tested sample playbooks to git hub.
- Loading branch information
amuraleedhar
committed
Jun 26, 2018
1 parent
730396c
commit d78fdb5
Showing
40 changed files
with
620 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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do configuration back up. | ||
hosts: cnos_backup_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_backup_sample |
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,18 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_backup_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_backup_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos rcpath=/root/cnos_config/G8272-running-config.txt | ||
|
||
#Use this in case its TFTP as tftpboot folder is the starting point for tftp | ||
#10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos rcpath=/anil/G8272-running-config.txt | ||
|
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,9 @@ | ||
# Common code to do some configurations | ||
- name: Module to do bgp configurations | ||
hosts: cnos_bgp_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_bgp_sample | ||
|
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_bgp_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_bgp_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,33 @@ | ||
--- | ||
- hosts: cnos_command | ||
gather_facts: no | ||
connection: network_cli | ||
|
||
vars: | ||
limit_to: "*" | ||
debug: false | ||
# Run the tests within blocks allows the next module to be tested if the previous one fails. | ||
# This is done to allow https://github.com/ansible/dci-partner-ansible/ to run the full set of tests. | ||
|
||
|
||
tasks: | ||
- set_fact: | ||
test_failed: false | ||
failed_modules: [] | ||
- block: | ||
- include_role: | ||
name: cnos_command | ||
when: "limit_to in ['*', 'cnos_command']" | ||
rescue: | ||
- set_fact: | ||
failed_modules: "{{ failed_modules }} + [ 'cnos_command' ]" | ||
test_failed: true | ||
|
||
########### | ||
- debug: var=failed_modules | ||
when: test_failed | ||
|
||
- name: Has any previous test failed? | ||
fail: | ||
msg: "One or more tests failed, check log for details" | ||
when: test_failed |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_command_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_command] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do some configurations based on conditions | ||
hosts: cnos_conditional_command_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_conditional_command_sample |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_conditional_command_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_conditional_command_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do some template configurations based on conditions | ||
hosts: cnos_conditional_template_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_conditional_template_sample |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_conditional_template_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_conditional_template_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,34 @@ | ||
--- | ||
- hosts: cnos_config | ||
gather_facts: no | ||
connection: network_cli | ||
|
||
vars: | ||
limit_to: "*" | ||
debug: false | ||
# Run the tests within blocks allows the next module to be tested if the previous one fails. | ||
# This is done to allow https://github.com/ansible/dci-partner-ansible/ to run the full set of tests. | ||
|
||
|
||
tasks: | ||
- set_fact: | ||
test_failed: false | ||
failed_modules: [] | ||
- block: | ||
- include_role: | ||
name: cnos_config | ||
when: "limit_to in ['*', 'cnos_config']" | ||
rescue: | ||
- set_fact: | ||
failed_modules: "{{ failed_modules }} + [ 'cnos_config' ]" | ||
test_failed: true | ||
|
||
|
||
########### | ||
- debug: var=failed_modules | ||
when: test_failed | ||
|
||
- name: Has any previous test failed? | ||
fail: | ||
msg: "One or more tests failed, check log for details" | ||
when: test_failed |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_command_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_config] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do Interface Ethernet configurations | ||
hosts: cnos_ethernet_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_ethernet_sample |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_ethernet_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_ethernet_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,34 @@ | ||
--- | ||
- hosts: cnos_facts | ||
gather_facts: no | ||
connection: network_cli | ||
|
||
vars: | ||
limit_to: "*" | ||
debug: false | ||
# Run the tests within blocks allows the next module to be tested if the previous one fails. | ||
# This is done to allow https://github.com/ansible/dci-partner-ansible/ to run the full set of tests. | ||
|
||
|
||
tasks: | ||
- set_fact: | ||
test_failed: false | ||
failed_modules: [] | ||
- block: | ||
- include_role: | ||
name: cnos_facts | ||
when: "limit_to in ['*', 'cnos_facts']" | ||
rescue: | ||
- set_fact: | ||
failed_modules: "{{ failed_modules }} + [ 'cnos_facts' ]" | ||
test_failed: true | ||
|
||
########### | ||
- debug: var=failed_modules | ||
when: test_failed | ||
|
||
- name: Has any previous test failed? | ||
fail: | ||
msg: "One or more tests failed, check log for details" | ||
when: test_failed | ||
|
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_facts_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_facts] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do Image download using various protocols | ||
hosts: cnos_image_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_image_sample |
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,17 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_image_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_image_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos imgpath=/root/cnos_images/G8272-10.1.0.112.img | ||
|
||
#Use this in case its TFTP as tftpboot is the starting point for tftp | ||
#10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos imgpath="/anil/G8272-10.2.0.34.img |
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do portchannel configurations | ||
hosts: cnos_portchannel_sample | ||
gather_facts: no | ||
connection: local | ||
roles: | ||
- cnos_portchannel_sample | ||
|
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_portchannel_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_portchannel_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do rollback of configurations from back up server. | ||
hosts: cnos_rollback_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_rollback_sample |
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,18 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_rollback_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_rollback_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos rcpath=/root/cnos_config/G8272-running-config.txt | ||
|
||
#Use this in case its TFTP as tftpboot folder is the starting point for tftp | ||
#10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos rcpath=/anil/G8272-running-config.txt | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to do save configurations | ||
hosts: cnos_save_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_save_sample |
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,15 @@ | ||
# You have to paste this dummy information in /etc/ansible/hosts | ||
# Notes: | ||
# - Comments begin with the '#' character | ||
# - Blank lines are ignored | ||
# - Groups of hosts are delimited by [header] elements | ||
# - You can enter hostnames or ip addresses | ||
# - A hostname/ip can be a member of multiple groups | ||
# | ||
# In the /etc/ansible/hosts file u have to enter [cnos_save_sample] tag | ||
# Following you should specify IP Adresses details | ||
# Please change <username> and <password> with appropriate value for your switch. | ||
|
||
[cnos_save_sample] | ||
10.241.107.39 ansible_network_os=cnos ansible_ssh_user=<username> ansible_ssh_pass=<password> deviceType=g8272_cnos | ||
|
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,8 @@ | ||
# Common code to do some configurations | ||
- name: Module to show running configuration | ||
hosts: cnos_showrun_sample | ||
gather_facts: no | ||
connection: local | ||
|
||
roles: | ||
- cnos_showrun_sample |
Oops, something went wrong.