How can I use my bash aliases when using cmd.run?

10 views
Skip to first unread message

Jon Doe

unread,
Apr 27, 2017, 12:06:33 PM4/27/17
to Salt-users
Hello,

I am a newbie to salt and only want to use remote command execution (been using Puppet for years for configuration management), e.g. for scripting regular checks. One of those checks e.g. would be 'egrep "error|warning|fatal|fail" /var/log/daemon.log'.
Now, when I login via SSH, I have configured "alias egrep='egrep --ignore-case" in my "~/.bashrc" but I noticed that bash is not used by salt and therefore the alias is missing.

Of course, I could add "--ignore-case" to my cmd.run, but I would have to do this for every single check, so I am looking for a cleaner solution. 
Is there a way to have cmd.run load those bash aliases?


Lars

Reply all
Reply to author
Forward
0 new messages