From 06548bf13572f3a81e9c2bb3a87e7edc3272bdbe Mon Sep 17 00:00:00 2001 From: CPunch Date: Thu, 2 Feb 2023 16:04:44 -0600 Subject: [PATCH] removed giteaUninstall var --- roles/gitea/defaults/main.yml | 3 +-- roles/gitea/tasks/backup.yml | 3 ++- roles/gitea/tasks/main.yml | 28 +--------------------------- roles/gitea/tasks/restore.yml | 0 roles/nginx/defaults/main.yml | 3 +-- roles/nginx/tasks/main.yml | 2 -- roles/nginx/tasks/setup.yml | 1 - run.yml | 1 - 8 files changed, 5 insertions(+), 36 deletions(-) create mode 100644 roles/gitea/tasks/restore.yml diff --git a/roles/gitea/defaults/main.yml b/roles/gitea/defaults/main.yml index 68d6df4..780b99d 100644 --- a/roles/gitea/defaults/main.yml +++ b/roles/gitea/defaults/main.yml @@ -1,3 +1,2 @@ --- -giteaPort: 3000 -giteaUninstall: false \ No newline at end of file +giteaPort: 3000 \ No newline at end of file diff --git a/roles/gitea/tasks/backup.yml b/roles/gitea/tasks/backup.yml index 52453cf..5ec5616 100644 --- a/roles/gitea/tasks/backup.yml +++ b/roles/gitea/tasks/backup.yml @@ -22,4 +22,5 @@ - name: Fetch backup fetch: src: /etc/gitea/gitea-dump.zip - dest: backups \ No newline at end of file + dest: backups/gitea-dump.zip + flat: true \ No newline at end of file diff --git a/roles/gitea/tasks/main.yml b/roles/gitea/tasks/main.yml index 5e78673..35db1ca 100644 --- a/roles/gitea/tasks/main.yml +++ b/roles/gitea/tasks/main.yml @@ -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) \ No newline at end of file + tags: ['gitea', 'backup'] diff --git a/roles/gitea/tasks/restore.yml b/roles/gitea/tasks/restore.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/nginx/defaults/main.yml b/roles/nginx/defaults/main.yml index 68d6df4..780b99d 100644 --- a/roles/nginx/defaults/main.yml +++ b/roles/nginx/defaults/main.yml @@ -1,3 +1,2 @@ --- -giteaPort: 3000 -giteaUninstall: false \ No newline at end of file +giteaPort: 3000 \ No newline at end of file diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 5eb4745..3be6a06 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -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: diff --git a/roles/nginx/tasks/setup.yml b/roles/nginx/tasks/setup.yml index 7660238..81c0f14 100644 --- a/roles/nginx/tasks/setup.yml +++ b/roles/nginx/tasks/setup.yml @@ -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: diff --git a/run.yml b/run.yml index d269f70..32893b7 100644 --- a/run.yml +++ b/run.yml @@ -3,7 +3,6 @@ become: yes vars: - giteaPort: 3000 - - giteaUninstall: false vars_files: - group_vars/all.yml