Commit Graph

92 Commits

Author SHA1 Message Date
Emilien Macchi 2f3554cdcb Remove extraconfig/services directory
... and move the services into the deployment directory.

The extraconfig/services directory was initially created for
experimental services using an interface that was work in progress but
is now stable enough, so the services can live among the others for
simplification.

Change-Id: I2bd0b169ed18ea2fccfea4475402dd73076924c8
2019-07-18 14:44:14 -04:00
Zuul 14998e6a5d Merge "Convert Docker*Image parameters" 2019-06-18 08:01:14 +00:00
Carlos Camacho 8c6bec227f Change all step checks to |int
There are still some step checks parsing the
string value, this change moves them all to |int

Change-Id: Ib91525c1aa0413b8af76a60456e31ad9a8eb7bda
2019-06-07 16:11:08 +02:00
Dan Prince a68151d02a Convert Docker*Image parameters
This converts all Docker*Image parameter varients into
Container*Image varients.

The commit was autogenerated with the following shell commands:

for file in $(grep -lr Docker.*Image --include \*.yaml --exclude-dir releasenotes); do
  sed -e "s|Docker\([^ ]*Image\)|Container\1|g" -i $file
done

Change-Id: Iab06efa5616975b99aa5772a65b415629f8d7882
Depends-On: I7d62a3424ccb7b01dc101329018ebda896ea8ff3
Depends-On: Ib1dc0c08ce7971a03639acc42b1e738d93a52f98
2019-06-05 14:33:44 -06:00
Zuul 792f41ceb7 Merge "Introduce OpenShiftAnsiblePath parameter" 2019-03-13 17:43:41 +00:00
Martin André f2412dacf1 Make openshift-ansible working dir owned by tripleo-admin
The openshift-ansible tasks are now invoked with the tripleo-admin
user, which doesn't by default have write access to /var/lib/mistral,
but it does have sudo access.

This change makes /var/lib/mistral/<stack>/openshift be owned by the
tripleo-admin user so that subsequent tasks can write to that
directory.

Change-Id: I7762af7b824ae0c7303438d48fc35c9f24a00c9c
Related-Bug: #1813832
2019-02-19 09:31:19 +01:00
Martin André b1b67ac63c Introduce OpenShiftAnsiblePath parameter
This simplifies the tripleo-heat-templates interface to only offer the
OpenShiftAnsiblePath parameter instead of the myriad of
OpenShift*Playbook parameters, since all of these would very likely be
in the same openshift-ansible directory.

Change-Id: I367a25ae1b03d8bdb712277bd8ade30e53b8af11
2019-01-24 12:44:05 +01:00
Martin André 8a818ab226 Apply changes to cluster using updated inventory
It could cause issue when being on inventory containing nodes marked as
new.

Specifically, it caused an undefined ansible variable error when
re-running the deploy playbook on an inventory that contained nodes in
the new_masters group.

Closes-Bug: #1812962
Change-Id: Iaf9403b5f60f06769d94317d261de8cad94274ab
2019-01-23 11:45:05 +01:00
Martin André ff36d44af5 Generate post-deployment openshift-ansible inventory
This allows to run custom openshift-ansible playbooks with an inventory
that reflects the deployment status.

Related-Bug: #1812962
Change-Id: I94b6ae04a3e31fe0b7951df2446cc91b5842cd77
2019-01-23 11:42:26 +01:00
Martin André 1febc8b7b3 Store nodes information in a dict
Re-using the same variable for each role was not very clean and forced
us to re-check which master nodes were new in the deployment. Instead,
use a dict for `role_nodes` and `new_role_nodes` with keys being the
role name.

This will allow us to re-generate updated inventory in later step
without needing to set the facts once again.

Related-Bug: #1812962
Change-Id: I21ed56a1c4d43a3e0945c8b74dd94ccf89dc05b0
2019-01-23 11:42:26 +01:00
Martin André cb675a91a7 Fix openshift playbook import
I4aa8055fe800723b3e140f8232c9e41e769e11f3 wrongly replaced 'include'
with 'include_tasks' in openshift and kubernetes templates and broke
their deployment, resulting in an ansible error:

  ERROR! 'include_tasks' is not a valid attribute for a Play

