On Sun, Jul 12, 2020 at 05:55:56PM +0100, lik...@gmx.de 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 xxx are random alpha-numerics):
> /home/user/.mozilla/firefox/xxx.default-release/prefs.js
>
> 1st try with file.append from saltstack seems not to work with wildcards:
>
> /home/user/.mozilla/firefox/*.default-release/prefs.js:
> ?? file.append:
> ?? - text:
> ?? - user_pref("browser.startup.homepage", "https://www.ecosia.org/;);
>
> 2nd try with a for loop also fails:
>
> {% for file in salt[cmd.run']('ls -l
> /home/user/.mozilla/firefox/*.default-release/prefs.js') %}
> {{ file }}
> { file.find type=f
> name='/home/user/.mozilla/firefox/*.default-release/prefs.js' }
> ?? file.append:
> ?? - text:
> ?? - user_pref("browser.startup.homepage", "https://www.ecosia.org/;);
> {% endfor %}
>
>
> Do you have a 3rd working example/suggestion?
>
>
> Thanks in advance! P.
>
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.
--
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/20200713124825.GB4984%40thirdeyesecurity.org.