[openstack-dev] [TripleO] An experiment with Ansible
james.slagle at gmail.com
Thu Jul 20 22:21:22 UTC 2017
Following up on the previous thread:
I wanted to share some work I did around the prototype I mentioned
there. I spent a couple days exploring this idea. I came up with a
Python script that when run against an in progress Heat stack, will
pull all the server and deployment metadata out of Heat and generate
ansible playbooks/tasks from the deployments.
Here's the code:
And an example of what gets generated:
If you're interested in any more detail, let me know.
It signals the stack to completion with a dummy "ok" signal so that
the stack will complete. You can then use ansible-playbook to apply
the actual deloyments (in the expected order, respecting the steps
across all roles, and in parallel across all the roles).
Effectively, this treats Heat as nothing but a yaml cruncher. When
using it with deployed-server, Heat doesn't actually change anything
on an overcloud node, you're only using it to generate ansible.
Honestly, I think I will prefer the longer term approach of using
stack outputs. Although, I am not sure of the end goal of that work
and if it is the same as this prototype.
And some of what I've done may be useful with that approach as well:
However, I found this prototype interesting and worth exploring for a
couple of reasons:
Regardless of the approach we take, I wanted to explore what an end
result might look like. Personally, this illustrates what I kind of
had in mind for an "end goal".
I also wanted to see if this was at all feasible. I envisioned some
hurdles, such as deployments depending on output values of previous
deployments, but we actually only do that in 1 place in
tripleo-heat-templates, and I was able to workaround that. In the end
I used it to deploy an all in one overcloud equivalent to our
multinode CI job, so I believe it's feasible.
It meets most of the requirements we're looking to get out of ansible.
You can (re)apply just a single deployment, or a given deployment
across all ResourceGroup members, or all deployments for a given
server(s), it's easy to see what failed and for what servers, etc.
FInally, It's something we could deliver without much (any?) change
in tripleo-heat-templates. Although I'm not trying to say it'd be a
small amount of work to even do that, as this is a very rough
-- James Slagle
More information about the OpenStack-dev