On Wednesday, August 7, 2013 3:53:20 AM UTC+2, Michael DeHaan wrote:
> if you use ANSIBLE_SSH_ARGS you loose the "sensible ControlMaster options".
This is not the case, you can pass in whatever arguments you wish to pass in, including ControlMaster/ControlPersist.
What I understood is that you have to pass them again. Hence it's not a matter of doing
ANSIBLE_SSH_ARGS="-F new_ssh_config"
but
ANSIBLE_SSH_ARGS="-F new_ssh_config -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r"
and this is only good for today ansible version. Maybe this could change one day.
We can reasonably assume that ansible developers chose the optimal options for the best experience using ansible with ssh (robustness, performance, security, etc.).
Each time somebody use ANSIBLE_SSH_ARGS, to change an unrelated behavior (like the place to look for a config file in this case), he has
- to find parameters used by ansible and put them again in this variable, plus his little variation
- when upgrading to any new version of ansible, to check whether these parameters evolved to keep in sync.
Hence, IMHO, ANSIBLE_SSH_ARGS is a valuable option for a slight temporary behavior change, not for a production configuration.
The user who wanted the ProxyCommand parameter was asking for the same kind of option sprawl that resulted in this command being rejected -- because if you want to set individual ProxyCommands, you can specify an SSH config usign ANSIBLE_SSH_ARGS or the configuration file to specify a configuration file that sets this up on a per host basis pretty easily.
There isn't a reason to add a parameter for every possible SSH configuration parameter in Ansible *UNLESS* ansible needs to have significant behavior changes when those parameters are used.
Sorry that was not very clear on my first post. My paragraph about having bazillions of ssh options was exactly to say what you say: you can't have all of them there. I completely agree on this. And that's also an argument about having an
ansible_ssh_config that could help you deprecate ansible_ssh_(user|private_key_file|host|port) (except if they are really used to change ansible behavior, but I'm not familiar with the code yet)
As for your arguments that it are "not nice", I disagree! It's quite nice and ultimately flexible,
What I would like is this scenario:
A: welcome B. We use ansible. The repository playbook is at g...@xxx.git.
B: (*read ansible doc*) (*apt-get install ansible*) (*git clone xxx*) (*point ansible to the playbook clone*) (*ansible-playbook my_playbook*)
B: thanks, A, it works.
What I would avoid is:
A: idem
B: Idem
B: it's not working
A: oh, I forgot to say that you have to use this special setup about changing ANSIBLE_SSH_ARGS with a very long line, documented somewhere in the wiki
B: ok thanks (*dig in the local doc*)
B: found it but not working yet
A: oh, right, I've heard C has moved the ssh_config file somewhere else in the repository. let's find out where.
My 2 (correlated) points are:
- Everything should be self contained
- You can't commit ANSIBLE_SSH_ARGS, /etc/ansible.cfg or ~/.ssh_config into your repository
Last but not least, how could you manage 2 ssh config files depending on some grouping in the inventory with a global ssh option overload ?
This is simply done like this:
[net1]
webA
dbA
[net2]
webB
dbB
[net1:vars]
ansible_ssh_config=config1
[net2:vars]
ansible_ssh_config=config2
Does it make sense ? Did I miss something important ?