add systemd unit override gitea

This commit is contained in:
vincent 2019-04-23 19:16:51 +02:00
parent af511aeaa1
commit 77eb289257
2 changed files with 15 additions and 0 deletions

View File

@ -42,6 +42,19 @@
notify: "Restart gitea" notify: "Restart gitea"
become: yes become: yes
- name: create custom systemd folder
file:
path: /etc/systemd/system/gitea.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).
become: yes
- name: apply override file for systemd
template:
dest: /etc/systemd/system/gitea.service.d/override.conf # required. Location to render the template to on the remote machine.
src: override.j2 # required. Path of a Jinja2 formatted template on the Ansible controller. This can be a relative or absolute path.
notify: "Restart gitea"
become: yes
- name: "Service gitea" - name: "Service gitea"
service: service:
name: gitea name: gitea

2
templates/override.j2 Normal file
View File

@ -0,0 +1,2 @@
[Service]
ReadWritePaths= {{ gitea_home }}