dotfiles/salt/states/firefox.sls

16 lines
691 B
Plaintext
Raw Normal View History

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"
2020-08-02 15:25:30 +00:00
{% 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'] }}
2020-08-02 15:25:30 +00:00
- unless: grep -oP '(?<=\},\"name\":\"){{ name }}' {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/*.default*/addons.json
- runas: {{ pillar['username'] }}
2020-08-02 15:25:30 +00:00
{% endfor %}