2019-01-13 17:59:56 +00:00
|
|
|
- name: 'Firefox: Set base path'
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
2019-01-20 17:09:09 +00:00
|
|
|
block:
|
|
|
|
- set_fact:
|
|
|
|
firefox_path: '~/.mozilla/firefox'
|
|
|
|
when: ansible_system == 'Linux'
|
|
|
|
- set_fact:
|
|
|
|
firefox_path: '~/Library/Application Support/Firefox'
|
|
|
|
when: ansible_system == 'Darwin'
|
2019-01-13 17:59:56 +00:00
|
|
|
|
|
|
|
- name: 'Firefox: Discover profile path'
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
2019-01-31 20:37:19 +00:00
|
|
|
block:
|
|
|
|
- set_fact:
|
|
|
|
profile_path: "{{ firefox_path }}/{{ lookup('ini', 'Path section=Profile0 file=' + firefox_path + '/profiles.ini') }}"
|
|
|
|
- set_fact:
|
|
|
|
userconfig_path: "{{ profile_path }}/user.js"
|
2019-01-13 17:59:56 +00:00
|
|
|
|
2019-01-31 20:39:12 +00:00
|
|
|
- name: 'Firefox: Updating config'
|
2019-01-13 17:59:56 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
|
|
|
block:
|
2019-01-31 20:39:12 +00:00
|
|
|
- name: 'Firefox: Download lockdown config (relaxed)'
|
2019-01-13 17:59:56 +00:00
|
|
|
get_url:
|
|
|
|
url: 'https://raw.githubusercontent.com/pyllyukko/user.js/relaxed/user.js'
|
2019-01-31 20:37:19 +00:00
|
|
|
dest: "{{ userconfig_path }}-lockdown"
|
2019-01-13 17:59:56 +00:00
|
|
|
mode: '0600'
|
|
|
|
force: yes
|
2019-01-31 20:37:19 +00:00
|
|
|
backup: no
|
2019-01-13 17:59:56 +00:00
|
|
|
|
|
|
|
- name: 'Firefox: Replace user.js'
|
|
|
|
copy:
|
2019-01-31 20:37:19 +00:00
|
|
|
src: "{{ userconfig_path }}-lockdown"
|
|
|
|
dest: "{{ userconfig_path }}"
|
2019-01-13 17:59:56 +00:00
|
|
|
mode: '0600'
|
|
|
|
force: yes
|
2019-01-31 20:37:19 +00:00
|
|
|
backup: no
|
2019-01-13 19:01:35 +00:00
|
|
|
|
2019-01-31 20:37:19 +00:00
|
|
|
- name: 'Firefox: Tweaking config'
|
2019-01-13 19:01:35 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
|
|
|
block:
|
2019-01-31 20:37:19 +00:00
|
|
|
- name: 'Firefox: Modifying user.js'
|
2019-01-13 19:01:35 +00:00
|
|
|
lineinfile:
|
2019-01-31 20:37:19 +00:00
|
|
|
path: "{{ userconfig_path }}"
|
2019-01-13 19:01:35 +00:00
|
|
|
state: present
|
2019-01-31 20:37:19 +00:00
|
|
|
regexp: "{{ item.name | regex_replace('\\.', '\\.') }}"
|
|
|
|
line: "user_pref(\"{{ item.name }}\", {{ item.value }});"
|
|
|
|
loop: "{{ firefox_user_prefs }}"
|
2019-01-31 21:58:27 +00:00
|
|
|
loop_control:
|
|
|
|
label: "{{ item.name }}"
|