Add handler, prevent accidental upgrades
This commit is contained in:
parent
1a5e867a5f
commit
a6fa4ac5ff
4 changed files with 61 additions and 0 deletions
|
@ -1,2 +1,7 @@
|
|||
---
|
||||
# Handlers
|
||||
- name: restart_gitea
|
||||
service:
|
||||
name: gitea
|
||||
state: restarted
|
||||
...
|
||||
|
|
38
init-gitea-update.yml
Normal file
38
init-gitea-update.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
- name: Update Gitea
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
pre_tasks:
|
||||
- name: Check if ansible cannot be run here
|
||||
stat:
|
||||
path: /etc/no-ansible
|
||||
register: no_ansible
|
||||
|
||||
- name: Verify if we can run ansible
|
||||
assert:
|
||||
that:
|
||||
- "not no_ansible.stat.exists"
|
||||
success_msg: "We are able to run on this node"
|
||||
fail_msg: "/etc/no-ansible exists - skipping run on this node"
|
||||
|
||||
- name: Enable the proper copr for gitea
|
||||
command: "dnf copr enable nalika/gitea -y"
|
||||
check_mode: false
|
||||
changed_when: "1 != 1"
|
||||
|
||||
tasks:
|
||||
- name: Update Gitea
|
||||
dnf:
|
||||
name: gitea
|
||||
state: latest
|
||||
|
||||
post_tasks:
|
||||
- name: Touching run file that ansible has ran here
|
||||
file:
|
||||
path: /var/log/ansible.run
|
||||
state: touch
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
...
|
|
@ -1,3 +1,17 @@
|
|||
---
|
||||
# Configuration for gitea
|
||||
- name: Enable Gitea
|
||||
service:
|
||||
name: gitea
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
# - name: Deploy Gitea configuration
|
||||
# template:
|
||||
# src: "etc/gitea/conf/app.ini.j2"
|
||||
# dest: "/etc/gitea/conf/app.ini"
|
||||
# owner: git
|
||||
# group: git
|
||||
# mode: '0660'
|
||||
# notify: restart_gitea
|
||||
...
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
- name: "Installing Gitea from COPR"
|
||||
dnf:
|
||||
name: gitea
|
||||
state: present
|
||||
|
||||
# Install web front end
|
||||
- name: "Installing httpd package and configuration"
|
||||
dnf:
|
||||
name: gitea-httpd
|
||||
state: present
|
||||
when:
|
||||
- gitea_web_install == "httpd"
|
||||
- gitea_web_config
|
||||
|
@ -15,6 +17,7 @@
|
|||
- name: "Installing nginx package and configuration"
|
||||
dnf:
|
||||
name: gitea-nginx
|
||||
state: present
|
||||
when:
|
||||
- gitea_web_install == "nginx"
|
||||
- gitea_web_config
|
||||
|
@ -22,6 +25,7 @@
|
|||
- name: "Installing caddy package and configuration"
|
||||
dnf:
|
||||
name: gitea-caddy
|
||||
state: present
|
||||
when:
|
||||
- gitea_web_install == "caddy"
|
||||
- gitea_web_config
|
||||
|
|
Loading…
Reference in a new issue