-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from mira-miracoli/themes
Themes
- Loading branch information
Showing
9 changed files
with
416 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- name: Copy subdomain static files | ||
ansible.builtin.copy: | ||
src: "{{ item }}" | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/{{ object.value }}" | ||
mode: '0644' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
with_fileglob: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/static/{{ object.value }}*" | ||
|
||
- name: Copy files from dist | ||
ansible.builtin.copy: | ||
src: "{{ item }}" | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/dist/" | ||
mode: '0644' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
with_fileglob: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/static/dist/*" | ||
|
||
- name: Copy files from dist | ||
ansible.builtin.copy: | ||
src: "{{ item }}" | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/dist/" | ||
mode: '0644' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
with_fileglob: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/static/dist/*" | ||
|
||
- name: Copy custom welcome.html | ||
ansible.builtin.copy: | ||
src: "{{ item }}" | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/welcome.html/index.html" | ||
mode: '0644' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
with_fileglob: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/static/welcome.html" | ||
when: custom_welcome.stat.exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- name: Create welcome.html directory for basedomain | ||
ansible.builtin.file: | ||
state: directory | ||
mode: '0755' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
path: "{{ galaxy_themes_static_path }}/static/welcome.html" | ||
|
||
- name: Template welcome.html for basedomain | ||
ansible.builtin.template: | ||
src: welcome.html.j2 | ||
dest: "{{ galaxy_themes_static_path }}/static/welcome.html/index.html" | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
mode: '0644' | ||
|
||
- name: Include create subdomain static dirs and copy static files | ||
ansible.builtin.include_tasks: static_subdomain_dirs.yml | ||
loop: "{{ galaxy_themes_subdomains if galaxy_themes_subdomains | length or \ | ||
galaxy_manage_static else [] }}" | ||
loop_control: | ||
loop_var: subdomain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
- name: Create subdomain static dirs | ||
ansible.builtin.file: | ||
state: directory | ||
mode: '0755' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
path: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}" | ||
|
||
- name: Synchronize contents from static to static-"{{ subdomain.name }}" | ||
ansible.posix.synchronize: | ||
src: "{{ galaxy_themes_static_path }}/static/" | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}" | ||
rsync_opts: ["--ignore-existing"] | ||
delegate_to: "{{ inventory_hostname }}" | ||
|
||
- name: Check if welcome.html is present in files | ||
ansible.builtin.stat: | ||
path: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/static/welcome.html" | ||
register: custom_welcome | ||
|
||
- name: Create welcome.html directory | ||
ansible.builtin.file: | ||
state: directory | ||
mode: '0755' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
path: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/welcome.html" | ||
|
||
- name: Check if iframe for subdomain exists | ||
ansible.builtin.uri: | ||
url: "{{ galaxy_themes_welcome_url_prefix }}{{ subdomain.name }}.html" | ||
return_content: true | ||
register: galaxy_themes_use_iframe | ||
failed_when: false | ||
when: not custom_welcome.stat.exists | ||
|
||
- name: Template welcome.html for subdomains | ||
ansible.builtin.template: | ||
src: welcome.html.j2 | ||
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/welcome.html/index.html" | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
mode: '0644' | ||
when: not custom_welcome.stat.exists | ||
|
||
- name: Include copy_static_files.yml | ||
ansible.builtin.include_tasks: copy_static_files.yml | ||
loop: "{{ galaxy_themes_static_keys | dict2items }}" | ||
loop_control: | ||
loop_var: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Append themes_conf.yml to all files in galaxy/config/themes | ||
ansible.builtin.blockinfile: | ||
block: "{{ lookup('ansible.builtin.file', galaxy_themes_conf_path) }}" | ||
path: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/themes/{{ subdomain.name }}.yml" | ||
|
||
- name: Copy themes files | ||
ansible.builtin.copy: | ||
src: "{{ galaxy_themes_ansible_file_path }}/{{ subdomain.name }}/themes/{{ subdomain.name }}.yml" | ||
dest: "{{ galaxy_config_dir }}" | ||
mode: '0644' | ||
owner: "{{ __galaxy_privsep_user_name }}" | ||
group: "{{ __galaxy_privsep_user_group }}" | ||
|
Oops, something went wrong.