Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

---
- name: Install packages
yum: name={{ gitea_packages }}
tags: gitea
- name: Download gitea binary
get_url:
url: "{{ gitea_bin_url }}"
dest: "{{ gitea_root_dir }}/tmp/gitea"
checksum: "sha256:{{ gitea_bin_sha256 }}"
when: gitea_install_mode != 'none'
notify: restart gitea
tags: gitea
- name: Move gitea binary
command: mv -f {{ gitea_root_dir }}/tmp/gitea {{ gitea_root_dir }}/bin/
when: gitea_install_mode != 'none'
tags: gitea
- name: Make gitea executable
file: path={{ gitea_root_dir }}/bin/gitea mode=0755
tags: gitea
- name: Deploy gitea service unit
template: src=gitea.service.j2 dest=/etc/systemd/system/gitea.service
register: gitea_unit
notify: restart gitea
tags: gitea
- name: Reload systemd
systemd: daemon_reload=True
when: gitea_unit.changed
tags: gitea
# Create MySQL database
- import_tasks: ../includes/webapps_create_mysql_db.yml
vars:
- db_name: "{{ gitea_db_name }}"
- db_user: "{{ gitea_db_user }}"
- db_server: "{{ gitea_db_server }}"
- db_pass: "{{ gitea_db_pass }}"
tags: gitea
- name: Deploy pre/post backup scripts
template: src={{ item }}_backup.sh.j2 dest=/etc/backup/{{ item }}.d/gitea.sh mode=0750
with_items:
- pre
- post
tags: gitea
- name: Deploy permission script
template: src=perms.sh.j2 dest={{ gitea_root_dir }}/perms.sh mode=755
tags: gitea
- name: Set correct SELinux context
sefcontext:
target: "{{ gitea_root_dir }}/.ssh(/.*)?"
setype: ssh_home_t
state: present
when: ansible_selinux.status == 'enabled'
tags: gitea