Need Help! JuniperJunosModule' object has no attribute '_pyez_conn'\n"

172 views
Skip to first unread message

nishant shah

unread,
Dec 16, 2021, 2:21:03 PM12/16/21
to Ansible Project
Hi,

I am working on managing Juniper devices using Ansible. I am trying to add a new user using a playbook-

PLAYBOOK-
---
- name: create new User Name
  hosts: all
  roles:
    - "/root/.ansible/roles/juniper.junos"
  #connection: local
  gather_facts: no
  tasks:
    - name: New user
      juniper.device.config:
        config_mode: "private"
        load: "set"
        src: "/home/ansible-content/username.set"
        diff: true
        check: true
        commit: true
      register: response
    - name: Print the changes
      debug:
        var: response

Ansible Version
 [root@ansiblectrl ansible-content]# ansible --version
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5
20150623 (Red Hat 4.8.5-44)]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
ansible [core 2.11.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
  jinja version = 3.0.3

Error I am getting while running the playbook
PLAY [create new User Name] *****************************************************************************************************************************************************

TASK [New user] *****************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'JuniperJunosModule' object has no attribute '_pyez_conn'
fatal: [vMX]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-local-45180o9494g96/ansible-tmp-1639681653.    8275743-45188-118801523556762/AnsiballZ_config.py\", line 100, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-local-45180o9494g96/ansible-tmp-1639681653    .8275743-45188-118801523556762/AnsiballZ_config.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansibl    e-local-45180o9494g96/ansible-tmp-1639681653.8275743-45188-118801523556762/AnsiballZ_config.py\", line 41, in invoke_module\n    run_name='__main__', alter_sys=True)\n  File \"/    usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96,     in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/    ansible_juniper.device.config_payload_rkavhxwl/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/modules/config.py\", line 1164, in <module>\n      File \"/tmp/ansible_juniper.device.config_payload_rkavhxwl/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/modules/config.py\", line 887,     in main\n  File \"/tmp/ansible_juniper.device.config_payload_rkavhxwl/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_j    unos_common.py\", line 620, in __init__\n  File \"/tmp/ansible_juniper.device.config_payload_rkavhxwl/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/devic    e/plugins/module_utils/juniper_junos_common.py\", line 690, in get_connection\n  File \"/tmp/ansible_juniper.device.config_payload_rkavhxwl/ansible_juniper.device.config_payload    .zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 726, in fail_json\n  File \"/tmp/ansible_juniper.device.config_payload_rkavhxwl/ansi    ble_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py\", line 1172, in close_configuration\nAttributeError: 'Juni    perJunosModule' object has no attribute '_pyez_conn'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

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

Thanks,
Nish

Dick Visser

unread,
Dec 17, 2021, 2:42:07 AM12/17/21
to ansible...@googlegroups.com



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2588c9ca-e841-4b5a-8fff-c1a277056a00n%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages