dotfiles/salt/states/firefox.sls
2020-08-02 18:11:54 +02:00

16 lines
691 B
Plaintext

copy the install addon script:
file.managed:
- name: {{ salt['user.info']( pillar['username'] ).home }}/bin/install_firefox_addon
- source: salt://files/install_firefox_addon
- user: {{ pillar['username'] }}
- group: users
- mode: "0755"
{% for name, args in pillar['firefox']['addons'].items() %}
Downloading {{ name }} Firefox xpi:
cmd.run:
- name: {{ salt['user.info']( pillar['username'] ).home }}/bin/install_firefox_addon {{ args['name'] }} {{ args['url'] }}
- unless: grep -oP '(?<=\},\"name\":\"){{ name }}' {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/*.default*/addons.json
- runas: {{ pillar['username'] }}
{% endfor %}