Merge pull request #3 from colin-mccarthy/master

🚀️ Added some Cisco IOS demos 🚀
This commit is contained in:
Sean Cavanaugh
2020-05-13 13:04:05 -04:00
committed by GitHub
4 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
---
- hosts: ios
gather_facts: no
vars:
log_servers:
- logging 10.10.10.10
- logging 10.10.10.11
tasks:
- name: "GET CONFIG"
ios_command:
commands:
- show running-config full | include logging [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
register: log
- name: RUN 'Set Logging'
ios_config:
commands: "{{ item }}"
loop: "{{ log_servers }}"
register: set_logging
- debug: var=log.stdout_lines
- name: RUN 'Remove Logging'
ios_config:
commands: "no {{ item }}"
when: "(log.stdout_lines[0][0] != '') and (item not in log_servers)"
loop: "{{ log.stdout_lines[0] }}"
register: remove_logging

View File

@@ -0,0 +1,37 @@
---
- hosts: ios
gather_facts: no
vars:
ntp_servers:
- ntp server 10.10.10.13
- ntp server 10.10.10.14
tasks:
- name: "GET CONFIG"
ios_command:
commands:
- "show running-config full | include ntp server"
register: get_config
- debug: var=get_config.stdout_lines
- name: RUN 'Set NTP'
with_items: "{{ ntp_servers }}"
ios_config:
lines:
- "{{ item }}"
register: set_ntp
- name: RUN 'Remove NTP'
when: "(get_config.stdout_lines[0][0] != '') and (item not in ntp_servers)"
with_items: "{{ get_config.stdout_lines[0] }}"
register: remove_ntp
ios_config:
lines:
- "no {{ item }}"

View File

@@ -0,0 +1,20 @@
---
configlet_logging:
author: "Colin McCarthy"
category: network
name: "Cisco IOS logging config audit/remediation"
description: "Cisco IOS logging config audit/remediation"
job_type: "run"
inventory: "Workshop Inventory"
playbook: configlet_logging.yml
credential: "Workshop Credential"
survey_enabled: false
fact_caching_enabled: true
project:
name: "Ansible official demo project"
description: "prescriptive demos from Red Hat Management Buisness Unit"
organization: "Default"
scm_type: git
scm_url: "https://github.com/ansible/product-demos"
workshop_type:
- network

View File

@@ -0,0 +1,20 @@
---
configlet_ntp:
author: "Colin McCarthy"
category: network
name: "Cisco IOS ntp config audit/remediation"
description: "Cisco IOS ntp config audit/remediation"
job_type: "run"
inventory: "Workshop Inventory"
playbook: configlet_ntp.yml
credential: "Workshop Credential"
survey_enabled: false
fact_caching_enabled: true
project:
name: "Ansible official demo project"
description: "prescriptive demos from Red Hat Management Buisness Unit"
organization: "Default"
scm_type: git
scm_url: "https://github.com/ansible/product-demos"
workshop_type:
- network