[openstack-dev] [TripleO] Forming our plans around Ansible
David Moreau Simard
dms at redhat.com
Fri Jul 7 21:31:10 UTC 2017
On Fri, Jul 7, 2017 at 1:50 PM, James Slagle <james.slagle at gmail.com> wrote:
> (0) tripleo-quickstart which follows the common and well accepted
> approach to bundling a set of Ansible playbooks/roles.
I don't want to de-rail the thread but I really want to bring some
attention to a pattern that tripleo-quickstart has been using across
it's playbooks and roles.
I sincerely hope that we can find a better implementation should we
start developing new things from scratch.
I'll sound like a broken record for those that have heard me mention
this before but for those that haven't, here's a concrete example of
how things are done today:
(Sorry for the link overload, making sure the relevant information is available)
For an example tripleo-quickstart job, here's the console  and it's
corresponding ARA report :
- A bash script is created  from a jinja template 
- A task executes the bash script 
My understanding is that things are done this way in order to provide
automated documentation and make the builds reproducible.
One of Ansible's greatest strength is supposed to be it's simplicity:
making things readable and straightforward ("Automation for Everyone"
is it's motto).
It's hard for me to put succintly into words how complicated and
counter-intuitive the current pattern is making things so I'll provide
1) When a task running a bash script fails, you don't know what failed
from the ansible-playbook output.
You need to find the appropriate log file and look at the output
of the bash script there.
2) There is logic, conditionals and variables inside the templated
bash scripts making it non-trivial to guess what the script actually
ends up looking like once it is "compiled".
If you happen to know that this task actually ran a templated bash
script in the first place, you need to know or remember where it is
located in the logs after the job is complete and then open it up.
3) There can be more than one operation inside a bash script so you
don't know which of those operations failed unless you look at the
This reduces granularity which makes it harder to profile,
identify and troubleshoot errors.
4) You don't know what the bash script actually did (if it did
anything at all) unless you look at the logs
5) Idempotency is handled (or not) inside the bash scripts, oblivious
to Ansible really knowing if running the bash script changed something
Here's an example ARA report from openstack-ansible where you're
easily able to tell what went wrong and what happened .
Now, I'm not being selfish and trying to say that things should be
written in a specific way so that it can make ARA more useful.
Yes, ARA would be more useful. But this is about following Ansible
best practices and making it more intuitive to understand how things
work and what happens when tasks run.
Puppet is designed the same way: there are resources and modules to do
things. You don't template bash scripts and then use Exec resources.
Documentation and reproducible builds are great things to have, but
not with this kind of tradeoff IMO.
Surely there are other means of providing documentation and reproducible builds.
TripleO is complicated enough already.
Actively making it simpler in every way we can, not just for
developers but for users and operators, should be a priority and a
theme throughout the refactor around Ansible.
We should agree on the best practices and use them.
David Moreau Simard
Senior Software Engineer | Openstack RDO
dmsimard = [irc, github, twitter]
More information about the OpenStack-dev