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

Issue with ephemeral configuration database with combination of connection: juniper.device.pyez and user-defined instance-name. #679

Open
chidanandpujar opened this issue Jul 25, 2024 · 0 comments
Assignees

Comments

@chidanandpujar
Copy link
Collaborator

Issue Type

  • Bug Report

Module Name

juniper.device.config

juniper.device collection and Python libraries version

ansible [core 2.17.0]
  config file = /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/ansible_jsnapy_issue/venv/lib/python3.12/site-packages/ansible
  ansible collection location = /root/ansible_jsnapy_issue/ansible-junos-stdlib/ansible_collections
  executable location = /root/ansible_jsnapy_issue/venv/bin/ansible
  python version = 3.12.0 (main, Nov  6 2023, 11:52:14) [GCC 7.5.0] (/root/ansible_jsnapy_issue/venv/bin/python)
  jinja version = 3.1.4
  libyaml = True

ansible==10.0.1
ansible-core==2.17.0
ansible-junos-stdlib==1.0.5
bcrypt==4.1.3
cffi==1.16.0
colorama==0.4.6
configparser==7.0.0
cryptography==42.0.8
future==1.0.0
icdiff==1.9.1
Jinja2==3.1.4
jsnapy==1.3.8.dev0
junos-eznc==2.7.1
jxmlease==1.0.3
lxml==5.2.2
MarkupSafe==2.1.5
ncclient==0.6.15
packaging==24.1
paramiko==3.4.0
pycparser==2.22
PyNaCl==1.5.0
pyparsing==3.1.2
pyserial==3.5
PyYAML==6.0.1
resolvelib==1.0.1
scp==0.15.0
setuptools==70.3.0
six==1.16.0
transitions==0.9.1
xmltodict==0.13.0
yamlordereddictloader==0.4.2


OS / Environment

JUNOS

Summary

Issue with ephemeral configuration database with combination of connection: juniper.device.pyez and user-defined instance-name, it is adding the configuration under default instance instead of user-defined instance eph1

When I run the playbook with the juniper.device.pyez connection with config_mode: "ephemeral" and ephemeral_instance: "eph1", it opens the default instance.

Jul 23 14:35:44 [NETCONF] - [25721] Incoming: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:52e29ee2-2a0c-452f-a329-d3434db65368"></nc:rpc>]]>]]>

When I run the same playbook with local connection, it opens the correct instance.

Jul 23 14:37:06 [NETCONF] - [26473] Incoming: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:1cf9df7b-9508-4626-b146-b029064c597d">eph1</nc:rpc>]]>]]>

Steps to reproduce

---
- name: "Configure ephemeral database"
  hosts: PTX 
  connection: local
#  connection: juniper.device.pyez
  gather_facts: no

  vars_prompt:
    - name: username
      prompt: Junos username
      private: no

    - name: password
      prompt: Junos password
      private: yes

  vars:
    host: "{{ inventory_hostname }}"
    user: "{{ username }}"
    passwd: "{{ password }}"

  tasks:
    - name: "Configure user-defined ephemeral instance"
      juniper.device.config:
        config_mode: "ephemeral"
        ephemeral_instance: "eph1"
        load: "set"
        lines:
          - "set protocols mpls label-switched-path to-hastings2 to 192.0.2.2"

Expected results

 show ephemeral-configuration instance eph1 
## Last changed: 2024-07-25 11:15:06 IST
protocols {
    mpls {
        label-switched-path to-hastings2 {
            to 192.0.2.2;
        }
    }
}

Actual results

show ephemeral-configuration instance default 
## Last changed: 2024-07-25 10:15:05 IST
protocols {
    mpls {
        label-switched-path to-hastings2 {
            to 192.0.2.2;
        }
    }
}

@chidanandpujar chidanandpujar self-assigned this Jul 25, 2024
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

1 participant