Skip to content

Instantly share code, notes, and snippets.

@jeffbrl
Last active June 2, 2017 13:23
Show Gist options
  • Select an option

  • Save jeffbrl/57ef044eafc1b6367746 to your computer and use it in GitHub Desktop.

Select an option

Save jeffbrl/57ef044eafc1b6367746 to your computer and use it in GitHub Desktop.
Ansible - Using Juniper.junos junos_install_config module
# This task pushes Junos config files to 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: Pushing configs...
junos_install_config:
host={{ inventory_hostname }}
user={{ USER }}
port=22
passwd={{ PASSWORD }}
file=configs/{{ inventory_hostname }}.conf
overwrite=yes
logfile=/tmp/changes.log
comment="commited by ansible"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment