add regenerate key handler

This commit is contained in:
vincent 2021-07-19 23:14:45 +02:00
parent 85daaa8730
commit 6d14444631
3 changed files with 12 additions and 4 deletions

View File

@ -17,3 +17,10 @@
state: restarted
when: ansible_service_mgr == "systemd"
become: yes
- name: "regenerate keys"
command:
cmd: gitea admin -c /etc/gitea/app.ini regenerate keys
chdir: /usr/lib/gitea
become: true
become_user: "{{ gitea_user }}"

View File

@ -13,6 +13,7 @@
name: "{{ gitea_db_name }}"
state: import
target: "{{gitea_SQl_target_file}}"
notify: "regenerate keys"
when: gitea_database_creation.changed == true and gitea_SQl_target_file is defined
- name: "Ensure db user is present"

View File

@ -18,7 +18,6 @@
state: present
register: gitea_database_creation
- name: import DATA in database in case of creation
become: yes
become_user: postgres
@ -27,4 +26,5 @@
state: restore
target: "{{ gitea_SQl_target_file }}"
register: gitea_database_import
notify: "regenerate keys"
when: gitea_database_creation.changed == true and gitea_SQl_target_file is defined