Skip to content

Commit

Permalink
Merge pull request #145 from roles-ansible/systemd
Browse files Browse the repository at this point in the history
Create systemd unit for all systems
  • Loading branch information
DO1JLR authored Jan 24, 2024
2 parents bf5d20d + dba4c60 commit 7857a62
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Ansible Galaxy](https://ansible.l3d.space/svg/l3d.gitea.svg)](https://galaxy.ansible.com/ui/standalone/roles/l3d/gitea/)
[![Ansible Galaxy](https://ansible.l3d.space/svg/l3d.gitea.svg)](https://galaxy.ansible.com/ui/standalone/roles/roles-ansible/gitea/)
[![BSD-3 Clause](https://ansible.l3d.space/svg/l3d.gitea_license.svg)](LICENSE)
[![Maintainance](https://ansible.l3d.space/svg/l3d.gitea_maintainance.svg)](https://ansible.l3d.space/#l3d.gitea)

Expand Down
16 changes: 1 addition & 15 deletions tasks/install_systemd.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
---
- name: "Setup systemd service"
become: true
when: ansible_os_family == "Debian"
ansible.builtin.template:
src: gitea.service.j2
dest: /lib/systemd/system/gitea.service
owner: root
group: root
mode: 0644
notify:
- "Reload systemd"
- "Restart gitea"

- name: "Setup systemd service"
become: true
when: ansible_os_family == "Suse"
ansible.builtin.template:
src: gitea.service.j2
dest: /etc/systemd/system/gitea.service
dest: "{{ gitea_systemd_path }}/gitea.service"
owner: root
group: root
mode: 0644
Expand Down
2 changes: 2 additions & 0 deletions vars/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ gitea_dependencies:
- git
- gnupg2
- xz-utils

gitea_systemd_path: '/lib/systemd/system'
3 changes: 2 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gitea_variables:
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
- 'os_fallback_defaults.yml'
paths:
- 'vars'

Expand Down Expand Up @@ -62,5 +63,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'

playbook_version_number: 55
playbook_version_number: 56
playbook_version_path: 'do1jlr.gitea.version'
7 changes: 7 additions & 0 deletions vars/os_fallback_defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
gitea_dependencies:
- git
- gnupg2
- xz-utils

gitea_systemd_path: '/lib/systemd/system'
2 changes: 2 additions & 0 deletions vars/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ gitea_dependencies:
- git
- gnupg2
- xz

gitea_systemd_path: '/lib/systemd/system'
2 changes: 2 additions & 0 deletions vars/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ gitea_dependencies:
- git
- gpg2
- xz

gitea_systemd_path: '/etc/systemd/system'

0 comments on commit 7857a62

Please sign in to comment.