Skip to content

Commit b898edf

Browse files
committed
allow optional public files
1 parent 5824df7 commit b898edf

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ To deploy multiple files we created the ``gitea_custom_search`` variable, that c
236236
* "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
237237
* 'files/gitea_footer/extra_links_footer.tmpl'
238238
* 'files/extra_links_footer.tmpl'
239-
239+
+ **CUSTOM FILES**:
240+
- Set ``gitea_customize_files`` to ``true``
241+
- Create a directory with the files you want to deploy.
242+
- Point ``gitea_customize_files_path`` to this directory. *(Default ``{{ gitea_custom_search }}/gitea_files/``)*
240243

241244
## Contributing
242245
Don't hesitate to create a pull request, and when in doubt you can reach me on

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,5 @@ gitea_custom_search: "files/host_files/{{ inventory_hostname }}/gitea"
153153
gitea_customize_logo: false
154154
gitea_custom: "{{ gitea_home }}/custom"
155155
gitea_customize_footer: false
156+
gitea_customize_files: false
157+
gitea_customize_files_path: "{{ gitea_custom_search }}/gitea_files"

tasks/customize_public_files.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
- name: create public directory for custom public web files
3+
become: true
4+
ansible.builtin.file:
5+
path: "{{ item }}"
6+
state: directory
7+
owner: "{{ gitea_user }}"
8+
group: "{{ gitea_group }}"
9+
mode: 'u=rwX,g=rX,o='
10+
with_items:
11+
- "{{ gitea_custom }}/public"
12+
13+
- name: transfer custom public web data
14+
become: true
15+
ansible.builtin.copy:
16+
src: "{{ gitea_customize_files_path }}"
17+
dest: "{{ gitea_custom }}/public/"
18+
owner: "{{ gitea_user }}"
19+
group: "{{ gitea_group }}"
20+
directory_mode: true
21+
mode: 'u=rwX,g=rX,o='
22+
ignore_errors: true
23+
notify: "Restart gitea"

tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@
5656
- name: optionally customize footer
5757
ansible.builtin.include_tasks: customize_footer.yml
5858
when: gitea_customize_footer|bool
59+
60+
- name: optionally deploy public files
61+
ansible.builtin.include_tasks: customize_public_files.yml
62+
when: gitea_customize_files|bool

vars/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,5 @@ transfer_custom_footer:
5656
- 'files/gitea_footer/extra_links_footer.tmpl'
5757
- 'files/extra_links_footer.tmpl'
5858

59-
60-
playbook_version_number: 17 # should be int
59+
playbook_version_number: 18 # should be int
6160
playbook_version_path: 'do1jlr.gitea.version'

0 commit comments

Comments
 (0)