Hi all!
I want to run all my Ansible processes with a lowered process priority, so I cause as little disruption as possible during ansible runs. I’ve figured out how to do this by running renice -n 10 -p $$
in .ssh/rc
.
However, I suddenly got worried that maybe .ssh/rc isn’t read for all Ansible modules/commands/interactions. It definitely works for ansible.builtin.command and ansible.builtin.shell because I use those to check, but maybe there’s some optimization that I don’t know about where some commands bypass .ssh/rc?
Thanks! I hope that makes sense!
-Dylan
Ansible connection plugins like the SSH connection plugin typically respect the native configuration files for the connection type. So any configuration that would affect the ssh
command, will affect ansible’s ssh connections. Personally, I’ve only ever set anything in .ssh/config
not .ssh/rc
, but I would presume Ansible will always use it if ssh
will always use it.
That being said, there are connection options that can be set in Ansible configs, but those generally are used in addition to the system/user configs. I don’t believe Ansible does anything with nice/renice out of the box, but even if it did, it would run it in addition to yours. Either it would conflict and break things, or whichever runs last wins. I doubt you have anything to worry about in this case, but it’s something to keep in mind when you try anything else like SSH control sockets.
1 Like