summaryrefslogtreecommitdiff
path: root/roles/tinc/tasks/tinc.yml
blob: 74538118f0cac86f3908f52ad6eed9d4e2f3e162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- 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: '0640'
  tags:
    - tconfig
  notify: configure tinc
- name: Install tinc-up template
  template:
    src: tinc-up.j2
    dest: /etc/tinc/tn_int/tinc-up
    mode: '0740'
  notify: configure tinc
  tags:
    - tconfig
- name: Copy remaining files
  ansible.posix.synchronize:
    src: tn_int/
    dest: /etc/tinc/tn_int/
    archive: false
    recursive: true
    times: true
  notify: configure tinc
- name: Make scripts executable
  file:
    path: "/etc/tinc/tn_int/{{ item }}"
    mode: "0740"
  with_items:
    - tinc-down
  tags:
    - exec
- name: Ensure tinc is enabled
  service:
    name: "tinc@{{ tinc_netname }}"
    daemon_reload: true
    enabled: true
  when: ansible_os_family != "OpenWrt"