diff --git a/ansible/playbooks/migrate_to_wmt.yml b/ansible/playbooks/migrate_to_wmt.yml index 8ca7682..6755532 100644 --- a/ansible/playbooks/migrate_to_wmt.yml +++ b/ansible/playbooks/migrate_to_wmt.yml @@ -57,24 +57,28 @@ - name: Decode idmasa value set_fact: - work_place_value: "{{ (idmasa_raw.content | b64decode).strip() }}" + work_place_value: "{{ idmasa_raw.content | b64decode | trim }}" - name: Show detected work_place value debug: msg: "work_place will be set to: '{{ work_place_value }}'" - # ── 5. Ensure config.txt has a [device] section with work_place ─────── - - name: Ensure [device] section exists in config.txt - ini_file: + # ── 5. Replace work_place value in WMT/data/config.txt ─────────────── + - name: Replace work_place in WMT config.txt + lineinfile: path: /home/pi/Desktop/WMT/data/config.txt - section: device - option: work_place - value: "{{ work_place_value }}" + regexp: '^work_place\s*=.*' + line: "work_place={{ work_place_value }}" backup: true - create: true - owner: pi - group: pi - mode: '0644' + + - name: Confirm work_place change + command: grep 'work_place' /home/pi/Desktop/WMT/data/config.txt + register: wp_check + changed_when: false + + - name: Show work_place line in config.txt + debug: + msg: "{{ wp_check.stdout }}" # ── 6. Update wayfire.ini autostart to launch from WMT ─────────────── - name: Update wayfire.ini start_python path from Prezenta to WMT