mirror of
https://github.com/CPunch/openpunk-ansible.git
synced 2024-11-25 00:11:05 +00:00
roles/gitea: installing gitea is now idempotent
This commit is contained in:
parent
2d3fbfe484
commit
e3d3ec37fd
@ -1,17 +1,4 @@
|
||||
---
|
||||
# TODO: make idempotent
|
||||
- name: Add Gitea repo key
|
||||
shell: curl -s https://packaging.gitlab.io/gitea/gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/morph027-gitea.gpg --import
|
||||
|
||||
# TODO: make idempotent
|
||||
- name: Set key perms
|
||||
shell: sudo chmod 644 /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
|
||||
- name: Add Gitea repo
|
||||
apt_repository:
|
||||
filename: morph027-gitea
|
||||
repo: deb https://packaging.gitlab.io/gitea gitea main
|
||||
|
||||
- name: Upgrade Packages
|
||||
apt:
|
||||
update_cache: yes
|
||||
@ -21,7 +8,6 @@
|
||||
package:
|
||||
name:
|
||||
- hugo
|
||||
- gitea
|
||||
- git
|
||||
- nginx
|
||||
- tor
|
||||
|
@ -1,4 +1,25 @@
|
||||
---
|
||||
- name: Check for Gitea gpg key
|
||||
stat:
|
||||
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
register: gitea_key
|
||||
|
||||
- name: Add Gitea key && repository
|
||||
block:
|
||||
- name: Import Gitea key
|
||||
shell: curl -s https://packaging.gitlab.io/gitea/gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/morph027-gitea.gpg --import && sudo chmod 644 /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
|
||||
- name: Add Gitea repository
|
||||
apt_repository:
|
||||
filename: morph027-gitea
|
||||
repo: deb https://packaging.gitlab.io/gitea gitea main
|
||||
when: gitea_key.stat.exists == false or gitea_key.stat.mode != "0644"
|
||||
|
||||
- name: Install Gitea
|
||||
package:
|
||||
name:
|
||||
- gitea
|
||||
|
||||
- name: Configure Gitea
|
||||
template:
|
||||
src: app.ini
|
||||
|
Loading…
Reference in New Issue
Block a user