Skip to content

juniper_junos_config - wrong filename when retrieving config  #468

@kr3ator

Description

@kr3ator

Issue Type

  • Bug Report
  • Documentation Report

Module Name

juniper_junos_config

Juniper.Junos role and Python libraries version

ansible 2.8.6
  config file = ~/ansible.cfg
  configured module search path = [u'~/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = ~/.local/lib/python2.7/site-packages/ansible
  executable location =~/.local/bin/ansible
  python version = 2.7.15+ (default, Oct  7 2019, 17:39:04) [GCC 7.4.0]

junos-eznc==2.3.0
Juniper.junos==2.2.1

OS / Environment

vMX 19.1

Summary

I want to save configuration files in a set format from my vMX devices. The documentation states that it should be saved to the specified folder under the name of "{{ inventory_hostname }}.format".
But that's not the case, because the files are saved under "{{ ansible_host }}.format" filenames.

Please either correct the documentation or (better) change the variable to use invnetory_hostname.

Steps to reproduce

Use juniper_junos_config module to get configs from hosts where your hosts have a defined ansible_host variable.

  - name: Get Junos config
    juniper_junos_config:
      ssh_config: "{{ playbook_dir }}/ssh_config"
      passwd: "{{ ansible_password }}"
      timeout: 60
      dest_dir: log
      retrieve: committed
      return_output: false
      format: set

Expected results

Config files under log/ directory:
vmx1.set
vmx2.set

Actual results

Config files under log/ directory:
192.168.255.2.set
192.168.255.6.set

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions