94 Commits

Author SHA1 Message Date
ramishra
454b45c7d2 Set OS_CLOUD instead in stackrc
We now write clouds.yaml when configuring keystone and
can use OS_CLOUD instead. Setting OS_AUTH_URL overrides
when we want use OS_CLOUD pointing to overcloud.

Closes-bug: #1931172
Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/795225
Depends-On: https://review.opendev.org/c/openstack/tripleo-validations/+/795293
Change-Id: Ib42fc397389d8b50c740edf334fe6f281c392ec6
2021-06-10 23:11:22 +05:30
ramishra
c9991c2e31 Use 'wallaby' heat_template_version
With I57047682cfa82ba6ca4affff54fab5216e9ba51c Heat has added
a new template version for wallaby. This would allow us to use
2-argument variant of the ``if`` function that would allow for
 e.g. conditional definition of resource properties and help
cleanup templates. If only two arguments are passed to ``if``
function, the entire enclosing item is removed when the condition
is false.

Change-Id: I25f981b60c6a66b39919adc38c02a051b6c51269
2021-03-31 17:35:12 +05:30
Harald Jensås
679ecaada0 Set dns_name propery on ports and networks
Neutron's dns_assignments field includes a nice pice of
structured data. This is a prerequirement for Designate
usage. (No plan's to use that, but being a bit ready
does'nt hurt.)

  {"hostname": "my-vm",
   "ip_address": "192.0.2.16",
   "fqdn": "my-vm.example.org."}

Enable for the undercloud:
 - dns_domain_ports ml2 extension driver

Change-Id: I46eb9a24dd66821b27524fe4d1fdab617b6fa948
2020-04-03 08:57:38 +02:00
Zuul
c7d42ca119 Merge "Use /usr/libexec/platform-python in undercloud post" 2020-03-31 04:00:49 +00:00
Harald Jensås
e41a3e65c6 Use /usr/libexec/platform-python in undercloud post
CentOS 8 undercloud installation is failing because
/usr/bin/env python does not exist. Update the
python scripts to use platform-python.

Closes-Bug: #1869714
Change-Id: I459410950503c42cc39a91c64e56f69aa0a34d20
2020-03-30 17:27:42 +02:00
Rabi Mishra
e16b4e522b Remove most of the mistral related undercloud post config
Leaves the workbook/workflow creation part as we still have
some more workflows to migrate yet.

Depends-On: https://review.opendev.org/713773
Depends-On: https://review.opendev.org/714567
Change-Id: I54d21e486ef2c1fc6eed9b79e5a7f08f221935f7
2020-03-26 08:31:55 +05:30
Zuul
914ca3eb28 Merge "Remove upload_validations workflow execution" 2020-01-06 19:17:53 +00:00
Emilien Macchi
25a2045e62 Deploy /etc/openstack/clouds.yaml with Ansible
Replace the python script that was run on post-config, by an Ansible
task running on the host where Keystone is running.

It'll be useful later when using OpenStackSDK to have access to the
credentials during the deployment and not having to wait the far end.

It's also reducing the Heat resources.

Depends-On: https://review.opendev.org/#/c/700015
Change-Id: I585abc3e6a3b9b8ae9183e0b5170df2e39301e17
2019-12-19 20:09:08 +00:00
Gael Chamoulaud
d31b694a2c
Remove upload_validations workflow execution
The 'tripleo.validations.v1.upload_validations' workflow has been
removed from tripleo-common, this Undercloud post installation step
could be safely removed.

Change-Id: I55495b932c682367a0b336741319aa31b0dcbcd2
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2019-12-16 13:22:38 +01:00
Zuul
a829e57fd8 Merge "Undercloud ctplane router for IPv6 RA's idempotent" 2019-10-12 08:01:07 +00:00
Harald Jensås
4befee5f22 Use parameter for ipv6 address mode
Use the parameter UndercloudCtlplaneIPv6AddressMode
to control ipv6 address mode for the provisioning
network instead of hard-codeing to dhcpv6-stateless.

Change-Id: I549f930853539a7cd665a00d7ec3fd1705f819fb
Closes-Bug: #1847606
Depends-On: I7de5f5487065d20068229e0d34102be6119fbeef
2019-10-10 16:06:26 +02:00
Harald Jensås
3bbd48216a Undercloud ctplane router for IPv6 RA's idempotent
Check if the router exists before creating it. The undercloud
re-install fail's when using IPv6 provisioning network since
the router already exists.

Also, don't create the router if routed networks is enabled.
In this case the router in the infrastructure should handle
router advertisements.

Change-Id: I5bc0a88bbb7912bb10693ce393ac89365f29a940
Closes-Bug: #1844767
2019-10-10 12:24:27 +00:00
Takashi Kajinami
f47dfe1059 Enforce pep8/pyflakes rule on python codes
This change makes sure that we apply pyflake8 checks on all python
codes to improve its readability.

Note that there are some rules applied for other OpenStack projects,
but not yet turned on, which should be enabled in the future.

Change-Id: Iaf0299983d3a3fe48e3beb8f47bd33c21deb4972
2019-09-05 15:40:46 +09:00
Alex Schultz
b96f83dfa1 Filter nameservers for undercloud networks
We can have both ipv4 and ipv6 networks defined and could end up having
a mix of addresses passed into the undercloud configuration. Neutron
throws an error if the ip address type doesn't match the network being
created (e.g. ipv4 nameserver for ipv6 cidr and vice versa). Let's
filter the nameservers to ensure we only set the appropriate ip version
nameserver for the network.

Change-Id: I184797270dbb6c70cae11bc98128890529035690
Closes-Bug: #1841805
2019-08-28 10:26:09 -06:00
Zuul
b881a5e8e7 Merge "Move the Hiera symlink task from post configuration to deployment steps." 2019-07-31 02:27:36 +00:00
Zuul
c8cc9b2830 Merge "Enable mistral_executor to perform backups" 2019-07-29 21:09:07 +00:00
Luke Short
3b813d845c Move the Hiera symlink task from post configuration to deployment steps.
This helps to consolidate the Undercloud and Standalone deployments. It
also avoids an issue where the Ansible Python interperter cannot be
found.

Change-Id: I01a95be975011d2419a523da572503e0ebcfa49b
Resolves: rhbz#1733608
Signed-off-by: Luke Short <ekultails@gmail.com>
2019-07-29 16:48:03 -04:00
Martin Magr
70d41af00a Enable mistral_executor to perform backups
Moving undercloud deployment to container means that during execution
of undercloud backup mistral-executor does not have required connections
and data available and so creates empty tarball currently. This patch is
one of many, which are supposed to fix this. On THT side we need to:

- Include DB host IP address in tripleo.undercloud-config env
  - we need to have this information about undercloud IP available
    as we cannot connect to local socket anymore and using 'localhost'
    does not work.

- Mount directories which are meant to be backed up
  - currently directories backing up directories local to mistral_executor
    are useless for undercloud backup

Change-Id: Ia1fd60a13570a42f5243beb5bb0487c743e31d27
Partial-Bug: #1812960
2019-07-25 14:30:46 -04:00
Chandan Kumar (raukadah)
41d9901ef2 Reuse clouds_yaml.py from tripleo-common in tht
clouds_yaml.py script is used to generate clouds.yaml
for undercloud and standalone. It is now refactored and moved
to tripleo-common module[1] and can be reused here.

[1.]https://review.opendev.org/#/c/664586/

Related-Bug: #1719369
Depends-On: https://review.opendev.org/#/c/664586/

Change-Id: I50b37df1a87472a16e2d5d2c588c728d2a7a5c76
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
2019-07-11 17:04:35 +00:00
Zuul
c576556c58 Merge "Drop EC2MetadataIp parameter and its uses" 2019-07-09 19:15:48 +00:00
Zuul
b8ae663e73 Merge "Remove the tripleo.plan_management.v1.publish_ui_logs_to_swift cron trigger" 2019-07-09 03:12:56 +00:00
Harald Jensås
7a52a6986e Drop EC2MetadataIp parameter and its uses
Since https://review.opendev.org/656581 is merged (and the revert,
reverting the revert ...) there is no metadata service running.

