- name: Include dependency 'srv-web-7-4-core'
  include_role:
    name: srv-web-7-4-core
  when: run_once_srv_web_7_4_core is not defined

- 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 }}"
