Commit Graph

27 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov ea1f0c084f Add OS_CACERT env variable
Once internal CA is used, that is not part of default trust store,
we need to ensure that openstack clients will use system-trust instead
of the default one provided by certifi library.

Change-Id: Ibe6b59b497fa665b722b648a57cb5568b1b29b5f
2021-06-24 11:42:34 +03:00
siavashsardari fdc640ddcb Adding support of system scoped openrc and clouds.yaml
Change-Id: Iff5a0892d812601c0fa3fd549b7f00a468cfdd97
Closes-Bug: 1903656
2020-11-17 11:22:47 +03:30
Dmitriy Rabotyagov b79fade909 Add option to redefine locale
Since CentOS do not support C.UTF-8 locale[1] we're placing system
default inside openrc file. If locale can't be found from gathered facts
it's defaulted to C.UTF-8.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1361965

Change-Id: I304bacf0e586b119ac41757b96fa237d2839aaf5
2019-08-13 19:47:19 +03:00
cloudnull 8151224987 Add manila service to openrc file
This change ensures manila clients work with our default openrc file.

Change-Id: I58dab920d2561ffa88064fc89cbf1406e95a3d7e
Signed-off-by: cloudnull <kevin@cloudnull.com>
2019-03-22 20:49:40 +00:00
Marc Gariepy ef3fe9966f Change locale for openrc
When there is a special char in the name of a server or something else,
openstack client cannot print the char and throw this error:
'ascii' codec can't encode character u'\xe8' in position 106729: ordinal not in range(128)

Changing the locale to C.UTF-8 fix this small issue.

Change-Id: I2607f1617c37181c5de2cd49634e6e487f7a22d9
2018-09-28 09:17:43 -04:00
Markos Chandras 82730e54cf templates: openrc: Use 'true' and 'false' for insecure env variables
It seems that most tools are expecting a literal 'true' or 'false' value
for env variables, so use that instead of '1' and empty values.

Change-Id: I36c5460165dba6acd1b94e82c712312f9fd307a9
2018-09-05 12:18:04 +01:00
Markos Chandras a4a43d41e4 templates: openrc: Add missing 'insecure' and 'verify' options
If openrc_insecure is set to True, we need to export OS_INSECURE and
OS_VERIFY in order for API calls to not verify SSL vertificates. We
also need to add similar options to the clouds.yaml file as well.

Change-Id: I50e411c5ff974ff9a0b67aca6e9d7e48db596df7
2018-09-03 09:36:38 +01:00
Kourosh Vivan 93dc5f50df Add OS_AUTH_TYPE env var in openrc file
For gnocchi cli this env var is mandatory in the openrc.

Default value: password

Closes-Bug: 1781552
Change-Id: I1e54d53dd131351dda70d3d166ae8e2029caa1cb
2018-07-13 15:00:22 +02:00
Manuel Buil 2e4a1d87b7 Add tacker to the list of aliases
Change-Id: I5b66363944ca147c519de678bd021ca340dbcddd
Signed-off-by: Manuel Buil <mbuil@suse.com>
2017-10-05 18:40:54 +02:00
Jesse Pretorius 2d65f03066 Make keystone v3 endpoints the default
The logic which previously implemented a
check for v3 in the endpoint does not work
with versionless endpoints.

As versionless endpoints are likely to be
more common, and the v3 auth protocol is
now the defult and the norm, the check is
now done for a v2 endpoint instead.

Related-Bug: #1688320
Change-Id: If4818e6220aba921890e647cfb21e078bb254821
2017-07-19 11:54:53 +01:00
Jimmy McCrory 6848f7d1b7 Quote OS_PASSWORD with single quotes
Use single quotes around OS_PASSWORD to prevent shell variable
expansion. Add a test to validate contents of the openrc file.

Closes-Bug: 1663185
Change-Id: I4b1e7b5cb83061ea35108db545fdfa33cef037a5
2017-02-14 16:17:21 -08:00
Andy McCrae 02a104d77e Quote OS_PASSWORD variable
Unquoted OS_PASSWORD variable can break shell commands when special
characters are used.

Closes-Bug: #1663185
Change-Id: Ia61a4ea1861d0f8792355213443b202b15ab862c
2017-02-14 16:11:48 +00:00
Steve Lewis e14f1f3920 Add alias for OS_ENDPOINT_TYPE
Some service clients do not respect the old OS_ENDPOINT_TYPE
parameter, instead only supporting the newer fashion of
OS_INTERFACE which is viewed as less confusing. This adds support
for that option.

Failure to include this causes SSL certificate errors when the
service clients attempt to use the public endpoint with a self-
signed certificate on defaulted installs, particularly AIOs.

This error can be demonstrated by trying to use the Gnocchi or new
Aodh clients from a utility container, though only the Gnocchi
client is currently installed in the integrated build.

Change-Id: I60af4f0cf56964eaec8980264ec1ebadc550c0b8
2016-08-05 14:23:50 -07:00
Tim Laszlo c6dec23ba1 Define region name variables in openrc and clouds.
Add OS_REGION_NAME to the openrc file.  Replaces openrc_clouds_yml_region_name
with a common openrc_service_region variable.