This change removes all things related to setting up routes
to the metadata service, i.e the EC2MetadataIp. As well as NAT
firewall redirect rule used only on the undercloud but disabled
by default.

Blueprint: nova-less-deploy
Change-Id: Ic4ea74b45c566048e32dde82d2bf00498f932af6
2019-07-05 14:05:59 +02:00
Rabi Mishra
39a5545c41 Change OS::Heat::*Deployments to OS::Heat:*DeploymentGroup
Those are hidden resource types in heat. Changing these types
would not result in replacement of the resources.

Change-Id: I22d23a8f187263bd36e364f0cd3301c830f3220b
2019-07-04 20:21:06 +05:30
Dougal Matthews
d665a2bb03 Remove the tripleo.plan_management.v1.publish_ui_logs_to_swift cron trigger
This was only used by tripleo-ui and is no longer needed.

Change-Id: I3c7854654cb7238ee6297c6178ee6d55402be40a
Related-bug: #1835242
2019-07-04 13:21:18 +01:00
Harald Jensås
dae0a89a80 Use per-subnet DNS nameservers for ctlplane
Use the DNS nameservers for each ctlplane subnet,
instead of using the same DNSServers for all subnets.

Related-Bug: #1834306
Depends-On: I0dc03eddf9ea00ff33cd3ae0cdc8f42a4961e89c
Change-Id: I4c102d8f728a90cf9eb90f6129738377a8d2503c
2019-06-26 11:20:21 +02:00
Emilien Macchi
016279b71e standalone/undercloud - post: use EndpointMap to fetch Keystone URL
Using EndpointMap to ensure we get the hostname/fqdn if possible
otherwise it fallbacks to the IP for Keystone public endpoint.

