removed giteaUninstall var

This commit is contained in:
CPunch 2023-02-02 16:04:44 -06:00
parent feaea47028
commit 06548bf135
8 changed files with 5 additions and 36 deletions

View File

@ -1,3 +1,2 @@
--- ---
giteaPort: 3000 giteaPort: 3000
giteaUninstall: false

View File

@ -22,4 +22,5 @@
- name: Fetch backup - name: Fetch backup
fetch: fetch:
src: /etc/gitea/gitea-dump.zip src: /etc/gitea/gitea-dump.zip
dest: backups dest: backups/gitea-dump.zip
flat: true

View File

@ -42,30 +42,4 @@
- name: Backup db - name: Backup db
include_tasks: backup.yml include_tasks: backup.yml
tags: ['never', 'backup'] tags: ['never', 'backup']
when: giteaUninstall == false tags: ['gitea', 'backup']
- name: Uninstall Gitea
block:
- name: Stop Gitea
systemd:
name: gitea
enabled: no
state: stopped
- name: Remove Gitea package
package:
name: gitea
state: absent
- name: Remove Gitea repository
apt_repository:
filename: morph027-gitea
repo: deb https://packaging.gitlab.io/gitea gitea main
state: absent
- name: Remove Gitea key
file:
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
state: absent
when: gitea_key.stat.exists == false or gitea_key.stat.mode != "0644"
when: giteaUninstall == true and ('gitea' in ansible_facts.packages)

View File

View File

@ -1,3 +1,2 @@
--- ---
giteaPort: 3000 giteaPort: 3000
giteaUninstall: false

View File

@ -22,14 +22,12 @@
dest: /etc/nginx/conf.d/git.{{ domain }}.conf dest: /etc/nginx/conf.d/git.{{ domain }}.conf
force: no force: no
notify: setup nginx notify: setup nginx
when: giteaPort is defined and giteaUninstall == false
- name: Uninstall nginx config for git.{{ domain }} - name: Uninstall nginx config for git.{{ domain }}
file: file:
path: /etc/nginx/conf.d/git.{{ domain }}.conf path: /etc/nginx/conf.d/git.{{ domain }}.conf
state: absent state: absent
notify: setup nginx notify: setup nginx
when: giteaPort is not defined or (giteaUninstall is defined and giteaUninstall)
- name: Install nginx config for our Hidden Service - name: Install nginx config for our Hidden Service
template: template:

View File

@ -4,7 +4,6 @@
- name: Setup certbot for git.{{ domain }} - name: Setup certbot for git.{{ domain }}
shell: "certbot --nginx --non-interactive --agree-tos -m {{ contact_email }} -d git.{{ domain }}" shell: "certbot --nginx --non-interactive --agree-tos -m {{ contact_email }} -d git.{{ domain }}"
when: giteaPort is defined and giteaUninstall == false
- name: Reload Nginx - name: Reload Nginx
systemd: systemd:

View File

@ -3,7 +3,6 @@
become: yes become: yes
vars: vars:
- giteaPort: 3000 - giteaPort: 3000
- giteaUninstall: false
vars_files: vars_files:
- group_vars/all.yml - group_vars/all.yml