2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Setting base path'
|
2019-01-13 17:59:56 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
2019-01-20 17:09:09 +00:00
|
|
|
block:
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Setting path (Linux)'
|
|
|
|
set_fact:
|
2019-01-20 17:09:09 +00:00
|
|
|
firefox_path: '~/.mozilla/firefox'
|
|
|
|
when: ansible_system == 'Linux'
|
2019-05-09 18:27:16 +01:00
|
|
|
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Setting path (Darwin)'
|
|
|
|
set_fact:
|
2019-01-20 17:09:09 +00:00
|
|
|
firefox_path: '~/Library/Application Support/Firefox'
|
|
|
|
when: ansible_system == 'Darwin'
|
2019-01-13 17:59:56 +00:00
|
|
|
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Discovering profile path'
|
2019-01-13 17:59:56 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- firefox
|
2019-01-31 20:37:19 +00:00
|
|
|
block:
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Setting profile_path'
|
|
|
|
set_fact:
|
2019-01-31 20:37:19 +00:00
|
|
|
profile_path: "{{ firefox_path }}/{{ lookup('ini', 'Path section=Profile0 file=' + firefox_path + '/profiles.ini') }}"
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Setting user config path'
|
|
|
|
set_fact:
|
2019-01-31 20:37:19 +00:00
|
|
|
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 22:31:01 +00:00
|
|
|
- name: 'Firefox: Downloading 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
|
|
|
|
2019-01-31 22:31:01 +00:00
|
|
|
- name: 'Firefox: Replacing user.js'
|
2019-01-13 17:59:56 +00:00
|
|
|
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 }}"
|