11 Commits

Author SHA1 Message Date
Michal Nasiadka
6af32ae579 Fix ansible-lint errors
Add jinja[spacing] to warn list and fix name[play] issues.

Change-Id: Ie9d1d92e8c2fc2e69e0d1fd14ec859ebc67f6a38
2022-09-06 09:35:31 +02:00
Mark Goddard
ced8a4a528 Support linux bridge in addition to OVS
While OVS was used initially due to availability of a
networking-generic-switch driver for it, Linux bridge can be useful for
environments where OVS is not available.

This is configured via bridge_type variable. It defaults to
'openvswitch', but may be set to 'linuxbridge'.

Change-Id: I750a73cebc743edcbcd8c23c67e4920d0058bead
2020-03-13 11:12:37 +00:00
Mark Goddard
6e2bb04fae Add playbook tags
Allows for easily running specific playbooks.

Change-Id: Ia859238042eb286b61758acd8f99361c10dc0a05
2019-03-27 16:43:13 +00:00
Mark Goddard
7ad354c2af Use node state rather than 'cmd'
There are two cases when we may want to delete things:

1. if a desired node configuration or spec changes, we delete existing node
   resources.
2. if we use the teardown.yml playbook, cmd == teardown, delete
   everything, including global state.

In both cases, Tenks state (state.yml), all nodes to be deleted are given a
'state' of absent'. We should therefore use this rather than the 'cmd' variable
which only works in the latter case.

Change-Id: Icc033340c7fd882e61d90e3d086f7ba4a5b673bf
Story: 2004907
Task: 29257
2019-01-31 14:59:47 +00:00
Mark Goddard
6a2fb44a78 Fix deploy and teardown without node enrolment
If the ironic_config field is not present in a node definition, then
that node should not be registered with ironic. In this case we also
don't need to query glance for images or wait for resources to appear
in placement.

If nova_flavors is empty, we do not need to register flavors, so no need
to install the client or check for OS_USERNAME.

Also fixes an issue in the action plugin where it would fail if
ironic_config field is not present in a node definition.

Finally, in CI deploy/teardown tests, rather than skipping tasks, we now
remove the ironic_config field from the node definition, and set
nova_flavors to empty, such that we exercise these code paths.

Change-Id: I29b42665f1609c99e80f12ab6f3815d0e0918dae
Story: 2004412
Task: 28056
2018-11-22 19:20:59 +00:00
Will Miller
99eaf48098 Persist physnet indices in state file
Instead of overwriting the physnet mappings specified in the Tenks
configuration, create a separate dict that maps physnet names to their
indices. Like physnet_mappings, this will be present for each
hypervisor.
2018-09-14 10:27:21 +00:00
Will Miller
caffd7bfaf Add new tenks_state_update plugin
Instead of just an allocations file, Tenks now uses a 'state' file. This
contains the node allocations, as well as physical network mappings and
indices. Clusters can also now be re-deployed with different specs to
update the state.
2018-09-13 16:58:50 +00:00
Will Miller
877e7eba77 Fix veth_pair_state typo 2018-09-10 14:44:38 +00:00
Will Miller
56b0019258 Restructure playbooks for multiple commands
Much of the logic in the existing 'deploy' playbooks could be reused for
a teardown command, so it didn't make sense to duplicate this. Instead,
rename/restructure playbooks such that they refer to an area of
responsibility, rather than an action.

Also, make some changes to allow a new 'teardown' action.
2018-09-10 14:19:02 +00:00
Will Miller
cfb7c05e30 Move node enrolment up a level
Call node enrolment from the top level deploy.yml playbook, to make it
easier to skip enrolment if necessary. Rename to fit the scheme of
second-level playbooks.

Also, fix variable scoping issues by giving a different name to the
temporary variable used when calling the scheduling module. This ensures
that all future tasks correctly reference the allocations from the file.
2018-09-06 09:08:11 +00:00
Will Miller
e39d080dd9 Split deployment into stages 2018-09-06 08:19:41 +00:00