Technik/Routing/Labornetz/etc/ansible/roles/tinc/tasks/install.yaml

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
---
# Tinc install from staging area

- name: Install find directories in staging area
  find:
    paths: [ "staging/{{ inventory_hostname }}" ]
    file_type: directory 
    recurse: yes
  register: staging_directories
  delegate_to: localhost

- include: install-directory.yaml
  vars:
    _dir: "{{ item.path }}"
    _mode: "{{ item.mode }}"
  with_items: "{{ staging_directories.files | list }}"

- name: Install find files in staging area
  find:
    paths: [ "staging/{{ inventory_hostname }}" ]
    file_type: file 
    recurse: yes
  register: staging_files
  delegate_to: localhost

- name: Install copy files
  copy:
    src: "{{ item.path }}"
    dest: "{{ item.path | replace('staging/' + inventory_hostname, '', 1) }}"
    mode: "{{ item.mode }}"
    #owner: "{{ _tinc_owner }}"
    #group: "{{ _tinc_group }}"
  with_items: "{{ staging_files.files | list }}"
  become: yes