Use import_playbook instead.

Change-Id: I0bb9bfabeb06dc9d602ad173ce2d12d1771b6b1f
Closes-Bug: #1812983
2019-01-23 11:42:20 +01:00
zhulingjie a6479d0b51 use include_tasks instead of include
Change-Id: I4aa8055fe800723b3e140f8232c9e41e769e11f3
2019-01-22 04:54:34 +00:00
Zuul 1bcacedb11 Merge "Remove gluster settings from previous deployments on re-deploy" 2019-01-22 00:49:48 +00:00
Zuul f228e94efa Merge "Set container images for openshift 3.11" 2019-01-17 22:25:56 +00:00
Zuul 4b4f7f89da Merge "Remove openshift-ansible customization" 2019-01-17 22:25:51 +00:00
Zuul 11374f4ab8 Merge "Rely on osa defaults for enabled services" 2019-01-17 22:25:46 +00:00
Martin André dfe4f2ddb0 Remove gluster settings from previous deployments on re-deploy
The openshift/global_gluster_vars.yml file was not removed on re-deploy
and caused issue when reploying openshift without CNS after deploying
openshift a first time with CNS.

Change-Id: I0eedca7d53f7d3801f163ab9dd901bfb8651dd2c
Closes-Bug: #1811664
2019-01-14 11:30:02 +01:00
Martin André df8e592498 Restart openshift master services after stack update
For some configs changes, such as the identity providers, it is
necessary to restart the master services in order for them to take
effect.

Change-Id: I6ecb054d0e18acc4dc422a7ce136432d5135c64c
Closes-Bug: #1807668
2019-01-10 09:03:04 +01:00
Martin André bb1a1209ac Rework the generated openshift-ansible playbook
The `prerequisites.yml` playbook should only be explicitly run on
initial deployment to prepare the nodes. It is already included in the
scaleup playbooks for the new nodes so there is no need to include it
again. Re-running the `prerequisites.yml` playbook reconfigures the
container runtime and may cause outage, it is supposed to be run only
once.

Make update and upgrade playbooks exclusive. There is no need to run
both of them.

Add comments to clarify the intent for each playbooks.

Change-Id: I30278360fcc1ffa9bd7ce7cb77d023629fb6fa47
Closes-Bug: #1804790
2019-01-10 09:02:34 +01:00
Martin André 97cf1c274a Let the operator manage openshift updates and upgrades
This remove the upgrade code to ensure that TripleO will not get
involved in the business of updating and upgrading OpenShift clusters
as it currently involved manual steps for clusters using glusterfs.

Instead, the operator is invited to upgrade OpenShift separately from
TripleO and follow the OpenShift upgrade documentation.

[1] https://docs.openshift.com/container-platform/3.11/upgrading/automated_upgrades.html#special-considerations-for-glusterfs
[2] https://docs.openshift.com/container-platform/3.11/upgrading/automated_upgrades.html

Change-Id: I6033525cde40fd44d648cef792efbca6901e88f0
Closes-Bug: #1810812
2019-01-07 18:05:34 +01:00
Zuul fdba8a89e3 Merge "Allow customization of more openshift-ansible vars" 2019-01-05 12:14:20 +00:00
Zuul fd10f25b58 Merge "Call etcd scaleup playbook when adding master nodes" 2018-12-13 17:17:42 +00:00
Mike Fedosin ab6395a644 Set container images for openshift 3.11
Wire in the new openshift 3.11 images with tripleo, so that any
customization applied either via heat param with the integrated image
preparation workflow gets passed to openshift-ansible.

