machine_setup/ansible/roles/firefox/tasks/peruser.yaml

33 lines
975 B
YAML
Raw Normal View History

2022-10-24 00:49:48 +00:00
- include_role:
name: per_user
- name: Find firefox about:config file
find:
paths: "{{ account_homedir.stdout }}/.mozilla/firefox/"
patterns: "prefs.js"
recurse: true
depth: 2
register: firefox_about_config
- name: Configure Firefox about:config
2024-07-21 15:25:51 +00:00
when: item[1].value != None
2022-10-24 00:49:48 +00:00
lineinfile:
path: "{{ item[0].path }}"
regexp: '"{{ item[1].key }}", [^")\n]*\)'
line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});'
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
2024-07-21 15:25:51 +00:00
- name: Configure Firefox about:config
when: item[1].value == None
lineinfile:
path: "{{ item[0].path }}"
regexp: '"{{ item[1].key }}", [^")\n]*\)'
state: absent
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
2022-10-24 00:49:48 +00:00
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'