Kapisi/roles/Foundation/tasks/main.yml

97 lines
1.9 KiB
YAML
Raw Permalink Normal View History

2020-10-08 16:33:19 -05:00
---
- name: Base packages
become: yes
package:
name:
- gitea
- name: BitBot
2022-07-02 10:24:10 -05:00
become: yes
2020-10-08 16:33:19 -05:00
git:
repo: https://github.com/jesopo/bitbot.git
dest: /opt/bitbot
2022-07-02 10:24:10 -05:00
- name: Make directories
become: yes
file:
path: "/var/lib/gitea/{{ item }}"
owner: gitea
group: gitea
mode: 0750
loop:
- "custom/bin"
- "web-snippets"
2022-09-15 13:16:08 -05:00
- name: Populate config
become: yes
register: config
template:
src: app.ini.j2
dest: /var/lib/gitea/custom/conf/app.ini
owner: gitea
group: gitea
mode: 0750
2022-07-02 10:24:10 -05:00
- name: Copy web-snippets
become: yes
copy:
src: web-snippets/
dest: /var/lib/gitea/web-snippets
owner: gitea
group: gitea
mode: 0640
- name: Copy scripts
become: yes
copy:
src: custom/
dest: /var/lib/gitea/custom/
owner: gitea
group: gitea
2020-10-08 16:33:19 -05:00
2022-09-15 13:16:08 -05:00
- name: Publish AniNIX/Yggdrasil CSS
become: yes
get_url:
url: https://github.com/BenZuser/Emby-Web-Dark-Themes-CSS/raw/master/RED/theme.css
dest: /var/lib/gitea/custom/public/css/emby-web-dark-theme-BenZuser.css
owner: gitea
group: gitea
2022-07-02 10:24:10 -05:00
- name: Copy hook
become: yes
copy:
src: gitea.hook
dest: /etc/pacman.d/hooks/gitea.hook
owner: gitea
group: gitea
2020-10-08 16:33:19 -05:00
2022-09-15 13:16:08 -05:00
- name: Service file
become: yes
register: servicefile
copy:
src: foundation.service
dest: /usr/lib/systemd/system
owner: root
group: root
mode: 0755
- name: Ensure default service disabled
become: yes
service:
name: gitea
state: stopped
enabled: no
2022-07-02 10:24:10 -05:00
- name: Generate pages
become: yes
2022-09-15 13:16:08 -05:00
register: custompages
2022-07-02 10:24:10 -05:00
command: /usr/bin/runuser -u gitea -- /usr/bin/bash /var/lib/gitea/custom/bin/gen-aninix-custom
2022-09-15 13:16:08 -05:00
- name: Restart service
become: yes
when: config.changed or servicefile.changed or custompages.changed
service:
name: foundation
state: restarted
enabled: yes