Automatically install Firefox extensions
This commit is contained in:
28
roles/firefox/tasks/Darwin.yaml
Normal file
28
roles/firefox/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: firefox
|
||||
state: latest
|
||||
|
||||
- name: set enterprise policies
|
||||
set_fact:
|
||||
firefox_darwin_policies: >-
|
||||
{{ (lookup('template', 'policies.json.j2') | from_json).policies
|
||||
| combine({'EnterprisePoliciesEnabled': true}) }}
|
||||
|
||||
- name: read current enterprise policies
|
||||
command: plutil -convert json -o - /Library/Preferences/org.mozilla.firefox.plist
|
||||
register: firefox_current_policies
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: install enterprise policies
|
||||
when: >-
|
||||
firefox_current_policies.rc != 0 or
|
||||
firefox_current_policies.stdout | from_json != firefox_darwin_policies
|
||||
become: true
|
||||
shell: >-
|
||||
plutil -convert xml1 -o - - |
|
||||
defaults import /Library/Preferences/org.mozilla.firefox -
|
||||
args:
|
||||
stdin: '{{ firefox_darwin_policies | to_json }}'
|
||||
Reference in New Issue
Block a user