fix: replace ini_file with lineinfile for reliable work_place substitution
This commit is contained in:
@@ -57,24 +57,28 @@
|
|||||||
|
|
||||||
- name: Decode idmasa value
|
- name: Decode idmasa value
|
||||||
set_fact:
|
set_fact:
|
||||||
work_place_value: "{{ (idmasa_raw.content | b64decode).strip() }}"
|
work_place_value: "{{ idmasa_raw.content | b64decode | trim }}"
|
||||||
|
|
||||||
- name: Show detected work_place value
|
- name: Show detected work_place value
|
||||||
debug:
|
debug:
|
||||||
msg: "work_place will be set to: '{{ work_place_value }}'"
|
msg: "work_place will be set to: '{{ work_place_value }}'"
|
||||||
|
|
||||||
# ── 5. Ensure config.txt has a [device] section with work_place ───────
|
# ── 5. Replace work_place value in WMT/data/config.txt ───────────────
|
||||||
- name: Ensure [device] section exists in config.txt
|
- name: Replace work_place in WMT config.txt
|
||||||
ini_file:
|
lineinfile:
|
||||||
path: /home/pi/Desktop/WMT/data/config.txt
|
path: /home/pi/Desktop/WMT/data/config.txt
|
||||||
section: device
|
regexp: '^work_place\s*=.*'
|
||||||
option: work_place
|
line: "work_place={{ work_place_value }}"
|
||||||
value: "{{ work_place_value }}"
|
|
||||||
backup: true
|
backup: true
|
||||||
create: true
|
|
||||||
owner: pi
|
- name: Confirm work_place change
|
||||||
group: pi
|
command: grep 'work_place' /home/pi/Desktop/WMT/data/config.txt
|
||||||
mode: '0644'
|
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 ───────────────
|
# ── 6. Update wayfire.ini autostart to launch from WMT ───────────────
|
||||||
- name: Update wayfire.ini start_python path from Prezenta to WMT
|
- name: Update wayfire.ini start_python path from Prezenta to WMT
|
||||||
|
|||||||
Reference in New Issue
Block a user