Skip to content

Instantly share code, notes, and snippets.

View NilashishC's full-sized avatar
🎯
Focusing

Nilashish Chakraborty NilashishC

🎯
Focusing
View GitHub Profile
---
- name: Instruqt AAP Setup
hosts: localhost
become: false
gather_facts: false
collections:
- ansible.controller
vars:
Playbook:
=============
---
- hosts: nxos
gather_facts: true
gather_subset: interfaces
tasks:
- name: Gather interface resource facts
cisco.nxos.nxos_facts:
gather_network_resources: interfaces
Playbook:
=============
---
- hosts: nxos
gather_facts: True
gather_subset: interfaces
module_defaults:
cisco.nxos.nxos_facts:
gather_network_resources: interfaces
.. _nxos_platform_options:
***************************************
NXOS Platform Options
***************************************
The `Cisco NXOS <https://galaxy.ansible.com/ui/repo/published/cisco/nxos>`_ supports multiple connections. This page offers details on how each connection works in Ansible and how to use it.
.. contents::
:local:
# Using overridden
--------------------
Before config:
-----------------
interface fc1/1
switchport description INTF-1
switchport speed 1000
interface fc1/2
switchport description INTF-2
from typing import TypedDict, Unpack, assert_type
class CustomType(TypedDict):
"""test."""
collection: dict[str, str]
name: str
plugin_type: str
docstring: str
05-29T08:08:23.783033+00:00 DEBUG 'ansible_navigator.actions.back.run' Stepping back in images from images to image_menu
2023-05-29T08:08:24.141869+00:00 DEBUG 'ansible_navigator.actions.back.run' back requested
2023-05-29T08:08:24.142658+00:00 DEBUG 'ansible_navigator.actions.back.run' Stepping back in images from image_menu to images
2023-05-29T08:08:24.541434+00:00 DEBUG 'ansible_navigator.actions.back.run' back requested
2023-05-29T08:08:24.542123+00:00 DEBUG 'ansible_navigator.actions.back.run' Return to images, at last step
2023-05-29T08:08:24.568157+00:00 DEBUG 'ansible_navigator.runner.base.__del__' delete temporary ansible-runner private_data_dir at path /tmp/ansible-navigator_fuicp8b3
(navigator) ➜ ~ rm -rf logs
(navigator) ➜ ~ cat logs/ansible-navigator.log
cat: logs/ansible-navigator.log: No such file or directory
(navigator) ➜ ~ ansible-navigator images
2023-05-22 19:00:03,530 - ansible_rulebook.app - INFO - Starting sources
2023-05-22 19:00:03,530 - ansible_rulebook.app - INFO - Starting rules
2023-05-22 19:00:03,530 - ansible_rulebook.engine - INFO - run_ruleset
2023-05-22 19:00:03,530 - drools.ruleset - INFO - Using jar: /home/nchakrab/.virtualenvs/core/lib/python3.9/site-packages/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.1-SNAPSHOT.jar
2023-05-22 19:00:03 974 [main] INFO org.drools.ansible.rulebook.integration.api.rulesengine.AbstractRulesEvaluator - Start automatic pseudo clock with a tick every 100 milliseconds
2023-05-22 19:00:03 985 [main] INFO org.drools.ansible.rulebook.integration.api.rulesengine.AbstractRulesEvaluator - Start automatic pseudo clock with a tick every 100 milliseconds
2023-05-22 19:00:03,985 - ansible_rulebook.engine - INFO - ruleset define: {"name": "Ruleset-1", "hosts": ["localhost"], "sources": [{"EventSource": {"name": "range", "source_name": "ansible.eda.range", "source_args": {"limit": 5}, "source_filters":
---
- name: Report incident to ServiceNow
hosts: clus-mdt-leaf1
sources:
- ansible.eda.kafka:
host: 172.22.225.11
topic: eda
port: 9092
rules:
- name: Check route count
---
- hosts: nxos
gather_facts: false
tasks:
- ansible.builtin.debug:
msg: "### start gathering information to report detected event ###"
- name: "Gather NX-OS version information from affected host"
cisco.nxos.nxos_command:
commands: show version