Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ansible_user: 'admin'
ansible_ssh_pass: 'C1sco12345'
ansible_port: 22
netconf_port: 830
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ansible_user: 'developer'
ansible_ssh_pass: 'lastorangerestoreball8876'
ansible_port: 22
netconf_port: 830
4 changes: 4 additions & 0 deletions ansible-playbooks/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ ios-xe-mgmt-latest.cisco.com ansible_port=8181

[switches]
cat9k ansible_host=10.10.20.100

[sandbox]
sandbox-iosxe-latest-1.cisco.com
sandbox-iosxe-recomm-1.cisco.com
28 changes: 15 additions & 13 deletions ansible-playbooks/loopback_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
---
- name: Sample IOS config for Ansible 2.5+
hosts:
- ios-xe-mgmt.cisco.com
- ios-xe-mgmt-latest.cisco.com
gather_facts: no
- sandbox-iosxe-latest-1.cisco.com
- sandbox-iosxe-recomm-1.cisco.com
gather_facts: false
vars_prompt:
- name: loopback_num
prompt: "What Loopback Number to Configure?"
Expand All @@ -14,13 +14,15 @@
private: no

tasks:

- name: Create loopback {{loopback_num}}
ios_interface:
name: Loopback{{loopback_num}}
enabled: True
description: Created with Ansible
- name: Assign IP to loopback
ios_l3_interface:
name: Loopback{{loopback_num}}
ipv4: "{{loopback_ip}}"
- name: Test
ios_interfaces:
config:
- name: Loopback{{loopback_num}}
enabled: True
description: Created with Ansible
- name: Assign IP to loopback
ios_l3_interfaces:
config:
- name: Loopback{{loopback_num}}
ipv4:
- address: "{{loopback_ip}}"
13 changes: 7 additions & 6 deletions ansible-playbooks/loopback_delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
---
- name: Sample IOS config for Ansible 2.5+
hosts:
- ios-xe-mgmt.cisco.com
- ios-xe-mgmt-latest.cisco.com
gather_facts: no
- sandbox-iosxe-latest-1.cisco.com
- sandbox-iosxe-recomm-1.cisco.com
gather_facts: false
vars_prompt:
- name: loopback_num
prompt: "What Loopback Number to Delete?"
Expand All @@ -13,6 +13,7 @@
tasks:

- name: Delete loopback {{loopback_num}}
ios_interface:
name: Loopback{{loopback_num}}
state: absent
ios_interfaces:
config:
- name: Loopback{{loopback_num}}
state: purged