ansible/roles/gitea/tasks/configure.yaml

76 lines
1.6 KiB
YAML
Raw Normal View History

---
2020-10-12 21:41:26 +00:00
- name: create group
user:
name: "{{ gitea_group }}"
system: yes
- name: create user and group
user:
name: "{{ gitea_user }}"
group: "{{ gitea_group }}"
shell: "{{ gitea_shell }}"
comment: "{{ gitea_gecos }}"
system: yes
password: "{{ gitea_password }}"
home: "{{ gitea_home_path }}"
- name: "create {{ gitea_etc_path }}"
file:
path: "{{ gitea_etc_path }}"
owner: root
group: "{{ gitea_group }}"
mode: 0750
state: directory
- name: "create {{ gitea_var_path }} tree"
file:
path: "{{ item }}"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
mode: 0750
state: directory
with_items: "{{ gitea_var_tree }}"
- name: "create {{ gitea_log_path }} path"
file:
path: "{{ gitea_log_path }}"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
mode: 0755
state: directory
- name: configure
template:
src: app.ini.j2
dest: "{{ gitea_config_path }}"
owner: root
group: "{{ gitea_group }}"
mode: 0640
notify:
- restart gitea
2022-08-30 12:13:05 +00:00
- name: set environment
lineinfile:
path: /etc/environment
regexp: ^GITEA_WORK_DIR
line: "GITEA_WORK_DIR=\"{{ gitea_var_path }}\""
2020-10-12 21:41:26 +00:00
- name: configure systemd unit
template:
src: gitea.service.j2
dest: "{{ gitea_systemd_unit_path }}"
owner: root
group: root
mode: 0644
notify:
- gitea daemon-reload
- restart gitea
when: ansible_service_mgr == 'systemd'
- name: manage service
service:
name: "{{ gitea_service_name }}"
state: "{{ gitea_service_state }}"
enabled: "{{ gitea_service_enabled }}"