ansible-gobgp/tasks/generate_config.yml

16 lines
479 B
YAML

- name: check if vars file is present
local_action: stat path=host_vars/{{inventory_hostname}}.yml
register: vars_exist
become: false
- name: include vars file
include_vars: host_vars/{{inventory_hostname}}.yml
when: vars_exist.stat.exists
- name: generate config
copy:
content: "{{ GOBGP_CONF | to_nice_yaml( width=50, explicit_start=True, explicit_end=True) }}"
dest: /etc/gobgpd/gobgpd.conf
validate: "gobgpd -t yml -f %s -d"
notify: reload gobgpd