forked from debops/ansible-tinc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the unsafe_writes parameter instead of prefix_path
- Loading branch information
Showing
5 changed files
with
41 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.. include:: includes/global.rst | ||
.. include:: includes/role.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. _Templating or updating persistent files: https://docs.debops.org/en/latest/ansible/roles/ansible-persistent_paths/docs/guides.html#templating-or-updating-persistent-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
notify: [ 'Reload tinc' ] | ||
|
||
- name: Disable tinc networks in systemd if requested | ||
|
@@ -95,6 +97,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_dict: '{{ tinc__combined_networks }}' | ||
when: item.value.state|d('present') != 'absent' and item.value.tinc_options|d() | ||
notify: [ 'Reload tinc' ] | ||
|
@@ -111,6 +115,8 @@ | |
owner: 'root' | ||
group: '{{ tinc__group }}' | ||
mode: '0750' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_dict: '{{ tinc__combined_networks }}' | ||
when: (item.value.state|d('present') != 'absent' and item.value.generate_tinc_up|d(True)|bool) | ||
|
||
|
@@ -121,6 +127,8 @@ | |
owner: 'root' | ||
group: '{{ tinc__group }}' | ||
mode: '0750' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_dict: '{{ tinc__combined_networks }}' | ||
when: (item.value.state|d('present') != 'absent' and item.value.generate_tinc_up|d(True)|bool) | ||
|
||
|
@@ -131,6 +139,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
|
||
# RSA key management [[[1 | ||
|
||
|
@@ -141,6 +151,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
|
||
- name: Initialize RSA key pairs | ||
shell: yes | tincd -n {{ item.value.name | d(item.key) }} -K {{ item.value.rsa_key_length | d(tinc__rsa_key_length) }} | ||
|
@@ -165,6 +177,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0640' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_dict: '{{ tinc__combined_networks }}' | ||
when: item.value.state|d('present') != 'absent' | ||
|
||
|
@@ -243,6 +257,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_dict: '{{ tinc__combined_networks }}' | ||
when: tinc__systemd|bool and item.value.state|d('present') != 'absent' | ||
notify: [ 'Reload tinc' ] | ||
|
@@ -254,6 +270,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0755' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
when: tinc__systemd | bool | ||
|
||
- name: Clean up old systemd configuration | ||
|
@@ -264,10 +282,12 @@ | |
- name: Configure systemd unit files | ||
template: | ||
src: 'etc/systemd/system/{{ item }}.j2' | ||
dest: '{{ tinc__persistent_prefix_path + "/" + item }}' | ||
dest: '/etc/systemd/system/{{ item }}' | ||
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
with_items: [ 'tinc.service', '[email protected]' ] | ||
register: tinc__register_systemd | ||
when: tinc__systemd | bool | ||
|
@@ -293,11 +313,6 @@ | |
|
||
# Ansible facts [[[1 | ||
|
||
# Note that for ``debops.persistent_paths`` on Qubes OS to work correctly, the | ||
# facts need to be generated at the end of the (first) role playbook run. Note | ||
# this if it might be necessary to move this to a separate env role. Not sure | ||
# yet how this could be handled to cover both cases. | ||
|
||
- name: Make sure Ansible fact directory exists | ||
file: | ||
path: '/etc/ansible/facts.d' | ||
|
@@ -313,6 +328,8 @@ | |
owner: 'root' | ||
group: 'root' | ||
mode: '0644' | ||
unsafe_writes: '{{ True if (core__unsafe_writes|d(True if (ansible_local|d() and ansible_local.core|d() | ||
and ansible_local.core.unsafe_writes|d() | bool) else False) | bool) else omit }}' | ||
register: tinc__register_facts | ||
|
||
- name: Reload facts if they were modified | ||
|