From 8732cc471b9e79a40a5507fea40f5394d2755cf4 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 19 Jan 2020 13:41:09 +0100 Subject: [PATCH] migration pi2 to oscar --- defaults/main.yaml | 2 +- tasks/main.yaml | 15 +++++++++++++++ templates/systemd/override.j2 | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 templates/systemd/override.j2 diff --git a/defaults/main.yaml b/defaults/main.yaml index 4cf2114..310da6a 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -37,7 +37,7 @@ radicale_config: storage: type: multifilesystem filesystem_folder: "{{ radicale_server_home_dir }}/collections" - filesystem_locking: true + filesystem_locking: false filesystem_fsync: true # For an example of the `hook` directive in use, see # http://radicale.org/versioning/ diff --git a/tasks/main.yaml b/tasks/main.yaml index 0366ae1..be656d0 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -52,9 +52,24 @@ state: "{{ item.state | default('present') }}" loop: "{{ radicale_users }}" +- name: create custom systemd folder + file: + path: /etc/systemd/system/radicale.service.d/ # required. Path to the file being managed. + state: directory # not required. choices: absent;directory;file;hard;link;touch. If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions. If C(file), the file will NOT be created if it does not exist; see the C(touch) value or the M(copy) or M(template) module if you want that behavior. If C(link), the symbolic link will be created or changed. Use C(hard) for hardlinks. If C(absent), directories will be recursively deleted, and files or symlinks will be unlinked. Note that C(absent) will not cause C(file) to fail if the C(path) does not exist as the state did not change. If C(touch) (new in 1.4), an empty file will be created if the C(path) does not exist, while an existing file or directory will receive updated file access and modification times (similar to the way `touch` works from the command line). + + +- name: apply override file for systemd + template: + dest: /etc/systemd/system/radicale.service.d/override.conf # required. Location to render the template to on the remote machine. + src: systemd/override.j2 # required. Path of a Jinja2 formatted template on the Ansible controller. This can be a relative or absolute path. + notify: + - Restart Radicale. + + - name: Start and enable Radicale service. service: name: radicale state: "{{ radicale_service_state }}" enabled: true + diff --git a/templates/systemd/override.j2 b/templates/systemd/override.j2 new file mode 100644 index 0000000..82e39b0 --- /dev/null +++ b/templates/systemd/override.j2 @@ -0,0 +1,3 @@ +[Service] +ExecStartPre=/bin/sleep 30 +ReadWritePaths= {{ radicale_server_home_dir}} \ No newline at end of file