Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible Netconf warning #421

Open
cardosocristian opened this issue Jun 15, 2023 · 0 comments
Open

Ansible Netconf warning #421

cardosocristian opened this issue Jun 15, 2023 · 0 comments
Assignees

Comments

@cardosocristian
Copy link

SUMMARY

I updated my ansible from version 2.10 to version 2.14 and started receiving warnings when running any module from the collection junipernetworks.junos.junos, I use the connection method ansible.netcommon.netconf configured for all Juniper devices inside the vars/main file .yml

The configuration I'm currently using looks like this:

ansible_connection: ansible.netcommon.netconf
ansible_network_os: junipernetworks.junos.junos
ansible_user: ansible

I use netconf and I connect via SSH on the equipment, I don't know if this actually becomes a problem, but usually when warnings start to occur in some version, in future versions this becomes an error and stops working, so I'm opening this issue.

Here is the warning generated in the executions of the junipernetworks collection in version 2.14

[WARNING]: The "ansible.netcommon.netconf" connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string
ISSUE TYPE
  • Bug Report
COMPONENT NAME

I am using the modules available in the collection junipernetworks.junos.junos

ANSIBLE VERSION
ansible [core 2.14.3]
  config file = /home/ansible/.ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/local/share/py39-ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/local/share/py39-ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.16 (main, Dec 17 2022, 01:13:33) [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a (/usr/local/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
ansible-galaxy collection list junipernetworks.junos.junos

CONFIGURATION
CONFIG_FILE() = /home/ansible/.ansible.cfg
DEFAULT_GATHERING(/home/ansible/.ansible.cfg) = explicit
DEFAULT_HOST_LIST(/home/ansible/.ansible.cfg) = ['/home/ansible/hosts']
DEFAULT_MANAGED_STR(/home/ansible/.ansible.cfg) = Ansible managed
INTERPRETER_PYTHON(/home/ansible/.ansible.cfg) = /usr/local/bin/python3.9
RETRY_FILES_ENABLED(/home/ansible/.ansible.cfg) = False
OS / ENVIRONMENT

Juniper MX and QFX devices running versions 19 and 20

STEPS TO REPRODUCE

When running any task using any module from the collection junipernetworks.junos.junos the warning occurs, example task:

- name: Executando comandos nos QFXs
  junipernetworks.junos.junos_config:
    lines:
    - set interfaces ae9 unit 0 family ethernet-switching vlan members [ VNI885 VNI985 ]
    - set interfaces ae10 unit 0 family ethernet-switching vlan members [ VNI885 VNI985 ]
    comment: Inserindo vlan nos aes dos switches spine via ansible
  tags:
  - lines-exec

EXPECTED RESULTS

The expected result is that the Warning is not displayed
The expected result is that the Warning is not displayed, normally when it starts generating warnings, in future versions it stops working and generates an error.

ACTUAL RESULTS
[ansible@ansible ~]$ ansible-playbook -i hosts prov-qfx.yml --tags lines-exec --limit qfx001 --check -vvvv
ansible-playbook [core 2.14.3]
  config file = /home/ansible/.ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/local/share/py39-ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/local/share/py39-ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.9.16 (main, Dec 17 2022, 01:13:33) [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a (/usr/local/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
Using /home/ansible/.ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /usr/home/ansible/hosts as it did not pass its verify_file() method
script declined parsing /usr/home/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /usr/home/ansible/hosts as it did not pass its verify_file() method
Parsed /usr/home/ansible/hosts inventory source with ini plugin
Loading collection junipernetworks.junos from /home/ansible/.ansible/collections/ansible_collections/junipernetworks/junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_interfaces to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_lag_interfaces to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.9/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: prov-qfx.yml *********************************************************************************************************************************************************************
Positional arguments: prov-qfx.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('lines-exec',)
check: True
inventory: ('/usr/home/ansible/hosts',)
subset: qfx001
forks: 5
1 plays in prov-qfx.yml

PLAY [qfx] *********************************************************************************************************************************************************************************
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
Loading collection ansible.netcommon from /home/ansible/.ansible/collections/ansible_collections/ansible/netcommon

TASK [qfx : Executando comandos nos QFXs] **************************************************************************************************************************************************
task path: /usr/home/ansible/roles/qfx/tasks/main.yml:107
[WARNING]: The "ansible.netcommon.netconf" connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string
<qfx001> attempting to start connection
<qfx001> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /usr/local/bin/ansible-connection
<qfx001> local domain socket does not exist, starting it
<qfx001> control socket path is /usr/home/ansible/.ansible/pc/c2a488dbb7
<qfx001> Loading collection ansible.netcommon from /home/ansible/.ansible/collections/ansible_collections/ansible/netcommon
<qfx001> Loading collection junipernetworks.junos from /home/ansible/.ansible/collections/ansible_collections/junipernetworks/junos
<qfx001> local domain socket listeners started successfully
<qfx001> loaded netconf plugin ansible_collections.junipernetworks.junos.plugins.netconf.junos from path /home/ansible/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/netconf/junos.py for network_os junipernetworks.junos.junos
<qfx001>
<qfx001> local domain socket path is /usr/home/ansible/.ansible/pc/c2a488dbb7
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_config to junipernetworks.junos.junos
<inventory_hostname> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<inventory_hostname> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<qfx001> ESTABLISH LOCAL CONNECTION FOR USER: ansible
<qfx001> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3 `"&& mkdir "` echo /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209 `" && echo ansible-tmp-1686841452.460263-66807-240478801589209="` echo /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209 `" ) && sleep 0'
Using module file /home/ansible/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/modules/junos_config.py
<qfx001> PUT /usr/home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/tmp07fwj1y1 TO /usr/home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209/AnsiballZ_junos_config.py
<qfx001> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209/ /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209/AnsiballZ_junos_config.py && sleep 0'
<qfx001> EXEC /bin/sh -c '/usr/local/bin/python3.9 /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209/AnsiballZ_junos_config.py && sleep 0'
<qfx001> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-local-66804pvx9c1_3/ansible-tmp-1686841452.460263-66807-240478801589209/ > /dev/null 2>&1 && sleep 0'
ok: [qfx001] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "backup": false,
            "backup_options": null,
            "check_commit": false,
            "comment": "Inserindo vlan nos aes dos switches spine via ansible",
            "confirm": 0,
            "confirm_commit": false,
            "lines": [
                "set interfaces ae9 unit 0 family ethernet-switching vlan members [ VNI885 VNI985 ]",
                "set interfaces ae10 unit 0 family ethernet-switching vlan members [ VNI885 VNI985 ]"
            ],
            "provider": null,
            "replace": null,
            "rollback": null,
            "src": null,
            "src_format": null,
            "update": "merge",
            "zeroize": false
        }
    }
}

PLAY RECAP *********************************************************************************************************************************************************************************
qfx001            : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants