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

16 lines
690 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
- user: {{ pillar['username'] }}
{% endfor %}