Depends-On: Ibbd5ff9d3597f5add440b92a27a2f2f669f7bdbe
Co-Authored-By: Martin André <m.andre@redhat.com>
Change-Id: I2cb6eac9136f4c24bfc2881ff0aa1ddec7a35fe4
2018-12-13 12:21:00 +01:00
Zuul dbc66fd451 Merge "Add hosts to expected ansible groups" 2018-12-10 12:13:21 +00:00
Martin André 7c4b027a75 Allow customization of more openshift-ansible vars
The `openshift_master_cluster_hostname` and
`openshift_master_cluster_public_hostname` variables are set to IP
addresses by tripleo, but were wrongly combined with the
openshift_global_vars dictionnary in a way that prevented customization
via the OpenShiftGlobalVariables heat parameter.

Reverse the order of the combine to make customization possible as they
should.

Change-Id: I47805608b90d8fda7d8357d3cb55f6372e746da1
Closes-Bug: #1806736
2018-12-04 18:22:18 +01:00
Martin André 3e613f1788 Remove openshift-ansible customization
This commit remove variables passed to openshift-ansible in order to
stay more inline with openshift-ansible defaults.

The removed variables are:
- `openshift_enable_excluders`: use default value from
  openshift-ansible.
- `openshift_use_dnsmasq`: removed from openshift-ansible.
- `openshift_docker_selinux_enabled`: use default value from
  openshift-ansible.
- `containerized`: removed from openshift-ansible.
- `skip_version`: removed from openshift-ansible.
- `debug_level`: use default value from openshift-ansible.
- `osm_controller_args`: use default value from openshift-ansible. The
  provided experimental-cluster-signing-duration setting had an
  extremely low period and could cause nodes to become unreachable in
  the event of cert renewal during the master node failover. See [1] for
  details.

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

Closes-Bug: #1806726
Change-Id: I4d9ae4f4745393aa817f07a542f06faa0c6a5eb9
2018-12-04 18:03:22 +01:00
Martin André e26a5ea3be Rely on osa defaults for enabled services
Tripleo should rely on openshift-ansible defaults as much as possible,
especially concerning the services which are enabled.

This removes the setting that explicitly disabled the service catalog
and template service broker, and wire in the ansible-service-broker
from heat parameters. The service-catalog and template-service-broker
images do not need to be specified since they're derived from the
oreg_url in openshift-ansible.

Change-Id: Ie09696a54ba01f23003366a9f221d2f32f4b0270
Depends-On: Ic358ed27d63015d297f50c10f553fc1c470ea6a5
Closes-Bug: #1806353
2018-12-04 17:51:40 +01:00
Marius Cornea bd51cf5f44 Use InternalApi network for openshift_master_cluster_hostname
According to the inventory examples[1] openshift_master_cluster_hostname
points to an internal hostname/address set on the loadbalancer while
openshift_master_cluster_public_hostname points to the external.
This change sets openshift_master_cluster_hostname to use the InternalApi
network instead of the External network as it is at this moment.

[1] https://docs.openshift.com/container-platform/3.11/install/example_inventories.html

Change-Id: I9efab5b07682efd6b03da433801d636e7d324619
2018-11-30 13:25:03 -05:00
Martin André 4702ad329d Call etcd scaleup playbook when adding master nodes
We're collocating the etcd and master nodes, we should also be run the
etcd scaleup playbook when adding new master nodes to the cluster.
However, this needs to happen in a separate ansible run as the master
node scale up and etcd scale up use different inventory files.

Change-Id: I523ed32681818112b7570aeab3ede32ed4ec322b
Closes-Bug: #1802319
2018-11-14 10:08:48 +01:00
Martin André cca4eb3aeb Add hosts to expected ansible groups
Openshift-ansible expects that on initial deployment the nodes belong
to a <host_type> group, while on scale up, it expects the new nodes to
belong to a new_<host_type> group and not be part of the <host_type>
one.

Change-Id: Ibe461b4a7948813b69a0f85642e01aebb0531043
2018-11-13 13:54:57 +01:00
trown d295cd94b8 Make openshift-master service idempotent
The openshift-master service will fail any time it is used with a
stack update. This is because the openshift_upgrade var is not
defined, but is checked whenever tripleo_stack_action == 'UPDATE'.

