Ansible: Install Firefox extension

From FVue
Jump to: navigation, search


Using Ansible, how can I install a Firefox extension on a host.


  • firefox-26.0


Unzip the extension. Note the extension-id (<em:id>) in install.rdf

Copy the unzipped extension files to the host machine in /home/<user>/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/<extension-id>

Now when firefox is restarted on the host machine, the user will be asked to confirm the installation.

Here's an example playbook for installing Adblock Edge (change "me" to username):

# Ansible playbook to install firefox
- hosts: workstations
  user: me
  sudo: yes
  - name: Ensure package firefox is installed
    apt: pkg=firefox state=present
  - name: Ensure extension AdblockEdge is installed
    local_action: >
      command rsync -Cavz 
      me@{{ inventory_hostname }}:/home/me/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/

See also: How to install Firefox addon from command line in scripts? - Ask Ubuntu



Ansible Galaxy | alzadude.firefox-addon
An Ansible role which provides a firefox_addon module for installing or uninstalling Firefox addons


How to install Firefox addon from command line in scripts? - Ask Ubuntu:

Solution: Install in ~/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Pro: When user starts firefox, user is asked permission to install extension
Con: Extension can't be uninstalled, only disabled. Uninstall is possible by removing extension from above directory. Or does Ansible install it again?