Skip to content

rahoogan/ansible-role-firefox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTICE

This repo has been forked from: https://github.com/unrblt/ansible-role-firefox, which is covered under the GPLv2 license. The README below is from the original source.

This repo redistributes the original source with the following modifications under the GPLv2 license:

  • Update addon API to v4
  • Adds hash verification for all addons before installation
  • Adds a hardened and customised user.js modified from https://github.com/pyllyukko/user.js (under the MIT License)

Modified by Rahul Raghavan (2019)

Ansible Role: Firefox

Installs firefox and optionally creates profiles with extensions. Extensions are installed but need to be manually enabled from firefox. It's only been tested in Ubuntu, but should work on other systems as long as you set the right packages in firefox_packages.

Requirements

xmltodict and requests are required on the remote host to install extensions.

Role Variables

firefox_home: ~/.mozilla/firefox

Default directory for profiles.

firefox_packages:
  - firefox
  - firefox-locale-en
  - firefox-locale-es

Packages to install.

firefox_profiles: []
#  - name: alice
#    extensions:
#      - random-agent-spoofer
#  - name: bob
#    extensions: []

List of profiles with extensions. extensions is a list of extension names to download and it needs to be defined (use an empty list if you don't want to install any extensions).

firefox_preferences: {}
#  browser.safebrowsing.enabled: 'false'

Dictionary with preference and value. This preferences are written to a user.js file in the profile directory which means any change you make to that setting in the options and preference dialogs or via about:config will be lost when you restart firefox. This settings apply to every profile.

firefox_profile_preferences: {}
#  alice:
#    browser.safebrowsing.enabled: 'false'
#    browser.safebrowsing.malware.enabled: 'false'

Dictionary with preference and value (keyed by profile name). This preferences will be merged with firefox_preferences.

Example Playbook

- hosts: localhost

  vars:
    firefox_profiles:
      - name: alice
        extensions:
          - random-agent-spoofer
          - https-everywhere
          - noscript
      - name: bob
        extensions: []
    firefox_preferences:
      browser.safebrowsing.enabled: 'true'
      geo.ip: 'false'
      browser.search.defaultenginename: "'DuckDuckGo'"
    firefox_profile_preferences:
      alice:
        browser.safebrowsing.enabled: 'false'
        browser.safebrowsing.malware.enabled: 'false'

  pre_tasks:
    - name: install role requirements
      pip: name={{ item }} state=present
      with_items:
        - xmltodict
        - requests

  roles:
     - firefox

License

GPLv2

About

Ansible role to install firefox with multiple profiles (each with its own settings and extensions)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%