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
ansible-playbook 2.5.0 | |
config file = /Users/hapresto/coding/netdevops_demos/ansible_02/ansible.cfg | |
configured module search path = ['/Users/hapresto/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] | |
ansible python module location = /Users/hapresto/coding/netdevops_demos/ansible_02/v2_5/lib/python3.6/site-packages/ansible | |
executable location = /Users/hapresto/coding/netdevops_demos/ansible_02/v2_5/bin/ansible-playbook | |
python version = 3.6.5 (default, Apr 1 2018, 09:50:04) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] | |
Using /Users/hapresto/coding/netdevops_demos/ansible_02/ansible.cfg as config file | |
setting up inventory plugins | |
Parsed /Users/hapresto/coding/netdevops_demos/ansible_02/default_inventory.yaml inventory source with yaml plugin | |
Loading callback plugin default of type stdout, v2.0 from /Users/hapresto/coding/netdevops_demos/ansible_02/v2_5/lib/python3.6/site-packages/ansible/plugins/callback/default.py |
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
# Simple function to create a wildcard mask from a subnet mask | |
def wildcard_mask(netmask): | |
# Ensure netmask provided is a basic string (ie not an IPv4Address) | |
netmask = str(netmask) | |
# Break into a list of octets as integers | |
netmask_list = map(int, netmask.split(".")) | |
# Use XOR to "invert" each octect | |
wildcard_list = [ 255^octet for octet in netmask_list ] | |
# Join wildcard octets into a single wildcard mask string |
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
# command to run ansible-playbook -i inventory.yml ansible_config.yaml | |
--- | |
- hosts: sandbox-iosxe-latest | |
gather_facts: false | |
connection: network_cli | |
tasks: | |
- name: facts | |
ios_facts: | |
gather_subset: all |