This is useful when the operator uses a certificate based on
hostname/fqdn and not an IP address.

Closes-Bug #1763776
Change-Id: Ifa9d55cca90caf5be0c83507cb47447e25311fce
2019-05-21 08:41:22 -04:00
Gael Chamoulaud
7bf040e8f9 Fix minor typos
* s/wrokbooks/workbooks/
* s/execututed/executed/

Change-Id: I7a5ce8e67da59dc8a33dce06099f819d8807653e
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2019-04-09 13:49:24 +02:00
Harald Jensås
42b0bc930a Support ctlplane subnet host routes from undercloud.conf
Change: I692fcc4a494b2cda1911814a53a0c6ec2f99f807 in
python-tripleoclient added support to define host routes
for the subnets in undercloud.conf.

Update the undercloud ctlplane network post script so
that it add's these routes to the host_routes property
of the undercloud ctlplane subnets.

THT already uses the data in the subnets host_routes, it
is passed as ControlPlaneStaticRoutes to NetworkConfig
unless ControlPlaneStaticRoutes was statically overriden
in the environment.

Closes-Bug: #1819464
Depends-On: I692fcc4a494b2cda1911814a53a0c6ec2f99f807
Change-Id: I46b7c7175f542ad4d375a20f133c05064e7b7222
2019-03-12 16:01:22 +01:00
Carlos Camacho
166803d05f Include the DB password in a Mistral environment for creating backups and restores
We need to include also the Undercloud DB in a Mistral
environment to be able to create the DB backup from the CLI.

Now, we do this using python and THT but we didn't include it.

Change-Id: If503e733b103a34ae5639eb56dfae05f9783d59a
Closes-Bug: 1812839
2019-01-22 16:08:03 +01:00
Harald Jensås
00cecfe2f3 Add a tag's containing subnet cidr to ctlplane network
Since the ctlplane network and it's subnets are created
outside of the overcloud heat templates we cannot in an
easy way create a list containing the cidr of each of
the ctlplane subnets in THT.

Prior to routed networks we only had one subnet and was
able to create the NetCidrMapValue by reading the cidr
value of one of the ControlVirtualIP resource. When we
have multiple subnets on each network we should make
NetCidrMapValue contain lists of cidrs for each network.

By setting a tags on the ctlplane network, one
per subnet, containing each individual subnets cidr the
tags can be loaded via the ControlVirtualIP resource so
that we can have NetCidrMapValue contain all the cidrs
of the ctlplane network.

