From 2b2d2627e345ad2829184c009ad4ed827d39124f Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sun, 20 Aug 2023 12:05:53 +0200 Subject: Add ansible tinc config --- roles/router/tasks/main.yml | 6 ++++++ roles/router/tasks/tinc.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 roles/router/tasks/tinc.yml (limited to 'roles/router/tasks') diff --git a/roles/router/tasks/main.yml b/roles/router/tasks/main.yml index 286dda9..e8c4843 100644 --- a/roles/router/tasks/main.yml +++ b/roles/router/tasks/main.yml @@ -7,3 +7,9 @@ - iperf3 - mtr-tiny state: present +- name: Include tinc tasks + import_tasks: tinc.yml + when: + - tinc is defined + - tinc.configure is defined + - tinc.configure diff --git a/roles/router/tasks/tinc.yml b/roles/router/tasks/tinc.yml new file mode 100644 index 0000000..ee16b0a --- /dev/null +++ b/roles/router/tasks/tinc.yml @@ -0,0 +1,29 @@ +- name: Ensure tinc directory exists + ansible.builtin.file: + path: '/etc/tinc/tn_int/' + state: directory +- name: Install tinc.conf template + template: + src: tinc.conf.j2 + dest: /etc/tinc/tn_int/tinc.conf + tags: + - tconfig +- name: Install tinc-up template + template: + src: tinc-up.j2 + dest: /etc/tinc/tn_int/tinc-up + tags: + - tconfig +- name: Copy remaining files + ansible.builtin.copy: + src: tn_int/ + dest: /etc/tinc/tn_int/ +- name: Make scripts executable + file: + path: "/etc/tinc/tn_int/{{ item }}" + mode: "0740" + with_items: + - tinc-up + - tinc-down + tags: + - exec -- cgit v1.2.3