
Role renamed to junos-switch. Python dependencies are installed. Support for multiple configuration types, including 'set', 'text', and 'json'.
27 lines
935 B
YAML
27 lines
935 B
YAML
---
|
|
# NOTE: We are installing this into the system python packages because it does
|
|
# not seem to be possible to use ansible_python_interpreter in combination with
|
|
# delegate_to. This should be investigated in future as modification of system
|
|
# packages via pip is not ideal.
|
|
- name: Ensure python dependencies are installed
|
|
pip:
|
|
name: "{{ item }}"
|
|
delegate_to: "{{ junos_switch_delegate_to }}"
|
|
with_items:
|
|
- junos-eznc
|
|
- jxmlease
|
|
become: True
|
|
|
|
- name: Ensure Juniper switches are configured
|
|
junos_config:
|
|
provider: "{{ junos_switch_provider }}"
|
|
src: "{{ junos_switch_src }}"
|
|
src_format: "{{ junos_switch_config_format }}"
|
|
delegate_to: "{{ junos_switch_delegate_to }}"
|
|
vars:
|
|
junos_switch_config_format_to_src:
|
|
set: junos-config-set.j2
|
|
text: junos-config.j2
|
|
json: junos-config.json.j2
|
|
junos_switch_src: "{{ junos_switch_config_format_to_src[junos_switch_config_format] }}"
|