Change-Id: I7d9a951d0c156c83430c1e326bc8edcb52b08537
Partial: blueprint tripleo-routed-networks-templates
2019-01-06 18:20:05 +01:00
Zuul
c8094771b4 Merge "Use calculated undercloud ctlplane DHCP allocation pools" 2019-01-03 09:54:59 +00:00
Harald Jensås
88ab644bdf Use calculated undercloud ctlplane DHCP allocation pools
Change: I4ba148f465b4c452bd5b2c31009ac8a2897bcd5f makes
dhcp_start and dhcp_end optional for non-local subnet
definitions in undercloud.conf.

Start using the AllocationPools parameter istead of the
legacy DhcpStart | DhcpEnd parameters.

Closes-Bug: #1806512
Closes-Bug: #1807707
Depends-On: I4ba148f465b4c452bd5b2c31009ac8a2897bcd5f
Change-Id: Ifdf3e9d22766c1b5ede151979b93754a3d244cc3
2018-12-22 16:06:04 +00:00
Alex Schultz
2913e57412 Add python interpreter to ansible postconfig
In order to specify which version of python we should use for the
deployment, we need to pass in the python interpreter into the
postconfig where we are directly calling the ansible heat hook.

Change-Id: I9dfc72269f800395a9864c457a5a43f7590c8e75
Related-Blueprint: python3-support
2018-12-18 22:17:51 +00:00
Jill Rouleau
971d97bf99 Correct file modes for rpmlint failures
Numerous files have incorrect modes set. Correct these so that executables
have 755 and yaml files are 644 to address rpmlint errors.

Change-Id: I8db36209b41a492f6b85e3469994de884bf556e8
2018-12-14 13:21:28 -07:00
Zuul
2557bfdf14 Merge "Create clouds.yaml for the undercloud" 2018-12-04 16:30:30 +00:00
Zuul
ba86e3944b Merge "Don't set boot_option=local on baremetal flavors" 2018-11-28 04:45:15 +00:00
Zuul
0bfeeccfe6 Merge "Allow enabling routed networks on undercloud update|upgrade" 2018-11-22 17:12:50 +00:00
Harald Jensås
afa16ae150 Create clouds.yaml for the undercloud
Add the cloud to clouds.yaml for the undercloud so
that it is available for post deploy script's.

The clouds.yaml is created both in the stack users
home directory ~/.config/openstack/clouds.yaml and
globally for the system in /etc/openstack/clouds.yaml.

Update standalone post configuration to use the same
code to create and update clouds.yaml on standalone.

clouds.yaml is used when setting up client's in other
post scripts instead of passing all the options to
each script.

Partial-Bug: #1801927
Change-Id: I6402fa561745bacf184b1ad2ada44bf8f7c75324
2018-11-22 13:54:54 +01:00
Derek Higgins
3d9e7731b5 Don't set boot_option=local on baremetal flavors
Setting boot_option_local is no longer required as its the default.
So setting this is redundant.

Migrate existing flavors to remove boot_option if set to local.

Change-Id: Ib793acc98641091bcde2580b725656976e5d6625
Depends-On: I9fbe12f7878328f0ca084e29483f30d18dad1773
Related-Bug: #1803965
2018-11-21 10:18:27 +00:00
Harald Jensås
3892154d5a Allow enabling routed networks on undercloud update|upgrade
Since Rocky neutron has support to enable routed networks on
existing an network and subnet if certain conditions are met.
The tripleo undercloud does meet these conditions.

This change updates the extraconfig post script that creates
the neutron ctlplane networks. Any non routed network is
updated to a routed network if 'enable_routed_networks' = True
in the configuration.

Closes-Bug: #1790877
Change-Id: Idf2dd4c158d29b147d48153d3626cf403059d660
2018-11-20 02:53:18 +01:00
Chandan Kumar
50b048cf0d Set flavor property resources:MEMORY_MB to 0
* https://review.openstack.org/#/c/614540/ converts undercloud
  post deploystep to python where property resources:MEMORY_MB
  was setted to 1 but earlier it was zero. It fixes the typo.

