modifying files with salt

50 views
Skip to first unread message

lik...@gmx.de

unread,
May 18, 2020, 4:01:09 PM5/18/20
to qubes...@googlegroups.com
Hi!

I'm trying to modify the /etc/fuse.conf

by using this sls file:

-----------------------------------
modify-config-files:
file.replace:
- path: /etc/fuse.conf
- pattern: "# mount_max = 1000"
- repl: "mount_max = 1000"
- append_if_not_found: True
# - dry_run: True
------------------------------------

Result is:
Execute a packaged state run, the packaged state run will exist in a
tarball available locally. This packaged state
can be generated using salt-ssh.

CLI Example:

.. code-block:: bash

salt '*' state.pkg /tmp/salt_state.tgz 760a9353810e36f6d81416366fc426dc md5


The file /etc/fuse.conf is not changed afterwards.
Google couldn't help me to resolve that problem. Any hints here from saltstack pros?

unman

unread,
May 18, 2020, 9:03:11 PM5/18/20
to qubes...@googlegroups.com
I'd probably use file.uncomment in this case.

For file.replace try rewriting your file:

/etc/fuse.conf:
file.replace:
- pattern: ^#.*mount_max.*
- repl: "mount_max = 1000"
- append_if_not_found: True

That should work.

lik...@gmx.de

unread,
May 19, 2020, 4:12:08 PM5/19/20
to qubes...@googlegroups.com
On 2020-05-19 02:03, unman wrote:
Thank you very much again. That worked.

gal...@gmail.com

unread,
May 21, 2020, 11:09:54 AM5/21/20
to qubes-users
Hello.

I've copied what you have done here and it works.

I want to add the version number to my template so that it is called 'template-web-31' instead of 'template-web'. I can do this and create the template but it won't update the template. The update worked before I added the version number to the template name.

unman

unread,
May 21, 2020, 11:58:34 AM5/21/20
to qubes-users
Not absolutely clear, but you're either not targeting in top file or in
qubesctl --targets call
Reply all
Reply to author
Forward
0 new messages