mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-07 10:47:21 +02:00
Optimized performance by moving multiple similar when includes to own tasks file
This commit is contained in:
24
roles/srv-web-7-7-inj-css/tasks/01_core.yml
Normal file
24
roles/srv-web-7-7-inj-css/tasks/01_core.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
- name: Generate color palette with colorscheme-generator
|
||||
set_fact:
|
||||
color_palette: "{{ lookup('colorscheme', global_css_base_color, count=global_css_count, shades=global_css_shades) }}"
|
||||
|
||||
- name: Generate inverted color palette with colorscheme-generator
|
||||
set_fact:
|
||||
inverted_color_palette: "{{ lookup('colorscheme', global_css_base_color, count=global_css_count, shades=global_css_shades, invert_lightness=True) }}"
|
||||
|
||||
- name: Deploy global.css
|
||||
template:
|
||||
src: global.css.j2
|
||||
dest: "{{ global_css_destination }}"
|
||||
owner: "{{ nginx.user }}"
|
||||
group: "{{ nginx.user }}"
|
||||
mode: '0644'
|
||||
|
||||
- name: Get stat for global.css
|
||||
stat:
|
||||
path: "{{ global_css_destination }}"
|
||||
register: global_css_stat
|
||||
|
||||
- name: Set global_css_version
|
||||
set_fact:
|
||||
global_css_version: "{{ global_css_stat.stat.mtime }}"
|
@@ -1,34 +1,4 @@
|
||||
- name: Generate color palette with colorscheme-generator
|
||||
set_fact:
|
||||
color_palette: "{{ lookup('colorscheme', global_css_base_color, count=global_css_count, shades=global_css_shades) }}"
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
|
||||
- name: Generate inverted color palette with colorscheme-generator
|
||||
set_fact:
|
||||
inverted_color_palette: "{{ lookup('colorscheme', global_css_base_color, count=global_css_count, shades=global_css_shades, invert_lightness=True) }}"
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
|
||||
- name: Deploy global.css
|
||||
template:
|
||||
src: global.css.j2
|
||||
dest: "{{ global_css_destination }}"
|
||||
owner: "{{ nginx.user }}"
|
||||
group: "{{ nginx.user }}"
|
||||
mode: '0644'
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
|
||||
- name: Get stat for global.css
|
||||
stat:
|
||||
path: "{{ global_css_destination }}"
|
||||
register: global_css_stat
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
|
||||
- name: Set global_css_version
|
||||
set_fact:
|
||||
global_css_version: "{{ global_css_stat.stat.mtime }}"
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
|
||||
- name: Mark css as done
|
||||
set_fact:
|
||||
run_once_srv_web_7_7_inj_css: true
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
||||
- block:
|
||||
- include_tasks: 01_core.yml
|
||||
- include_tasks: utils/run_once.yml
|
||||
when: run_once_srv_web_7_7_inj_css is not defined
|
Reference in New Issue
Block a user