On Mon, Jul 13, 2020 at 06:22:57PM +0100, lik...@gmx.de wrote:
> On 2020-07-13 13:48, unman wrote:
> > On Sun, Jul 12, 2020 at 05:55:56PM +0100, 
> > liked2-mmb7mzph...@public.gmane.org wrote:
> > > Hi,
> > > 
> > > I'm trying to build up my AppVms with saltstack and currently stuck with 
> > > updating my firefox profile because it's located in a randomly generated 
> > > directory (where xxxxxxx are random alpha-numerics):
> > > /home/user/.mozilla/firefox/xxxxxxx.default-release/prefs.js
> > > 
> > I'm a great believer in keeping salt as simple as possible.
> > In this case:
> > ```
> > echo 'user_pref("browser.startup.homepage", "https://www.qubes-os.org"; ); ' 
> > >> /home/user/.mozilla/firefox/*.default-release/prefs.js :
> >    cmd.run
> > 
> > ```
> > 
> > If you *do* want complexity, your 1st try is a non-starter, as you've
> > discovered.
> > In the 2nd, I wouldn't use a variable name which is also the name of a
> > salt module. Nor would I use `ls` and `file.find` together - what's the
> > point? Otherwise that looks workable.
> > 
> 
> I agree to use salt-KISS but, with using the command line in salt renders it 
> somehow less useful from my point of view. For example I've to be careful not 
> to execute that script twice etc.

Actually, in this case you *dont* need to worry about that, because
afaik firefox will only keep the last entry and will prune the others.

> 
> You're right with the second try. I just mixed 2 solutions into 1 during 
> copying.
> This one fails basically with the same error.
<snip> 
> Any other suggestions?
> 

```
{% set filenames=salt['file.find']('/home/user/.mozilla/firefox', 
'name=prefs.js') %}
{% for value in filenames %}
{{ value }}:
  file.append:
    - text: 'user_pref("browser.startup.homepage", "https://www.qubes-os.org";); 
' 
{% endfor %}
```

The problem with this is that it relies on you having started firefox
already (to generate the .mozilla entries).
You used to be able to get the same effect before opening by editing
/etc/firefox-esr/firefox-esr.js , but that doesn't seem to work. In any
case you would need to do this in the template.
I'm sure you can find the right place to edit *before* starting firefox.

unman

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20200715130911.GA16571%40thirdeyesecurity.org.

Reply via email to