Change-Id: I68cbd6b2aaa64ef655cfc617a96d428fb2c35d2b
2016-07-23 08:54:45 -05:00
Travis Truman c9d41d3103 Set OS_TENANT_NAME for backward compatibility
Some clients still rely on OS_TENANT_NAME so we
should define and export it. The example client/tool
that appears to rely on it still is Rally, found during
development of:

https://github.com/trumant/openstack-ansible-os_rally

Change-Id: I5bc29ee6b459078f34bc6ac3a8e771a8192de4a1
2016-03-28 14:22:48 -04:00
Travis Truman b199a3cc94 Jinja2 template renamed with .j2 extension
Renamed for hygiene and consistency purposes.

Change-Id: Id17dd108e566eb1e2217a2111b4c3842171a2849
2016-03-04 11:28:42 -05:00
Jenkins d6513b94cd Merge "No longer defining OS_TENANT_NAME in openrc" 2016-03-03 22:54:50 +00:00
Travis Truman c1140af0b1 No longer defining OS_TENANT_NAME in openrc
Change Ifabb4a2aec070c00349e794364a71394feea99f1 in python-cinderclient
1.4.0 means the presence of OS_TENANT_NAME is no longer
required

Change-Id: I8210f8a48f482f19ae3eb70c5ae0bf649a9b856a
2016-03-02 20:32:00 +00:00
Travis Truman 38ef6fc90c Correct filename of clouds.yml to clouds.yaml
According to the python-openstackclient doc, the correct
filename is clouds.yaml. See
http://docs.openstack.org/developer/python-openstackclient/configuration.html
for details.

Change-Id: If7dea05f6787b4dc94369d5f1a6db8dd20741697
2016-03-02 13:33:41 -05:00
Byron McCollum 0cd1a41a6b Implement OpenStack client clouds.yml configuration file
OpenStack client supports defining one or more sets of credentials
inside a clouds.yml configuration file. A default configuration has
been created named `default` that contains the same admin credentials
from the `openrc` file currently being templated.

The default configuration can be specified using the following:

openstack --os-cloud default <command>

Change-Id: Icc0c06a9b9a9e2e75b58fe90b4da9dd46b63e7f4
2015-12-15 20:47:43 -06:00
Bjoern Teipel ea5d604af7 Correct OS_IDENTITY_API_VERSION
The OS_IDENTITY_API_VERSION need to be set to 2.0 instead of 2 when
using the Keystone Identity API version 2. Other settings are currently
not affected

Change-Id: I574bf1c1e908833b139a14b1f402df8db837344b
Closes-Bug: #1506231
2015-10-15 00:28:50 +00:00
Kevin Carter 50f4a968f7 Added LC_ALL to openrc
This commit adds the LC_ALL export to the openrc file to ensure that
the openstack clients and system work with different preset local
settings.

Change-Id: I9f62b9b3db50b70ebdddc724215ebd3b0a138e42
Closes-Bug: #1408935
2015-10-06 17:58:24 -05:00
Julian Montez 43563df716 Add auth version for legacy OpenStack clients
Adding this environment variable expands Identity v3 coverage for legacy
OpenStack CLI clients. This corrects the authentication URLs used even
if v2 is still being used.

Change-Id: I68197ffd12d71a437c482f13520b83cb08d4c9de
Closes-Bug: #1495685
2015-09-21 11:17:18 +00:00
Ian Cordasco 0f2a441d76 Upgrade the Keystone library to use v3
In order to enable and deploy federated Keystone, we need to use version
3 of the Keystone API and the v3 Keystone Client. This work begins that
transition by having a set of backwards compatible library commands.

Specifically, this commit updates the keystone library to use v3
Keystone Client and the usage of ensure_tenant in the os_keystone tasks
to use the v3 admin url.

In version 3 of Keystone's Endpoints (Catalog) API each endpoint only
has one URL and has separate interface types (public, internal, admin).
This change updates all uses of ensure_endpoint to structure the
endpoint data in a better way for the ensure_endpoint command in the
keystone module. As a result, some incidents where internalurl and
adminurl were swapped have been fixed.

Note:
In new deployments the endpoints will be created using the v3 API and
will therefore not be available via the v2 API. This will be a breaking
change to legacy CLI clients. The openstack CLI should be used instead.

DocImpact
Related-Bug: #1470635
Partially-implements: blueprint keystone-federation
Change-Id: I2cd4f505e850b4b113452abc25ee00d486b1637d
2015-07-13 19:41:44 -07:00
Jesse Pretorius c190c7622d Enable all services to use Keystone 'insecurely'
This patch introduces an insecure flag for the Keystone internal
 and admin endpoints:

* keystone_service_adminuri_insecure
* keystone_service_internaluri_insecure

Both values default to false. If you have setup SSL endpoints
for Keystone using an untrusted certificate then you should
set the appropriate flag to true in your user_variables.

