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
giteaUninstall: false
giteaPort: 3000

View File

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

View File

@ -42,30 +42,4 @@
- name: Backup db
include_tasks: backup.yml
tags: ['never', 'backup']
when: giteaUninstall == false
- 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)
tags: ['gitea', 'backup']

View File

View File

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

View File

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

View File

@ -4,7 +4,6 @@
- name: Setup certbot for 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
systemd:

View File

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