-
Notifications
You must be signed in to change notification settings - Fork 55
/
assemble_and_commit.p.yaml
28 lines (27 loc) · 1.02 KB
/
assemble_and_commit.p.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This task merges all the configuration fragments into one file
# In this example it merges the common.conf.part and main.conf.part
# into the junos.conf file.
# If merging the files results in a new file being created then a handler
# is triggered to push the config onto the device. See ./handler/main.yaml
# for more information
- name: Apply configuration
hosts: all
connection: local
gather_facts: no
tasks:
- name: assembling configfurations
assemble: src={{ build_dir }} dest={{ junos_conf }}
# This notify triggers the handler. It looks for a handler with this name
notify:
- Pushing config ... please wait
# This handler (i.e. a task triggered by a notify) uses the
# junos_install_config module to apply the configuration to the device
handlers:
- name: Pushing config ... please wait
junos_template:
host: "{{ inventory_hostname }}"
port: "{{ netconf_port }}"
username: jnpr
password: pass123
src: "{{ junos_conf }}"
action: overwrite