---
- name: "π₯ Look up the household primary colour the role wrote last"
ansible.builtin.stat:
path: "{{ SOCIALHOME_THEME_MARKER_FILE }}"
checksum_algorithm: sha1
register: socialhome_theme_marker
- name: "π₯ Look up the household name the role wrote last"
ansible.builtin.stat:
path: "{{ SOCIALHOME_NAME_STATE_FILE }}"
register: socialhome_name_marker
- name: "π₯ Read the household name the role wrote last"
ansible.builtin.slurp:
src: "{{ SOCIALHOME_NAME_STATE_FILE }}"
register: socialhome_name_state_file
when: socialhome_name_marker.stat.exists
- name: "π¨ Converge the household primary colour and name"
include_tasks: 02_design/converge.yml
when: SOCIALHOME_DESIGN_ENABLED | bool or socialhome_theme_marker.stat.exists or socialhome_name_marker.stat.exists
- name: "π·οΈ Mark the household primary colour as the role's"
stack_host_copy:
content: "{{ SOCIALHOME_THEME_PRIMARY }}"
dest: "{{ SOCIALHOME_THEME_MARKER_FILE }}"
mode: "0644"
when:
- SOCIALHOME_DESIGN_ENABLED | bool
- socialhome_theme_written is changed
- name: "π·οΈ Mark the household name as the role's"
stack_host_copy:
content: "{{ {'applied': SOCIALHOME_DESIGN_TITLE, 'previous': (socialhome_name_state.previous if socialhome_name_state | length > 0 else socialhome_name_current)}
| to_json }}"
dest: "{{ SOCIALHOME_NAME_STATE_FILE }}"
mode: "0644"
when:
- SOCIALHOME_DESIGN_TITLE | length > 0
- socialhome_name_written is changed or (socialhome_name_state | length == 0 and socialhome_name_current == SOCIALHOME_DESIGN_TITLE)
- name: "π§Ή Drop the household theme marker"
ansible.builtin.file:
path: "{{ SOCIALHOME_THEME_MARKER_FILE }}"
state: absent
when: not (SOCIALHOME_DESIGN_ENABLED | bool)
- name: "π§Ή Drop the household name marker"
ansible.builtin.file:
path: "{{ SOCIALHOME_NAME_STATE_FILE }}"
state: absent
when: SOCIALHOME_DESIGN_TITLE | length == 0