ansibleansible-rolejuniperjunos-automation

What is the junos_install_config replacement module?


When using the junos_instal_config module from the Juniper.junos role for ansible in a playbook such as:

---
- name: Send Set Files to Different Devices
  hosts: all
  roles:
    - Juniper.junos
  connection: local
  gather_facts: no

  tasks:
    - name: " Install vMX1 File"
      junos_install_config:
              host = " {{ inventory_hostname }}"
              file = " /home/ubuntu/resources/vMX1.set"
              overwrite = false

Running the playbook returns the following deprecation warning:

[DEPRECATION WARNING]: junos_install_config is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be
removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

However reading documentation about the module I cant seem to find what has superseded it. Could anyone let me know which module can now be used in later versions to send and install ".set" files to a Junos Device?


Solution

  • You could try juniper_junos_config module to push or retrieve configuration.

      tasks:
        - name: Load configuration from a local file and commit
          juniper_junos_config:
            load: "merge"
            src: "build_conf/{{ inventory_hostname }}/junos.conf"
    

    Take a look at the documentation for more details. https://www.juniper.net/documentation/en_US/junos-ansible/topics/topic-map/junos-ansible-configuration-loading-committing.html#task-configuration-load-file