21 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Alex Schultz
85d9cf4956 Revert "post_deploy: support python3 for undercloud scripts."
This reverts commit 1143714b340cc5a3c9ed422af54fc12993067005.

So we're actually changing this out in packaging. It'll fail
if you deploy from code, but the fedora version of the 
package should end up with /usr/bin/python3. This is why
we didn't hit this in CI.

https://review.rdoproject.org/r/#/c/18465/

Change-Id: Ibad6ff84b33ae3d6011c87028fe02695eea69482
2019-01-23 00:23:02 +00:00
Emilien Macchi
1143714b34 post_deploy: support python3 for undercloud scripts.
Use str_replace to use Python3 interpreter when needed in cloud_yaml.py
called by undercloud_post and standalone_post.

Also for undercloud_post.py and undercloud_ctlplane_network.py.

Change-Id: I48d779c0b142d885214ca4c2158f61f7f886ebf7
2019-01-22 12:58:34 -05: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
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
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
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
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
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
247438dd5a Use /usr/bin/env python to autodetect python
https://review.openstack.org/#/c/564024/ used
/bin/python as the shebang but this can be different
for different platforms, switch to /usr/bin/env to
handle it.

Also update undercloud_ctlplane_network.py to use
/usr/bin/env for consistency, although this file
is not executable.

Change-Id: Id915ded03ae5a471ffa2dca13e2da90021279f63
2018-05-24 10:22:39 +05:30
Harald Jensas
e947c7e610 Add ctlplane networking for routed networks
* Add a new post install software deployment which runs
a python script to configure the undercloud control
plane network. Replaces section in post shell script.

Change-Id: I1cd594564d1628a6e1fccb9eadf18b716ccc5c72
2018-03-29 23:32:45 +00:00