Added required as optional argument to get_bin_path(). It defaults to
false. Updated following modules to use required=True when calling
get_bin_path(): apt_repository, easy_install, group, pip,
supervisorctl, and user.
Also removed _find_supervisorctl() from supervisorctl module and updated
_is_running() to not need it.
This is meant to assist all the modules that look for the full path of
an executable. If it is found and is X_OK, returns the full path.
Otherwise, it returns None.
Normally curses is part of the standard library, but this was not
always the case in the past.
The ANSIBLE_COLOR environment variable and the tty-check have
priority over the curses method (as they are both faster than
the curses test).
The 'hostname' variable is then unicode, which breaks interpolating
stdout etc. contents into the output strings (they are bytes and cannot
be converted to Unicode using ASCII codec)
Paramiko does not allow Unicode strings as parameters, so encode
the command to UTF-8.
Test case:
ansible localhost -m raw -a 'echo ą'
(also tested on local and ssh transports without problems)
The default is 0, which means all hosts. If set to 1, each host would run a playbook all the way through before moving
on the next host. Fact gathering is still parallel, regardless of the serial setting.
Added an ANSIBLE_CONFIG variable to poteentially override
~/.ansible.cfg
Used os.path.expanduser against all paths that might be read in to allow
~ to be used in config files. I'd have preferred it if os.path.expanduser
took None as an argument but it doesn't.
If remote_port *is* set in the ansible config file, then it will be
interpreted as a string (at which point ssh.connect fails with an
obscure message). Most other numeric variables are handled by
the OptionsParser which takes a type variable when setting up the option -
but remote_port is not an option, so never cast to int.
It might be worth adding a type field to get_config that defaults to a string.
That could be e.g. file or int, which then casts it correctly.