Skip to content

Instantly share code, notes, and snippets.

@jeffbrl
Last active March 13, 2017 13:37
Show Gist options
  • Select an option

  • Save jeffbrl/3cdff070308fa34d7ebd to your computer and use it in GitHub Desktop.

Select an option

Save jeffbrl/3cdff070308fa34d7ebd to your computer and use it in GitHub Desktop.
Ansible - Using Juniper.junos junos_get_config module
# This task gets all Junos configuration from all devices
- name: Get configuration
hosts: all
connection: local
gather_facts: no
roles:
- Juniper.junos
vars_prompt:
- name: USER
prompt: Device user
private: no
- name: PASSWORD
prompt: Device password
private: yes
tasks:
- name: Getting config ... please wait
junos_get_config:
host={{ inventory_hostname }}
user={{ USER }}
passwd={{ PASSWORD }}
dest={{ inventory_hostname }}.conf
logfile=/tmp/changes.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment