Commit Graph

57 Commits

Author SHA1 Message Date
Zuul 4b8b68e0a2 Merge "Fix .gitreview after rename" 2019-09-16 16:43:44 +00:00
Andreas Jaeger 0acd3425d7 Ignore ansible-lint errors
Ignore some ansible-lint errors so that jobs pass again.

Change-Id: I4f0ed9268a5778ba7cf006f7346379afd6a27052
2019-09-16 17:54:53 +02:00
Andreas Jaeger fb5d625d0c Fix .gitreview after rename
Fix .gitreview after rename of repo to opendev namespace.

Change-Id: I9c438606d2350d59e26b35d07f124f11591c4839
2019-09-16 16:28:52 +02:00
OpenDev Sysadmins 60e701bb38 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:50:22 +00:00
Zuul fa10b18a4f Merge "Add region to task output" 2018-11-07 00:29:55 +00:00
Ian Wienand 01858ea602 Add region to task output
It's also very helpful to have the region in the task name when you
have multiple regions for a cloud.

Change-Id: I85c0769bb2332a91aa759fb90223ec812dc3e77d
2018-11-07 11:10:56 +11:00
Zuul cc2d4c8b62 Merge "Add the cloud name to more task details" 2018-11-06 23:41:23 +00:00
Ian Wienand 7dc9777628 Add the cloud name to more task details
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
2018-11-07 10:09:15 +11:00
Clark Boylan 472065fb05 Don't use deprecated when jinja2 syntax
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
2018-09-06 13:53:09 -07:00
Ricardo Carrillo Cruz 126a547f04 Add quotas support for the cloud launcher
While we get a proper os_quota module in Ansible, let's just workaround
it with good old openstack client.

Change-Id: I4036359b09f5bb534143dcb18abe57586b6c8740
2016-10-14 21:01:39 +00:00
Jenkins 441d54913f Merge "Add user roles support for cloud launcher" 2016-09-30 08:54:12 +00:00
Ricardo Carrillo Cruz 702c099e05 Add user roles support for cloud launcher
Change-Id: I3d12403a79b0551ff993816b24829f9bf7424ad4
2016-09-29 23:40:34 +02:00
Jenkins b1aba4583f Merge "Add support for keystone roles" 2016-09-29 20:57:37 +00:00
Ricardo Carrillo Cruz 30364cf669 Pin Ansible version to 2.1.2.0
Change-Id: I9c5d24e5fdc937687458b50f3c38a2a4c3fa3a9f
2016-09-29 21:12:31 +02:00
Ricardo Carrillo Cruz 9a4ad9406f Add support for keystone roles
Change-Id: I2df8503bb713827f0f04691c2f259dc9541c9c83
2016-09-28 16:29:08 +02:00
Ricardo Carrillo Cruz 901ff94f59 Run cloud launcher with latest release candidate
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
2016-09-17 19:32:44 +00:00
Jenkins ca83ba0d2b Merge "Revert "Pull shade from master on venv"" 2016-09-13 10:38:53 +00:00
Ricardo Carrillo Cruz fa645b641e Provide a human-readable output on role executions
The output of Ansible is hard to read, so adding tasks names to
all tasks for better debugging.

Change-Id: I6e4dfa0fbcefca4521d0650d6dd46bcf753b38f8
2016-09-07 16:02:22 +02:00
Ricardo Carrillo Cruz 1b56aed513 Ability to run the launcher against a particular cloud
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
2016-09-02 12:18:11 +00:00
Ricardo Carrillo Cruz fe8af280a4 Add ability to download an image from the Internet to upload it to Glance
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
2016-09-01 23:35:40 +02:00
Paul Belanger 11483dafd4
Initial support for regions
This is the first attempt at adding support for regions.

Change-Id: If9f7b8b72cc03678e6bd4e188f9dbeaca56b82a1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-08-25 13:46:33 -04:00
Ricardo Carrillo Cruz 10f5672ec6 Revert "Pull shade from master on venv"
This reverts commit c562601fb5.
The fix on shade already merged and we got a release with it.

Change-Id: I705ff5a9ec8dc731a4a7dfcaceb4d0aa787fa573
2016-08-25 10:01:47 +02:00
Ricardo Carrillo Cruz 66aa6dcd6a Pin Ansible to 2.1.0.0 to avoid loop_var being undefined
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
2016-08-24 21:15:15 +02:00
Ricardo Carrillo Cruz 205f4d31de Add support for clustered servers
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
2016-07-20 14:49:03 +02:00
Jenkins 6438dea321 Merge "Add created servers to cl_servers_just_created group" 2016-07-20 12:20:43 +00:00
Ricardo Carrillo Cruz 601e29432d Add created servers to cl_servers_just_created group
This hook allows to run things afterwards  on the servers
created by the role on the play context.

Change-Id: If9dc3235cf785dbc04a0c797991bce3a8d987cd0
2016-07-20 12:21:22 +02:00
Ricardo Carrillo Cruz c562601fb5 Pull shade from master on venv
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
2016-07-20 12:15:51 +02:00
Ricardo Carrillo Cruz 0f933d768a Fix creation of servers with on-the-fly keypairs
On 301ae3faee refactor, I overlooked
the creation of servers with the generate_keypair flag enabled.
This change adds it back.

Change-Id: I891eba482db38e0b4f97222e37c9bd2e214571d1
2016-07-19 17:24:18 +00:00
Ricardo Carrillo Cruz 301ae3faee Refactor the per-cloud and per-profile code
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
2016-07-19 00:12:44 +02:00
Ricardo Carrillo Cruz 59c05c8048 Add post test hook function
Change-Id: Icfe3d5a4f4226d36885664bb95a370ada13c630f
2016-07-18 10:09:49 +02:00
Ricardo Carrillo Cruz adc37970ab Add ability to generate keypair on-the-fly
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
2016-06-22 13:14:03 +00:00
Ricardo Carrillo Cruz 0622bb8088 Make tests to use libraries from tox venv
Change-Id: I64b5e4f675c2b807d3712c9fe72d0c809fb1d948
2016-06-02 06:40:53 +00:00
Jenkins 437bbac039 Merge "Add tox.ini and tests playbooks" 2016-05-27 10:57:00 +00:00
Jenkins abcd121c0b Merge "Do not loop profile resources on cloud without profiles defined" 2016-05-27 10:36:35 +00:00
Jenkins 85010a4250 Merge "Remove .1 reference from loop" 2016-05-27 10:33:21 +00:00
Ricardo Carrillo Cruz 5938a2a4be Remove .1 reference from loop
This is not a subitems loop, but a plain with_items loop

Change-Id: Ib83a0badbf0fca82c6c31c4296b50fe463d8a145
2016-05-27 10:30:53 +00:00
Ricardo Carrillo Cruz 78849ac851 Do not loop profile resources on cloud without profiles defined
Without this, the role fails if a cloud has no profiles defined
due to a missing key.

Change-Id: I364d427ebce75677abffe955d08b706b94ff19ac
2016-05-27 10:25:23 +00:00
Ricardo Carrillo Cruz f3eb4acb90 Fix per-cloud routers loop
It was referencing subnets, probably a previous copy-pasta.

Change-Id: I6db9d84fbec89243e9c0bdc3f4d347b4e3acfe45
2016-05-27 10:22:23 +00:00
Ricardo Carrillo Cruz 125f8812dc Add tox.ini and tests playbooks
Change-Id: If8896976ad9330cd71044fcfbf8ce893639e1324
2016-05-27 09:52:31 +00:00
Jenkins eba28dfdf1 Merge "Add requirements.txt file for pip" 2016-05-26 15:32:51 +00:00
Ricardo Carrillo Cruz 241dd8d150 Add requirements.txt file for pip
Change-Id: Iebc09a94ec0a4676c1cc73359a720b1bb76d2a9b
2016-05-26 15:29:46 +00:00
ricardo.carrillo.cruz@gmail.com bd2003ce3a Set both the hostname and ip address for servers created
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
2016-05-25 16:14:59 +00:00
Ricardo Carrillo Cruz 047e9ab687 Add created servers to dynamic group
This provides a hook for subsequent plays to do things
on servers created by the role.

Change-Id: I1870c1974abece12dc13b0d6c259d930e1e67dd0
2016-05-24 21:39:46 +00:00
Ricardo Carrillo Cruz bacf4d2788 Make resources.yml profiles optional
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
2016-05-16 17:02:49 +00:00
Ricardo Carrillo Cruz 19f0a35047 Add test-requirements.txt for tox venvs
Change-Id: I098359b4e0a51d0057c536e703fb3e6f9e0adcd8
2016-05-05 09:08:45 +00:00
Ricardo Carrillo Cruz 4d242279de Add doc folder
This is needed for generating docs

Change-Id: Ibf8d58e9cea4514c238614581da5fcc232525edb
2016-05-04 13:41:57 +02:00
Ricardo Carrillo Cruz c4ba79bea3 Add .gitignore
We don't care about docs build folder and other generated stuff.

Change-Id: Iefd07b121f2805a7e354b3a95b60b1ca2e84d831
2016-05-04 13:39:21 +02:00
Ricardo Carrillo Cruz 5613f4b540 Add setup.py and setup.cfg
These are needed for sphinx to build docs

Change-Id: I6ff472e4036a4f1a04941bec46a54809f9243de7
2016-05-04 13:35:32 +02:00
Ricardo Carrillo Cruz 4531f7958e Switch README from markdown to rst
Change-Id: I7a53d456dbc7a3b8e2b6c20332f7a544bf48b9f3
2016-05-04 13:31:43 +02:00
Ricardo Carrillo Cruz c90e324170 Add Apache license file
Change-Id: I17a6f79cda44d9ffa7db160fd0348f21c9148dba
2016-05-04 13:07:36 +02:00