ansible/roles/gitea/tasks/main.yaml

94 lines
2.0 KiB
YAML
Raw Normal View History

2019-11-25 00:50:21 +00:00
---
2020-08-22 14:56:22 +00:00
- name: gather architecture specific variables
include_vars: "{{ lookup('first_found', possible_files) }}"
vars:
possible_files:
files:
- "{{ ansible_userspace_architecture }}.yaml"
- "default.yaml"
paths:
- vars
2019-11-25 00:50:21 +00:00
- name: "download gitea {{ gitea_version }}"
get_url:
url: "{{ gitea_url }}"
checksum: "{{ gitea_checksum }}"
dest: "{{ gitea_path }}"
owner: root
group: root
mode: 0755
2019-12-11 03:59:45 +00:00
notify:
- restart gitea
2019-11-25 00:50:21 +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 }}"
2019-11-29 19:17:37 +00:00
mode: 0750
2019-11-25 00:50:21 +00:00
state: directory
- name: configure
template:
src: app.ini.j2
dest: "{{ gitea_config_path }}"
owner: root
group: "{{ gitea_group }}"
mode: 0640
notify:
- restart gitea
- name: "create {{ gitea_var_path }} tree"
file:
path: "{{ item }}"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
2019-11-29 19:17:37 +00:00
mode: 0750
2019-11-25 00:50:21 +00:00
state: directory
with_items: "{{ gitea_var_tree }}"
- name: "create {{ gitea_log_path }} path"
file:
path: "{{ gitea_log_path }}"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
2019-11-27 22:43:45 +00:00
mode: 0755
2019-11-25 00:50:21 +00:00
state: directory
- 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 }}"
- name: configure nginx
include: nginx.yaml
when: "'nginx' in ansible_play_role_names"