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
[student1@ansible ~]$ cat ~/networking-workshop/lab_inventory/hosts | |
[all:vars] | |
ansible_port=22 | |
[routers:children] | |
cisco | |
juniper | |
[routers:vars] | |
ansible_ssh_private_key_file=/home/student1/.ssh/aws-private.pem |
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
{ | |
"name": "Simple Survey", | |
"description": "Description of the simple survey", | |
"spec": [ | |
{ | |
"type": "multiplechoice", | |
"question_name": "example question", | |
"question_description": "Rollback to which date?", | |
"variable": "rollback_date", | |
"choices": [ |
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
Identity added: /tmp/awx_204_NHjMgN/credential_2 (/tmp/awx_204_NHjMgN/credential_2) | |
PLAY [BACKUP ROUTER CONFIGURATIONS] ******************************************** | |
TASK [LOAD L3 INTERFACE] ******************************************************* | |
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
[leafs] | |
leaf01 ansible_host=10.16.10.11 | |
leaf02 ansible_host=10.16.10.12 | |
[spines] | |
spine01 ansible_host=10.16.10.13 | |
spine02 ansible_host=10.16.10.14 | |
[network:children] | |
leafs |
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
--- | |
- name: GRAB F5 FACTS | |
hosts: f5 | |
connection: local | |
gather_facts: no | |
tasks: | |
- name: COLLECT BIG-IP FACTS | |
bigip_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
--- | |
- name: AWS PLAYBOOK 101 | |
connection: local | |
hosts: localhost | |
gather_facts: false | |
# The paramater region will be set for all ec2 modules by specifying it here under module_defaults | |
module_defaults: | |
group/aws: | |
region: us-west-2 | |
vars: |
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
- name: TOWER CONFIGURATION IN PLAYBOOK FORM | |
hosts: localhost | |
connection: local | |
gather_facts: no | |
tasks: | |
- name: CREATE INVENTORY | |
tower_inventory: | |
name: "LINKLIGHT_TEST_INVENTORY" | |
organization: Default | |
tower_config_file: "~/tower_cli.cfg" |
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
[student1@ansible networking-workshop]$ cat junos_example.yml | |
--- | |
- name: gather information from routers | |
hosts: juniper | |
gather_facts: no | |
tasks: | |
- name: gather router facts | |
vars: |
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
[student1@ansible ~]$ ansible -m cli_command -a "command='show ip int br'" rtr3 | |
rtr3 | SUCCESS => { | |
"ansible_facts": { | |
"discovered_interpreter_python": "/usr/bin/python" | |
}, | |
"changed": false, | |
"stdout": "Interface IP-Address OK? Method Status Protocol\nGigabitEthernet1 172.16.168.217 YES DHCP up up \nLoopback0 192.168.3.103 YES manual up up \nLoopback1 10.3.3.103 YES manual up up \nTunnel0 10.100.100.2 YES manual up up \nVirtualPortGroup0 192.168.35.101 YES TFTP up up", | |
"stdout_lines": [ | |
"Interface IP-Address OK? Method Status Protocol", | |
"GigabitEthernet1 172.16.168.217 YES DHCP up up ", |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 15 columns, instead of 3. in line 5.
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
id,created,uuid,parent_uuid,event,task_action,failed,changed,playbook,play,task,role,job_id,host_id,host_name | |
882497,2019-11-25 18:02:23.08498+00,14b9eac4-56db-4991-8b43-b35332659195,"",playbook_on_start,,f,f,azure_facts_demo.yaml,"","","",36019,,"" | |
882498,2019-11-25 18:02:23.139071+00,0ad19a72-8eec-3dc1-41eb-000000000006,14b9eac4-56db-4991-8b43-b35332659195,playbook_on_play_start,,f,f,azure_facts_demo.yaml,HELLO WORLD FOR AZURE,"","",36019,,"" | |
882499,2019-11-25 18:02:23.163426+00,0ad19a72-8eec-3dc1-41eb-000000000008,0ad19a72-8eec-3dc1-41eb-000000000006,playbook_on_task_start,"""azure_rm_resource_facts""",f,f,azure_facts_demo.yaml,HELLO WORLD FOR AZURE,GATHER FACTS FOR THE AZURE RESOURCE GROUP,"",36019,,"" | |
882500,2019-11-25 18:02:23.164897+00,1d8bba0d-a1bc-4772-b3f6-501453a9560f,0ad19a72-8eec-3dc1-41eb-000000000008,runner_on_start,"""azure_rm_resource_facts""",f,f,azure_facts_demo.yaml,HELLO WORLD FOR AZURE,GATHER FACTS FOR THE AZURE RESOURCE GROUP,"",36019,8367,localhost | |
882501,2019-11-25 18:02:23.164122+00, |