mirror of
https://github.com/roles-ansible/ansible_role_gitea.git
synced 2024-08-16 11:39:50 +02:00
Merge pull request #39 from roles-ansible/files
allow optional public files
This commit is contained in:
commit
90305e94f1
5 changed files with 34 additions and 3 deletions
|
@ -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_http_domain }}/gitea_footer/extra_links_footer.tmpl"
|
||||||
* 'files/gitea_footer/extra_links_footer.tmpl'
|
* 'files/gitea_footer/extra_links_footer.tmpl'
|
||||||
* 'files/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
|
## Contributing
|
||||||
Don't hesitate to create a pull request, and when in doubt you can reach me on
|
Don't hesitate to create a pull request, and when in doubt you can reach me on
|
||||||
|
|
|
@ -153,3 +153,5 @@ gitea_custom_search: "files/host_files/{{ inventory_hostname }}/gitea"
|
||||||
gitea_customize_logo: false
|
gitea_customize_logo: false
|
||||||
gitea_custom: "{{ gitea_home }}/custom"
|
gitea_custom: "{{ gitea_home }}/custom"
|
||||||
gitea_customize_footer: false
|
gitea_customize_footer: false
|
||||||
|
gitea_customize_files: false
|
||||||
|
gitea_customize_files_path: "{{ gitea_custom_search }}/gitea_files"
|
||||||
|
|
23
tasks/customize_public_files.yml
Normal file
23
tasks/customize_public_files.yml
Normal 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"
|
|
@ -56,3 +56,7 @@
|
||||||
- name: optionally customize footer
|
- name: optionally customize footer
|
||||||
ansible.builtin.include_tasks: customize_footer.yml
|
ansible.builtin.include_tasks: customize_footer.yml
|
||||||
when: gitea_customize_footer|bool
|
when: gitea_customize_footer|bool
|
||||||
|
|
||||||
|
- name: optionally deploy public files
|
||||||
|
ansible.builtin.include_tasks: customize_public_files.yml
|
||||||
|
when: gitea_customize_files|bool
|
||||||
|
|
|
@ -56,6 +56,5 @@ transfer_custom_footer:
|
||||||
- 'files/gitea_footer/extra_links_footer.tmpl'
|
- 'files/gitea_footer/extra_links_footer.tmpl'
|
||||||
- 'files/extra_links_footer.tmpl'
|
- 'files/extra_links_footer.tmpl'
|
||||||
|
|
||||||
|
playbook_version_number: 18 # should be int
|
||||||
playbook_version_number: 17 # should be int
|
|
||||||
playbook_version_path: 'do1jlr.gitea.version'
|
playbook_version_path: 'do1jlr.gitea.version'
|
||||||
|
|
Loading…
Reference in a new issue