Change temporary directory (/tmp) on salt-minions

235 views
Skip to first unread message

czeche...@gmail.com

unread,
Jun 14, 2016, 9:33:56 AM6/14/16
to Salt-users
Hi,

On our production systems the /tmp partitions are mounted with 'noexec'.
Is it possible to change in Salt the location temporary files? Would be easier than rewrite all  sls files...

Thanks,
Tamas

Colton Myers

unread,
Jun 22, 2016, 1:39:06 PM6/22/16
to salt-...@googlegroups.com, czeche...@gmail.com

What piece of salt is executing code out of the tmp directory? I’m sure we probably do it but I couldn’t think of any instances off the top of my head.


Colton Myers

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

czeche...@gmail.com

unread,
Jun 23, 2016, 7:30:31 AM6/23/16
to Salt-users
E.g. cmd.script

It's ok now: I enable execution on /tmp before apply states and remount it with noexec after finished.

ReedH

unread,
Jun 23, 2016, 9:17:54 AM6/23/16
to Salt-users
We had the same problem. Any time you run a script using cmd.script the script gets copied to the /tmp directory on the minion to run. We have set a security policy to have /tmp mounted with noexec.

To get around this we use the cwd option on cmd.script:

salt 'Target*' cmd.script source=salt://somescript cwd=/some/path

you can add the cwd option to the cmd.script command in the sls file as well.

czeche...@gmail.com

unread,
Jun 24, 2016, 4:59:45 AM6/24/16
to Salt-users
Yes, it works fine as well.
Thanks!!
Reply all
Reply to author
Forward
0 new messages