This file contains hidden or 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
$ git diff lib/ansible/plugins/connection/network_cli.py | |
diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py | |
index c07e6f7..66411d0 100644 | |
--- a/lib/ansible/plugins/connection/network_cli.py | |
+++ b/lib/ansible/plugins/connection/network_cli.py | |
@@ -266,7 +266,10 @@ class Connection(ConnectionBase): | |
messages = ['updating play_context for connection'] | |
if self._play_context.become is False and play_context.become is True: | |
auth_pass = play_context.become_pass | |
+ display.display("-- update_play_context -> auth_pass: %s" % auth_pass, log_only=True) |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# (c) 2018, Ansible by Red Hat, inc | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
from __future__ import absolute_import, division, print_function | |
__metaclass__ = type | |
This file contains hidden or 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
--- | |
- debug: | |
msg: "{{ config }}" | |
- name: validate the variant variable | |
fail: | |
msg: "missing required fact: variant" | |
when: variant is undefined | |
- name: Validate interfaces config in openconfig format |
This file contains hidden or 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
--- | |
config: | |
interfaces: | |
- interface: | |
config: | |
name: GigabitEthernet0/1 | |
description: configured interface-1 by opnconfig_interfaces | |
enabled: True | |
- interface: | |
config: |
This file contains hidden or 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
import re | |
ansi_re = [ | |
# see ECMA-48 Section 5.4 (Control Sequences) | |
re.compile(br'((?:\x9b|\x1b\x5b)[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e])'), | |
re.compile(br'\x08.') | |
] | |
terminal_stdout_re = [ | |
re.compile(br"[\r\n]?[\w]*\(.+\) ?#(?:\s*)(.*)$"), |
This file contains hidden or 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
$ git diff | |
diff --git a/bin/ansible-connection b/bin/ansible-connection | |
index ed6070b..57fd128 100755 | |
--- a/bin/ansible-connection | |
+++ b/bin/ansible-connection | |
@@ -161,7 +161,7 @@ def main(): | |
result = {} | |
messages = list() | |
socket_path = None | |
- |
This file contains hidden or 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
{ | |
"msg": { | |
"config_schema": { | |
"interfaces": { | |
"interface": { | |
"config": [ | |
{ | |
"description": null, | |
"enabled": true, | |
"loopback_mode": false, |
This file contains hidden or 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
There are multiple moving parts in this code flow. | |
To start with network_cli connection plugin is applicable for network platforms that support persistent | |
connection with the remote host across task. | |
The method called on connection object (connection.edit_config) is serialised in json string as per jsonrpc 2.0 spec [0] | |
and is send over to socket [1]. The receiving end of the socket is a daemon process called "ansible-connection" | |
which is spawned from task_executor [2] at the time of connection creation to the remote host. | |
"ansible-connection" receives the json string and calls handle_request method [3] on the object of JsonRpcServer class |
This file contains hidden or 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
module openconfig-interfaces { | |
yang-version "1"; | |
// namespace | |
namespace "http://openconfig.net/yang/interfaces"; | |
prefix "ocif"; | |
// import some basic types |
This file contains hidden or 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-test network-integration --inventory ~/targets/inventory.network eos_config -vvvvve | |
>>> Environment Description | |
{} | |
Running eos_config integration test role | |
>>> Playbook: eos_config-l5XX7M.yml | |
- hosts: eos | |
gather_facts: False | |
roles: | |
- { role: eos_config } | |
Run command: ansible-playbook eos_config-l5XX7M.yml -i /Users/gnalawad/targets/inventory.network -e @integration_config.yml -vvvvv |
OlderNewer