summaryrefslogtreecommitdiff
path: root/roles/tinc/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/tinc/tasks')
-rw-r--r--roles/tinc/tasks/main.yml12
-rw-r--r--roles/tinc/tasks/tinc.yml35
2 files changed, 47 insertions, 0 deletions
diff --git a/roles/tinc/tasks/main.yml b/roles/tinc/tasks/main.yml
new file mode 100644
index 0000000..4cfc7cd
--- /dev/null
+++ b/roles/tinc/tasks/main.yml
@@ -0,0 +1,12 @@
+---
+- name: Install routing software
+ package:
+ name:
+ - tinc
+ state: present
+- name: Include tinc tasks
+ import_tasks: tinc.yml
+ when:
+ - tinc is defined
+ - tinc.configure is defined
+ - tinc.configure
diff --git a/roles/tinc/tasks/tinc.yml b/roles/tinc/tasks/tinc.yml
new file mode 100644
index 0000000..2673a59
--- /dev/null
+++ b/roles/tinc/tasks/tinc.yml
@@ -0,0 +1,35 @@
+---
+- name: Ensure tinc directory exists
+ ansible.builtin.file:
+ path: '/etc/tinc/tn_int/'
+ state: directory
+ mode: '0750'
+- name: Install tinc.conf template
+ template:
+ src: tinc.conf.j2
+ dest: /etc/tinc/tn_int/tinc.conf
+ mode: '0750'
+ tags:
+ - tconfig
+- name: Install tinc-up template
+ template:
+ src: tinc-up.j2
+ dest: /etc/tinc/tn_int/tinc-up
+ mode: '0740'
+ tags:
+ - tconfig
+- name: Copy remaining files
+ ansible.posix.synchronize:
+ src: tn_int/
+ dest: /etc/tinc/tn_int/
+ archive: false
+ recursive: true
+ times: true
+- name: Make scripts executable
+ file:
+ path: "/etc/tinc/tn_int/{{ item }}"
+ mode: "0740"
+ with_items:
+ - tinc-down
+ tags:
+ - exec