It's also very helpful to have the region in the task name when you
have multiple regions for a cloud.
Change-Id: I85c0769bb2332a91aa759fb90223ec812dc3e77d
Add the cloud name to make it easier to debug what's going on in each
teask when you have this running on many clouds.
Change-Id: Ife331f8048d18e8ecb8743d1cdedadbdedffa2a2
Under current ansible 2.6 we get the following warning type when running
the cloud launcher:
[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ 'security_groups_rules' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}
Fix this by removing the outer {{ }} from the when statement strings.
Change-Id: I71363f628a8c03784f2ea3fc7082246a6f092f36
While we get a proper os_quota module in Ansible, let's just workaround
it with good old openstack client.
Change-Id: I4036359b09f5bb534143dcb18abe57586b6c8740
Along with the requirements change, there are also needed changes
roles_path and ansible_python_interpreter variable handling, for
some reason latest Ansible did not like current configuration.
Change-Id: I5fc78d479e276711365ea497edd4d3e38cacd650
When we feed a resources.yaml file containing the 'clouds' dict
containing the definitions, the role will happily process all of them.
This is good, but it would also be nice to specify on the command line
that we only want to run the launcher against a specific cloud.
With this change, we can just pass -e "cloud=foocloud" to ansible-playbook
and the launcher will just process the resources for cloud 'foocloud'.
Change-Id: I37cddfbbbb83203ed62434dccac60511f726c6a4
Unfortunately, it seems Glance v2 does not have the capability to upload
an image by referencing a URL, it has to be a local file.
Adding logic to the role and flags should the user want to pull an image
to the Ansible control machine prior to the usual upload.
Change-Id: I2e2886287a045dab89fe712e39b42c2383d6aec6
This is the first attempt at adding support for regions.
Change-Id: If9f7b8b72cc03678e6bd4e188f9dbeaca56b82a1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Since pulling Ansible 2.1.1.0, the role fails with 'item_cloud
not defined' when processing the per-cloud resources.
I believe the issue is due to:
https://github.com/ansible/ansible/issues/17148
Pinning to previous version for now till the issue is fixed.
Change-Id: Ia7275f6bcc308dd0a0509744711c37451546026b
Certain services are expected to be served by more than one server,
think of git mirrors, zuul workers etc.
While we could define all of them with numbered pattern manually
in the resources.yaml file, this gets unwieldy and boring
if the count is large, repeating on and on the same
server stanzas with just <service_name><$NODE_COUNT>.
This change allows to put a 'node_count' attribute to the server
resource. With it, the role will create as many servers as
'node_count' by numbering the servers as <server_name><$NODE_COUNT>.
e.g.
servers:
- name: logstash-worker.openstack.org
image: ubuntu-trusty
flavor: d1
node_count: 2
That would make the role to create two server instances named
'logstash-worker01.openstack.org' and 'logstash-worker02.openstack.org'
Change-Id: I220a2786efe56187f60f1eed2f32e661e6d3ed3f
Currently, shade has a fix to avoid floating IPs timeouts on
server creation, but we need a shade release.
Pulling from dev for now to avoid gate issues.
Change-Id: I49ccca9d5f25f18ef34073bc9831bf078783c2d9
On 301ae3faee refactor, I overlooked
the creation of servers with the generate_keypair flag enabled.
This change adds it back.
Change-Id: I891eba482db38e0b4f97222e37c9bd2e214571d1
Rather than copy-pasting around same tasks but changing slightly
the way we loop them when it's a per-profile or a per-cloud resource,
refactor the code a bit so both mechanisms call the same task.
e.g. the per-profile projects and per-cloud projects will call in the
end create_project, the only thing it varies is the loop prior to getting
the individual project items.
Change-Id: Ida2aebadafd4d60d11fa18aa2208dad235badd4c
This change adds a flag 'generate_keypair' that makes the
role to generate an ssh keypair, create an OpenStack keypair with
it and all the servers of the play will have that key baked in.
The folder, key type and key length are also configurable.
Change-Id: Iccbec24e9834c1fa03da8add94e069f622024537
As the set_hostnames playbook relies on inventory having
hostnames, we put both, so we can ssh to servers via
ansible_ssh_host and we can also infer info from inventory_hostname
to set the hostnames.
Change-Id: I10e153f11f85828c98cf728609a6ca18ae1a8d2a
A user is required to put clouds, but it may or may not use
a profile to define resources.
Therefore, make it optional.
Change-Id: I227dbf04b8e12571bbab58df7fe51d3a2e0d44df