This patch is used to enable testing and development with
Keystone SSL endpoints without having to make use of SSL
certificates signed by a trusted, public CA.

The patch introduces a new optional argument (insecure) to the
keystone, glance and neutron Ansible libraries. This is a
boolean value which, when true, enables these libraries to
access Keystone endpoints 'insecurely'. When these libraries
are used in plays, the appropriate value is set automatically
as per the above conditions.

Implements: blueprint keystone-federation
Change-Id: Ia07e7e201f901042dd06a86efe5c6f6725e9ce13
2015-07-10 14:06:25 +01:00
Kevin Carter 34b5861a86 Convert existing roles into galaxy roles
This change implements the blueprint to convert all roles and plays into
a more generic setup, following upstream ansible best practices.

Items Changed:
* All tasks have tags.
* All roles use namespaced variables.
* All redundant tasks within a given play and role have been removed.
* All of the repetitive plays have been removed in-favor of a more
  simplistic approach. This change duplicates code within the roles but
  ensures that the roles only ever run within their own scope.
* All roles have been built using an ansible galaxy syntax.
* The `*requirement.txt` files have been reformatted follow upstream
  Openstack practices.
* Dynamically generated inventory is now more organized, this should assist
  anyone who may want or need to dive into the JSON blob that is created.
  In the inventory a properties field is used for items that customize containers
  within the inventory.
* The environment map has been modified to support additional host groups to
  enable the seperation of infrastructure pieces. While the old infra_hosts group
  will still work this change allows for groups to be divided up into seperate
  chunks; eg: deployment of a swift only stack.
* The LXC logic now exists within the plays.
* etc/openstack_deploy/user_variables.yml has all password/token
  variables extracted into the separate file
  etc/openstack_deploy/user_secrets.yml in order to allow seperate
  security settings on that file.

Items Excised:
* All of the roles have had the LXC logic removed from within them which
  should allow roles to be consumed outside of the `os-ansible-deployment`
  reference architecture.

Note:
* the directory rpc_deployment still exists and is presently pointed at plays
  containing a deprecation warning instructing the user to move to the standard
  playbooks directory.
* While all of the rackspace specific components and variables have been removed
  and or were refactored the repository still relies on an upstream mirror of
  Openstack built python files and container images. This upstream mirror is hosted
  at rackspace at "http://rpc-repo.rackspace.com" though this is
  not locked to and or tied to rackspace specific installations. This repository
  contains all of the needed code to create and/or clone your own mirror.

DocImpact
Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
Closes-Bug: #1403676
Implements: blueprint galaxy-roles
Change-Id: I03df3328b7655f0cc9e43ba83b02623d038d214e
2015-02-18 10:56:25 +00:00
Jesse Pretorius 6083ec14d2 Remove and/or rename Rackspace related bits
This patch removes and/or renames anything that is Rackspace specific
from the playbooks, roles and variables.

It also removes items which appear to be orphaned/unused and flattens
the playbooks into a single directory in order to better match ansible
best practise (and remove some horrible fiddles we were doing).

The following have been removed due to RAX/RPC naming or RAX/RPC
specific usage:
 - playbooks/monitoring
 - playbooks/rax*
 - playbooks/rpc*
 - roles/maas*
 - roles/rax*
 - roles/rpc*
 - scripts/f5-*
 - scripts/maas*
 - scripts/rpc*
 - scripts/*lab*
 - vars/repo_packages/rackspace*
 - vars/repo_packages/rax*
 - vars/repo_packages/rpc*
 - vars/repo_packages/holland.yml

The following have been removed as they are unused:
 - playbooks/setup/host-network-setup.yml
 - roles/openssl_pem_request
 - roles/host_interfaces
 - scripts/elsa*
 - ssh/
 - vars/repo_packages/turbolift.yml

The following directories have been renamed:
 - etc/rpc_deploy > etc/openstack_deploy
 - rpc_deployment > playbooks

The playbooks have all been moved into a single directory:
 - rpc_deployment/playbooks/infrastructure/* > playbooks/
 - rpc_deployment/playbooks/openstack/* > playbooks/
 - rpc_deployment/playbooks/setup/* > playbooks/

The following files have been renamed:
 - lxc-rpc > lxc-openstack
 - lxc-rpc.conf > lxc-openstack.conf
 - rpc_environment > openstack_environment
 - rpc_release > openstack_release (etc and pip)
 - rpc_tempest_gate.sh > openstack_tempest_gate.sh
 - rpc_user_config > openstack_user_config

The following variables have been renamed:
 - rpc_release > openstack_release
 - rpc_repo_url > openstack_repo_url

The following variables have been introduced:
 - openstack_code_name: The code name of the upstream OpenStack release
   (eg: Juno)

Notable variable/template value changes:
 - rabbit_cluster_name: rpc > openstack
 - wsrep_cluster_name: rpc_galera_cluster > openstack_galera_cluster

DocImpact
Closes-Bug: #1403676
Implements: blueprint rackspace-namesake
Change-Id: Ib480fdad500b03c7cb90684aa444da9946ba8032
2015-02-13 18:03:54 +00:00