Skip to content

Instantly share code, notes, and snippets.

# This play is an ansibe-pull substitute, will prompt for options or can bypass by passing as extra vars
- name: ansible-pull
hosts: localhost
gather_subset: min
vars:
now: >-
{{ lookup('pipe', 'date +"%F %T"') }}
vars_prompt:
- name: repo_url
prompt: URL of the playbook repository
from ansible.plugins.action import ActionBase
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
return {'failed': False}
all:
children:
application:
hosts:
awsfrcqaapp02:
ansible_host: IP-X
awsfrcqaapp03:
ansible_host: IP-Y
database:
hosts:
- task:
remote_user: '{{item}}_admin'
loop:
- jeremy
- '{{ansible_user}}'
vars:
ansible_user: '{{ansible_user}}_admin'
- hosts: all
vars:
r_std: '{{regvar.get('stdout')|default('')}}'
tasks:
- command: ....
register: regvar
- assert:
that:
ansible.netcommon.cisco_ios_config netconf device configuration
ansible.netcommon.cisco_ios_netconf_get Fetch configuration/state data from NETCONF enabled network devices
apt Manages apt-packages
apt_key Add or remove an apt key
apt_repository Add and remove APT repositories
assemble Assemble configuration files from fragments
assert
---
- hosts: all
gather_facts: yes
roles:
- usersettings
- role: git
vars:
git_install_from_source: true
git_install_path: "/usr"
git_version: "2.26.2"
{
"ansible.netcommon.cli_config": {
"doc": {
"author": "Trishna Guha (@trishnaguha)",
"description": [
"This module provides platform agnostic way of pushing text based configuration to network devices over network_cli connection plugin."
],
"filename": "/home/bcoca/tmp/collections/ansible_collections/ansible/netcommon/plugins/modules/cli_config.py",
"module": "cli_config",
"notes": [
{
"add_host": "Add a host (and alternatively a group) to the ansible-playbook in-memory inventory",
"alikins.collection_inspect.collection_inspect": "UNDOCUMENTED",
"alikins.collection_inspect.collection_inspect_no_module_utils": "UNDOCUMENTED",
"alikins.collection_inspect.get_collection_inspect": "UNDOCUMENTED",
"ansible.netcommon.cli_command": "Run a cli command on cli-based network devices",
"ansible.netcommon.cli_config": "Push text based configuration to network devices over network_cli",
"ansible.netcommon.net_banner": "Manage multiline banners on network devices",
0.08 KB
- hosts: targethost
gather_facts: false
tasks:
- name: Run uptime command
command: uptime
register: output