So I’ve removed a few options that I hope should not be too
controversial, and also applied some code cleanup.
I think ansible-command is going to be a WIDELY used program, so I
want it to be really simple and not have terribly many options.
(I am also probably going to go through the core and eliminate the
uppercase options and minor things like that to /bin/ansible)
I think the main one lost is “save to output file”, which can be
accomplished with the shell. I kept tree output and refined the
output from the --one-time options a minor amount.
I also decided to always include the return codes, since it did not
seem damaging to always include them, rather than making that an
option.
Another option I removed was --host, which allows passing in the
contents of the host list, but it also overrode pattern, which was not
needed.
If pattern is “*”, the correct way to do that is override the host list.
So what I’m thinking is this… if we detect that -H is not a file
name (not os.path.exists), but is a string runner can assume they are
hostnames and auto-split on “,”, and possibly
printing out an alert to stdout. In short, this allows us to reuse
the Runner API versus making each module handle this.
I will probably also make Runner understand askpass such that we do
not have to implement prompting for the password in each helper
script, TBD.
The code stuff shouldn’t be too painful, but I’m trying to do a few
things like not use one letter vars, use under_scores for variables,
and comment things
so the code is extra friendly to new users, and encourages the kinds
of things I’m going for. Obviously other things people want (like
sane indents)
which I am guilty of not doing are important too
Once things stabalize, it will be time to give ansible-command a
manpage and billing on README.md
OT – I’m also working on ansible-playbook, which will take hardly any
options at all since I want most of those sourced from the playbook
itself.
–Michael