1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

allow optional public files

This commit is contained in:
L3D 2021-06-03 22:51:28 +02:00
parent 5824df7f6d
commit b898edfd48
Signed by: l3d
GPG key ID: CD08445BFF4313D1
5 changed files with 34 additions and 3 deletions

View file

@ -236,7 +236,10 @@ To deploy multiple files we created the ``gitea_custom_search`` variable, that c
* "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
* 'files/gitea_footer/extra_links_footer.tmpl'
* 'files/extra_links_footer.tmpl'
+ **CUSTOM FILES**:
- Set ``gitea_customize_files`` to ``true``
- Create a directory with the files you want to deploy.
- Point ``gitea_customize_files_path`` to this directory. *(Default ``{{ gitea_custom_search }}/gitea_files/``)*
## Contributing
Don't hesitate to create a pull request, and when in doubt you can reach me on

View file

@ -153,3 +153,5 @@ gitea_custom_search: "files/host_files/{{ inventory_hostname }}/gitea"
gitea_customize_logo: false
gitea_custom: "{{ gitea_home }}/custom"
gitea_customize_footer: false
gitea_customize_files: false
gitea_customize_files_path: "{{ gitea_custom_search }}/gitea_files"

View file

@ -0,0 +1,23 @@
---
- name: create public directory for custom public web files
become: true
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
mode: 'u=rwX,g=rX,o='
with_items:
- "{{ gitea_custom }}/public"
- name: transfer custom public web data
become: true
ansible.builtin.copy:
src: "{{ gitea_customize_files_path }}"
dest: "{{ gitea_custom }}/public/"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
directory_mode: true
mode: 'u=rwX,g=rX,o='
ignore_errors: true
notify: "Restart gitea"

View file

@ -56,3 +56,7 @@
- name: optionally customize footer
ansible.builtin.include_tasks: customize_footer.yml
when: gitea_customize_footer|bool
- name: optionally deploy public files
ansible.builtin.include_tasks: customize_public_files.yml
when: gitea_customize_files|bool

View file

@ -56,6 +56,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 17 # should be int
playbook_version_number: 18 # should be int
playbook_version_path: 'do1jlr.gitea.version'