Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- # =========================================================
- # Setup variables and directories
- # =========================================================
- - name: Creating build directories for each host
- hosts: all
- connection: local
- gather_facts: no
- tasks:
- - set_fact:
- build_dir: "{{ build_dir }}/{{ inventory_hostname }}/tmp"
- junos_conf: "{{ build_dir }}/{{ inventory_hostname }}/conf"
- - name: remove host build temp directory
- file: path={{ build_dir }} state=absent
- - name: create host build temp directory
- file: path={{ build_dir }} state=directory mode=0775
- # =========================================================
- # Role based config template building
- # =========================================================
- - name: Build Juniper BASE config
- hosts: all
- connection: local
- gather_facts: no
- roles:
- - jnpr-base
- # =========================================================
- # Role based config template building
- # =========================================================
- - name: Build Juniper CUSTOM config
- hosts: all
- connection: local
- gather_facts: no
- roles:
- - jnpr-custom
- # =========================================================
- # Finish by assembling config snippets into single file
- # =========================================================
- - name: Creating final junos.conf
- hosts: all
- connection: local
- gather_facts: no
- tasks:
- - name: assembling configfurations
- assemble: src={{ build_dir }} dest={{ junos_conf }} mode=0664
Advertisement
Add Comment
Please, Sign In to add comment