dotfiles/salt/states/firefox.sls

8 lines
544 B
Plaintext
Raw Normal View History

2020-08-02 15:25:30 +00:00
{% for name, args in pillar['firefox']['addons'].items() %}
Downloading {{ name }} Firefox xpi:
cmd.run:
- name: curl -sLo {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/$(sed -n 's/^Path=\(.*\)$/\1/p' {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/profiles.ini)/{{ args['name'] }} {{ args['url'] }}
- unless: grep -oP '(?<=\},\"name\":\"){{ name }}' {{ salt['user.info']( pillar['username'] ).home }}/.mozilla/firefox/*.default*/addons.json
- user: {{ pillar['username'] }}
{% endfor %}