This moves the main code/class to tripleo-common, as there is a need
to use this in tripleoclient (which already depends on tripleo-common)
Note we don't move the tripleo-ansible-inventory at this time, since
it's not needed for the tripleoclient use-case and it will require
packaging changes.
Depends-On: I03f609b8ff9f36c95a8382aa1705147d99cb973b
Change-Id: Idd6e8f69788e857bc5a81dae344fb41d5be68846
This adds the per-node per-network ips for each network so we
can e.g set the bind ips for services deployed via ansible.
Change-Id: I6085df4741d944875afbe02d71b9e9a85c406024
Each call to output_show is taking around 15 seconds for me, which
causes the entire inventory process to take 90 seconds or more.
Loading the entire stack with outputs resolved only takes around
20 seconds and keeps the total runtime of the dynamic inventory
much shorter overall because it only has to be done once.
The stack is lazy loaded at the first call to __getitem__ because it
seems that Ansible instantiates multiple copies of the class but
never actually looks anything up in some of them, so if we load the
stack in the constructor we just waste time retrieving it
unnecessarily.
This change has reduced the time it takes to run even simple ad-hoc
commands against a small 2 node inventory from 2.5-3 minutes to
45 seconds (which is still too long IMHO, but a step in the right
direction).
Change-Id: I0fcde3f7641ccc26f045fcc8146ec4067e45330c
The ansible_ssh_user in the generated inventory by
tripleo-ansible-inventory is now configurable instead
of hardcoded to heat-admin. The default is still heat-admin.
Change-Id: I137d303e0a5555a0c9e138b548560637c619b492
Closes-Bug: #1710240
When doing --limit <role> for ansible-playbook, it's quite unintuitive
as you need to know to change the case, I would prefer if we made
these groups match exactly with what is in the roles_data.yaml and
output by the heat RoleData outputs.
Change-Id: I2bba5f66e653d9ec4e26f74887261c8541054800
In I50ecb16f924fc5afa327b842d3b2e1427e1351eb we added a service
status check validation for the undercloud. This removes the -api
services as these are being removed/replaced (e.g.httpd)
Change-Id: Ic91312d39a0e2661c9a23206385ccb059d176440
These variables match those provided by the heat-config hook when running
the ansible deploy steps in t-h-t, so adding them to the inventory will
enable also running the same tasks outside of heat in future, which may be
useful for manual upgrades and developer testing.
Change-Id: I433c9c1fad71d8713a74899268f19062ab368290
Depends-On: I2fc48eec77210805c0139fa4abcbf4dd721e7c37
This validation adds a basic health check for the current stack by
making sure all resources are in a *_COMPLETE state. The validation
should be run before an upgrade.
To look up the resources, a new lookup plugin is added as well.
Change-Id: I592ffe13f224dc5275f6bd89829c98a46d3a7472
Implements: blueprint pre-upgrade-validations
Run basic sanity check on the undercloud services state.
Intended for use before invoking a stack update, esp. a minor
update or major upgrade.
Adds a static list of undercloud services to the inventory
for use by other undercloud tasks as a first iteration
Change-Id: I50ecb16f924fc5afa327b842d3b2e1427e1351eb
The inventory currently tries to fetch stack outputs without checking if
the stack exists, so the inventory breaks if the plan has no
corresponding stack.
This patch changes the StackOutputs class to hide heat API exceptions
and return an empty output list instead.
Change-Id: Icb9e6828aeb1f65d8707333fc1098942f1691204
Closes-Bug: #1694712
Currently you can only run ad-hoc commands against roles, e.g
groups of nodes (unless, perhaps you have all the nodes in dns
or the undercloud hosts file).
We can add groups for each node, such that the nodes are accessible
via both the node name (as displayed e.g via nova list) and the IP,
e.g
ansible -i /usr/bin/tripleo-ansible-inventory overcloud-controller-0 -m shell -a 'uname -a'
This may also be useful for performing rolling updates via ansible
in future.
Depends-On: I61efac5634e9b6fbb820e693c71a0adae5fa8b6a
Change-Id: I40192f009812ae9fa2bdc44d59d8b4e241318f39
This change adds additional host group sections for each enabled service
to the inventory. Each of these service-based sections contains a
`children` attribute that lists the roles which have the service
enabled. (The stack's `EnabledServices` output is used for this).
The change allows to target validations not just by role but by the
service name, such as "rabbitmq" or "keystone".
Change-Id: I3d1ad63a3d468980cd80685d898e9e7851c3ddb1
This patch updates the tripleo-ansible-inventory to show all roles in
the host list, not just compute and controller nodes.
The retrieval of IPs and stack outputs is slightly refactored: Instead of
retrieving them from Nova, the host IPs are now read from the stacks new
RoleNetIpMap output. The stack outputs are fetched from heat via a new
`StackOutputs` class that ensures outputs are only fetched when needed.
Closes-Bug: #1685544
Closes-Bug: #1689789
Change-Id: Ic8a19f15dd45b383a3f3d403653e3eaef2c1865b