This patch adds a check for openshift_upgrade being defined before
checking if it is True.

Closes-Bug: 1794824
Change-Id: I3a598724154a3242b777eefed9304300c45d8c29
2018-11-12 12:59:10 +01:00
Martin André 8caaee30a9 Do not include node scale up playbook in case of new masters
Openshift-ansible gives us a friendly error when we do:

"Please run playbooks/openshift-master/scaleup.yml if you need to scale
up both masters and nodes. This playbook is only needed if you are only
adding new nodes and not new masters"

Change-Id: Ibf52b9dbabc9a4f86c11b7de345c3b73e157435c
Closes-Bug: #1802324
2018-11-12 12:59:10 +01:00
trown 5e462b328b Update to OpenShift 3.11 release
This update the variables to reference v3.11 instead of 3.10 and rework
how to compute the oreg_url osa var due to DockerOpenShiftBaseImage
being deprecated.

Co-Authored-By: Martin André <m.andre@redhat.com>
Depends-On: Ibbd5ff9d3597f5add440b92a27a2f2f669f7bdbe
Depends-On: I764944bda6534f6b799fa0f4fb2e7980c22b1d67
Change-Id: I569f9da7ba9312a726360a3543b920413f445cbe
2018-11-02 22:47:17 +01:00
Zuul 53179d929c Merge "Parametrize OpenShift deployment type" 2018-10-29 22:47:14 +00:00
Zuul 14f5234300 Merge "Set openshift_docker_insecure_registries" 2018-10-22 21:15:53 +00:00
Zuul 6ec469a316 Merge "Do not modify imagestreams" 2018-10-22 20:49:22 +00:00
Zuul 92f4b9afff Merge "Let openshift-ansible configure the firewall" 2018-10-22 20:49:20 +00:00
Zuul c0cc115e9c Merge "Use different base virtual_router_id on openshift" 2018-10-19 18:55:42 +00:00
Zuul 94943cfff9 Merge "Introduce proper steps to external update/upgrade tasks" 2018-10-17 15:03:47 +00:00
Martin André 6ebaeb5c85 Parametrize OpenShift deployment type
This prevents hardcoding it in the template and allows to check for the
right service name during new node detection as origin and
openshift-enterprise deployment types use differnt prefixes for the
services.

Change-Id: Id5cf7d6f7888b759eec7c969275fe15779b7b775
2018-10-17 14:46:02 +02:00
Martin André cbac4c4373 Set openshift_docker_insecure_registries
This variable is used in the docker_image_availability check to
determine how to query the registries for image availability. Setting
this variable allows us to enable the docker_image_availability check
in the gate.

Change-Id: Ia1da542d342228bb28ad487371fad8d3ffc62d0b
2018-10-12 16:36:20 +02:00
Martin André a17b245049 Do not modify imagestreams
The `openshift_examples_modify_imagestreams` ansible variable controls
whether openshift-ansible changes the imagestream registry hosts to be
the same as where the openshift images are pulled. In our case this
points to the container image registry on the undercloud by default.

However, due to how this feature was implemented in openshift-ansible
[1], the imagestreams are only modified when the original value is
registry.redhat.com, i.e. when deploying openshift-enterprise,
explaining why this issue remained unnoticed until now.

[1] 95bc2d2e61/roles/openshift_examples/tasks/main.yml (L52-L55)

Change-Id: I4949f53e966872f775833b8d36d96ef72cf13845
2018-10-12 16:36:20 +02:00
Martin André 26c108b174 Let openshift-ansible configure the firewall
Openshift-ansible already sets the right firewall rules on the
provisioned nodes, there is no need to set up (some of) the rules by
ourselves.

Add the 'OS::TripleO::Services::TripleoFirewall' to all the OpenShift
roles so that the operator can still set additional rules if desired.

