mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-02 15:39:57 +00:00
This ensures CSS output remains stable between runs, preventing unnecessary OpenResty restarts for every service caused by randomized gradients or regenerated CSS files. Ref: https://chatgpt.com/share/69281d4b-2488-800f-8c0c-c0db44810d1d
32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
- name: Generate color palette with colorscheme-generator
|
|
set_fact:
|
|
CSS_COLOR_PALETTE: "{{ lookup('colorscheme', CSS_BASE_COLOR, count=CSS_COUNT, shades=CSS_SHADES) }}"
|
|
|
|
- name: Generate inverted color palette with colorscheme-generator
|
|
set_fact:
|
|
CSS_COLOR_PALETTE_INVERTED: "{{ lookup('colorscheme', CSS_BASE_COLOR, count=CSS_COUNT, shades=CSS_SHADES, invert_lightness=True) }}"
|
|
|
|
- name: "Compute deterministic gradient angle from default.css template mtime"
|
|
set_fact:
|
|
CSS_GRADIENT_ANGLE: >-
|
|
{{
|
|
(
|
|
lookup(
|
|
'local_mtime_qs',
|
|
[playbook_dir, 'roles', 'sys-front-inj-css', 'templates', 'css', 'default.css.j2'] | path_join
|
|
)
|
|
| regex_replace('^.*=', '')
|
|
| int
|
|
) % 360
|
|
}}
|
|
|
|
- name: Deploy default CSS files
|
|
template:
|
|
src: "{{ ['css', item ~ '.j2'] | path_join }}"
|
|
dest: "{{ [cdn_paths_all.shared.css, item] | path_join }}"
|
|
owner: "{{ NGINX.USER }}"
|
|
group: "{{ NGINX.USER }}"
|
|
mode: '0644'
|
|
loop: "{{ CSS_FILES }}"
|
|
|
|
- include_tasks: utils/run_once.yml |