Introduce boolean var 'debug_fastd' and tag debug

If debug_fastd to 'True' log level is set to debug on all fastd instances.

Run the playbook with tag 'debug' to invoke only tasks changing debug settings.
This commit is contained in:
Tobias Hachmer 2018-11-07 15:20:18 +01:00
parent 55591b3146
commit 8f8184f4cf
No known key found for this signature in database
GPG key ID: E112788464CA5C60
5 changed files with 12 additions and 0 deletions

View file

@ -1,4 +1,6 @@
--- ---
debug_fastd: False
as_private_mwu: 65037 as_private_mwu: 65037
as_public_ffrl: 201701 as_public_ffrl: 201701

View file

@ -32,6 +32,7 @@
dest: "/etc/fastd/{{ item.0.id }}igvpn-{{ item.1.mtu }}/fastd.conf" dest: "/etc/fastd/{{ item.0.id }}igvpn-{{ item.1.mtu }}/fastd.conf"
notify: restart fastd backbone instances notify: restart fastd backbone instances
loop: "{{ meshes | subelements('fastd.backbone.instances') }}" loop: "{{ meshes | subelements('fastd.backbone.instances') }}"
tags: debug
- name: write fastd backbone secret - name: write fastd backbone secret
template: template:

View file

@ -1,7 +1,11 @@
# #
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% if debug_fastd %}
log level debug;
{% else %}
log level warn; log level warn;
{% endif %}
hide ip addresses yes; hide ip addresses yes;
hide mac addresses yes; hide mac addresses yes;

View file

@ -52,6 +52,7 @@
dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/fastd.conf" dest: "/etc/fastd/{{ item.0.id }}vpn-{{ item.1.mtu }}/fastd.conf"
notify: restart fastd mesh instances notify: restart fastd mesh instances
loop: "{{ meshes | subelements('fastd.nodes.instances') }}" loop: "{{ meshes | subelements('fastd.nodes.instances') }}"
tags: debug
- name: write fastd mesh secret - name: write fastd mesh secret
template: template:

View file

@ -1,7 +1,11 @@
# #
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% if debug_fastd %}
log level debug;
{% else %}
log level warn; log level warn;
{% endif %}
hide ip addresses yes; hide ip addresses yes;
hide mac addresses yes; hide mac addresses yes;