Change-Id: I1e8ca10069c3f1017207abfebb803cb7aa3835a8
2018-10-12 16:36:20 +02:00
Martin André 429bc3ca70 Use different base virtual_router_id on openshift
With the default setting, the keepalived that we deploy on the master
node collides with the one that is setup on the undercloud. We simply
need to use a different virtual_router_id_base to prevent
virtual_router_id collision.

Change-Id: I92ef081a111f93ddce4ec42400bcb648b7f7def0
2018-10-11 11:53:20 +02:00
Martin André 73c3cd4181 Fix update tasks for openshift
While introducing the openshift-node service in 7373adc72e, some code
was moved around and that broke the OpenShift external_deploy_task
playbook in the case of a stack update due to undefined ansible
variable.

Rename the new_masters var into new_master_nodes and introduce the
has_new_nodes boolean var that indicates there is at least one new node
in the deployment.

Related-Bug: 1794824

Change-Id: I2f386b5507836deda0816616dd7add8a0b53dfd3
2018-10-11 11:53:20 +02:00
Flavio Percoco a4b31b28e9 Use openshift-ansible container instead of RPMs
This allows us to deploy openshift without the need to install
openshift-ansible in the mistral container image or in the undercloud.

Co-Authored-By: Martin André <m.andre@redhat.com>
Depends-On: Ied75bfbeed71aca83962e60bfc801a2527f5dfba
Change-Id: I1e28e63c8a3a30dfe1e95924f9b4086fcf9513fb
2018-10-11 11:53:20 +02:00
Martin André 39df80b332 Use glusterfs for registry when deploying with CNS
The OCP documentation [1] recommends to use a dedicated GlusterFS
cluster for the image registry. Let it be the default when deploying
with CNS.

[1] https://docs.openshift.com/container-platform/3.10/install_config/persistent_storage/persistent_storage_glusterfs.html#install-advanced-installer

Change-Id: Ife73d7c50c304cff7cd05e08f74855cb107f3c46
2018-10-11 11:53:20 +02:00
Martin André 81ca843ee7 Deploy openshift all in one in scenario009
Previously we were only deploying a master node. This commit adds the
worker and infra service to the deployed node and configures it as an
all-in-one node. In order to do so, we need to disable HAproxy when
deploying in all-in-one as the HAproxy instance Openshift deploys on
the infra node conflicts with the one we normally set up. They both
bind ports 80 and 443.

Also removes the useless ComputeServices parameter that only makes
sense in a multinode environment.

Change-Id: I6c7d1b3f2fa5c7b1d9cf695c9e021a4192e5d23a
Depends-On: Ibc98e699d34dc6ab9ff6dce0d41f275b6403d983
Depends-On: I0aa878db62e28340d019cd92769f477189886571
2018-10-11 11:53:20 +02:00
Martin André 46246e8745 Add heat param for openshift prerequisites playbook
Previously the path to the openshift-ansible's prerequisites playbook
was hardcoded to
/usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml. This
commit introduces the `OpenShiftPrerequisitesPlaybook` heat parameter
to make it configurable.

Also add more explicit description for the other playbook path
parameters and update the default path for OpenShiftUpgradePlaybook
that was broken since the move to openshift-ansible 3.10.

Change-Id: I2260cb8b0cef9650c707d4db917a3281a697912d
2018-10-08 09:25:04 +02:00
Jiri Stransky bcd6cde608 Introduce proper steps to external update/upgrade tasks
So far the tasks for external update/upgrade were not using the step
mechanism as other tasks, we had a single step. As external
deploy/update/upgrade tasks are being used for more things nowadays,
it's likely that we'll need to go towards a similar model like we have
for deploy/update/upgrade tasks -- proper usage of steps.

For now we have just 2:

* Step 0 for setting global facts, and performing validations.

* Step 1 for actual update/upgrade tasks. (There's an upcoming change
  to run online data migrations in step 1).

Change-Id: I1933bd0eedab71caab56c0e5d93ba7927fb7c20f
Partial-Bug: #1793332
2018-10-04 12:08:21 +02:00