Closed Involar closed 3 years ago
@Involar Thanks for reporting. @rsmekala Can you please check this?
A workaround that I found is to "gather_facts" and then use the presented ansible_env var as an argument for user/passwd variables. I have a feeling this is a bug in Ansible, rather than in the role.
provider:
host: "{{ ansible_host }}"
timeout: 180
user: "{{ ansible_env.ANSIBLE_NET_USERNAME}}"
passwd: "{{ ansible_env.ANSIBLE_NET_PASSWORD}}"
based on the discussion, marking this as inactive.
Issue Type
Module Name
juniper_junos_config
OS / Environment
Ansible server: CentOS release 6.9 Junos: 15.1F6-S7.2 Device: mx480
Summary
Steps to reproduce
The juniper.junos role does not recognize environment variables set within a playbook. You can't set a username or password from a playbook to be used for authentication.
Expected results
Actual results
The variable user is unchanged. According to the priority list for user it picks the Environmental variable USER which is set to the user running the playbook.
I have tested this with a simple task using shell: echo $ANSIBLE_NET_USERNAME and it returns the correct value which i'm providing inside my environment file.