Change-Id: If26e17cb2079ef994cc0e0506cbf40bf9023808e
2018-11-13 17:56:50 +05:30
Zuul
2ffe5d65f9 Merge "Fix hiera condition in UndercloudCtlplaneNetworkDeployment" 2018-11-10 03:46:51 +00:00
Harald Jensås
0312050421 Move UndercloudPostDeployment to python
Configuring Nova (quota, flavors) and Mistral (workbooks,
workflows, etc.) is a lot faster if we do it in python.

Initial undercloud install - 3.5x faster
----------------------------------------
Run deployment UndercloudPostDeployment ---- 130.50s  < Shell
Run deployment UndercloudPostDeployment ----  37.39s  < Python

Re-Running undercloud install - 10x faster
------------------------------------------
Run deployment UndercloudPostDeployment ---- 405.01s < Shell
Run deployment UndercloudPostDeployment ----  39.95s < Python

Change-Id: If7b3ad701e434ed0d606356b9bbab2716d53c5bb
2018-11-08 03:58:11 +01:00
Harald Jensås
f3e55fae5c Fix hiera condition in UndercloudCtlplaneNetworkDeployment
_run_command() returns the output of the command executed.
If the Neutron API is disabled it would return the string
'false' which is in fact True as far as python is concerned.

We also need a depends_on to ensure the link to hiera.yaml
created in extraconfig/post_deploy/undercloud_post.sh is
already in place.

Change-Id: Iec958a92433d3f671862422ac85bc78d7babc01d
2018-11-08 03:53:55 +01:00
Florian Fuchs
44b1f51419 Create default deployment plan
Currently no default plan is created during a container-based undercloud
deployment.

This patch creates a default deployment plan if both of two conditions
apply:
- The /usr/share/openstack-tripleo-heat-templates directory exists
  (We need the templates to create the plan)
- There is no container named `overcloud` in swift yet
  (If a deployment is run more than once we don't want to recreate
  the default plan)

Closes-Bug: #1798590

Change-Id: Id03631432b1fedd75ee3ddba67bfe7d5d6049a07
2018-10-29 10:24:43 +01:00
Emilien Macchi
247a59d8d6 undercloud/stackrc: unset OS_* variables
If we redeploy the undercloud, we want to unset the OS_* variables
before exporting the new ones to avoid any conflict.

Co-Authored-By: Sergii Golovatiuk <sgolovat@redhat.com>
Change-Id: If4fa8533cc1fff33eb27c381ca3ddca96c2d03ca
2018-09-20 15:48:05 +00:00
Dmitry Tantsur
9729870745 Stop hardcoding baremetal API version in stackrc
Long time ago it was required because ironicclient defaulted to
an ancient version. It was changed back in Queens (ironicclient 2.0),
so we can drop it now to avoid confusion.

Change-Id: Icea0bdf6d5dcdd81ce9c34be7af8a241da0861bc
Closes-Bug: #1789392
2018-08-28 12:03:32 +02:00
Sorin Sbarnea
66ae4e94eb avoid unnecessary failure to delete a list of empty workflows
Improved execution output by avoiding confusing errors.

Change-Id: I2b6b03b6ff0178564a21f6b3c8578ac2d5f19023
2018-08-23 19:30:33 +01:00
Alex Schultz
644b45f238 Fix standalone home dir variable
We fixed the name that is used to be standalone but didn't change the
post script. We document the StandaloneHomeDir so we need to address the
template.

Change-Id: I45f1dbb5c7197b80961ead53c4e5b1403ed4e6db
Closes-Bug: #1788413
2018-08-22 07:51:25 -06:00
Martin André
e60f836de4 Fix enabled tripleo-validations check
With the move from instack-undercloud to containerized undercloud, the
hiera key to check for whether the tripleo-validations are enabled
changed from `enable_validations` to `tripleo_validations_enabled`. This
commit updated the check in undercloud_post.sh to use the right key. It
also removed the useless EnableValidation heat param.

Change-Id: I338e139fa770ebb7bdcc1c0afb79eec062fada8b
2018-08-16 11:44:45 +02:00