Commit Graph

53 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov bef1567a45 Add bridge_type to lxc_container_networks
In order to generate proper config for containers, we should respect
bridge type and bridge name that are defined in lxc_hosts role.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-lxc_hosts/+/868603
Change-Id: Ifcc2f38459877b9760697efac5c23b2ff9adf53b
2022-12-26 16:40:38 +01:00
OpenStack Release Bot 4c6c0225cd Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: I52a2ac12df98edbeba79eb1c39f23bf1b113255b
2022-12-13 13:08:44 +00:00
Jonathan Rosser 29ee8f0e14 Remove support for LXC2 configuration keys
The removal of support for Centos-7 means that it is no longer necessary
to maintain compatibility with LXC2 configuration keys. This patch removes
the code which substitutes LXC3 keys for LXC2 keys.

Depends-On: https://review.opendev.org/742166
Depends-On: https://review.opendev.org/742103
Change-Id: I2911a20a3391e880df80f41eed5c9a8d5e36c2f4
2020-10-05 18:09:10 +01:00
Andreas Jaeger 231d6c7d2f Use newer openstackdocstheme and reno versions
The sync from https://review.opendev.org/733244 updated to
openstackdocstheme 2.2.1 and reno 3.1.0 versions.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: Ic5b77991ef4fe356771041fc71c2930744b23d4e
2020-06-03 19:01:54 +02:00
OpenStack Release Bot 02846a78a5 Update master for stable/ussuri
Add file to the reno documentation build to show release notes for
stable/ussuri.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/ussuri.

Change-Id: I5946da2354a2adf955df3c3eabf4fe2129845f77
Sem-Ver: feature
2020-06-01 13:09:49 +00:00
Andreas Jaeger 17d9a842fa Update docstheme for style
New version of openstackdocstheme (Victoria+) respects pygments_style.
Since this repo is using now Victoria (master) requirements but has
not branched for Ussuri yet, it uses the new version.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

Change-Id: Icb7ee6ec2b567e98d0a1145bfae10d205fb91a25
2020-05-20 18:45:05 +02:00
melissaml 301b5cd5fd Cleanup py27 support
This repo is now testing only with Python
3, so let's make a few cleanups:
- Remove setup.* files, those are not needed
  for this repo
- Cleanup */source/conf.py to remove now
  obsolete content.
- Remove install_cmd from tox.ini, the default is fine;
  move constraints into deps, cleanup

Change-Id: I6dae70865bac5abb0d394e93c2a854e74c2689d7
2020-04-27 20:17:51 +02:00
Dmitriy Rabotyagov 724c9efb1a Replace git.openstack.org with opendev.org
This patch replaces git.openstack.org with opendev.org as redirection
from old path was enabled.

Change-Id: I3be8e9e27bcba824012299f320d7f9389caba7ed
2019-11-14 20:37:20 +02:00
OpenStack Release Bot 3702464fda Update master for stable/train
Add file to the reno documentation build to show release notes for
stable/train.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/train.

Change-Id: I962197fa9c061f9a82b147aa04c67287838a8315
Sem-Ver: feature
2019-10-22 18:54:21 +00:00
OpenStack Release Bot fa5d13251d Update master for stable/stein
Add file to the reno documentation build to show release notes for
stable/stein.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/stein.

Change-Id: I3e9d08a943fea462bfb9fe861e5a5c8e7e0a2886
Sem-Ver: feature
2019-04-08 09:15:10 +00:00
Jesse Pretorius a14dcc8489 Resolve btrfs backing store variable inconsistency
In Ica79472568799098ebf83c6cefc585f117975f37 some incorrect
variable names were used. This patch changes the variable
names to suit their purpose and ensures that they are used
consistently throughout the role.

Change-Id: If9e912641b5b6cb7791221b40dd4d56e215c2b98
2019-01-07 17:17:26 +00:00
chengebj5238 e1d266fb8f Correct spelling mistakes
Change-Id: I3b3066d2ffbba806503042a6a7a0290b899458df
2018-11-22 20:00:06 +08:00
OpenStack Release Bot b9f89aa3bc Update reno for stable/rocky
Change-Id: I146eceaa52eb8de3dc3acdb7d00e51da07ed2035
2018-08-10 16:44:58 +00:00
Jonathan Rosser 2f14860628 Allow special purpose container interfaces
Some use cases such as public facing dns servers for Designate
are difficult to deploy with the dynamic inventory as they have
a hard requirement for fixed IP on certain interfaces. An additional
variable allows the deployer to create these special interfaces.

Change-Id: I4f0ac58f2d5c19fea1606fe1fbb011bb1a36f7b4
2018-05-31 18:36:57 +01:00
Zuul 61fcf1af80 Merge "Add container journal linking" 2018-03-24 14:58:59 +00:00
Kevin Carter 72a16fd9e5 Add container journal linking
The container and host can link journals giving operators the ability to
log stream and check on the health of a system without needing to login
(attach) to the container. This change implements journal linking for
LXC containers following the reference systemd specification.

Reference implementation:
https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--link-journal=

Change-Id: Id68cf39a77b5dd9c13c010829b47cd7a414378bc
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-24 01:45:25 +00:00
Kevin Carter 846b4f9ed2 Allow deployers to define the container type
The variable `lxc_user_defined_container` has been added which allows a
deployer to define the container variable file in use for a given
container type.

Depends-On: https://review.openstack.org/554383
Change-Id: Ia1373bfa916b4add49a8444d2e4553f898650328
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-24 01:18:07 +00:00
Markos Chandras 49309c4a92 Always create containers with fixed MAC addresses
Patch I0d83fd4895d4c5beaf5a84a239c1a1ed71521dee dropped the ARP=yes
option for networkd because it's not supported by old systemd releases.
This however brings back a problem where the default one sysctl
arp_notify option in the kernel may not correctly set for our use case.
Containers are created with random MAC addresses so we need to ensure
that ARP entries are populated correctly when a container is restarted.
Instead of having to implement some sort of a new workaround on the host,
it's probably better to create all containers with fixed MAC addresses from
now on.

Change-Id: I8ad390fc3ce27756f26c57c92aaa3adc8e506a17
2018-03-06 17:00:36 +00:00
Kevin Carter 815ece7454 Unify container network interfaces with networkd
Unify container network interfaces using Systemd Networkd for ubuntu,
centos, and openSUSE. This change allows the role to use a single way to
configure container networks.

Care has been taken to ensure we're able to cleanly upgrade to the new
capabilities within existing environments without breaking any feature
compatibility or causing any container restarts.

It's also worth noting that all of the pre/post networking up/down
script options have been converted to systemd "oneshot" services. This
retains the ability to run adhoc scripts post network availability
while also opening up this capability, which used to be ubuntu only,
to all of our supported operating systems.

> Our usage of `lxc-attach` was removed in favor of `nsenter` to fix a
  issue where multiple `lxc-attach` commands issued to a single physical
  host could result in a hang.

> Scripts that were being generated inline have been placed into
  template files. This solves a long standing memory consumption issue
  when creating lots of containers. The old shell tasks will now be 
  executed from a generated script. While this should also help with 
  debugging, the main driver is to ensure better system stability.

> A lot of cleanup has been done throughout the task files and
  templates. In the process of updating the role to use unified
  networking a lot of duplicate tasks, scripts, and processes have
  consolidated.

> Handlers have been added for network connection wait conditions and
  to various service restarts.

> The OSA plugins have been added to this role as a dependency. We
  rely on the connection plugins throughout the stack however we were
  doing a lot of workarounds to cater to the possibility of a deployer
  running this role without them. This change simply adds the plugins
  as a known dependency which allows for a more streamlined setup.

Change-Id: I5d3ddcfa11d575648a69a04f2fb30236c2c89da3
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-01 10:55:14 +00:00
OpenStack Release Bot d69d576fa9 Update reno for stable/queens
Change-Id: Ife16e3eed7b04d8a7123e85440cd71ae962f235f
2018-02-14 15:45:42 +00:00
Andreas Jaeger 3f9819bec6 Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I035c3f5c0d4f63d24e015c74a0d25979553e920a
2017-11-17 07:45:00 +01:00
Jesse Pretorius ed224c54a6 Initial OSA zuul v3 role jobs
This patch implements an initial set of jobs intended to match
the current job execution method. It does not intend to improve
how the jobs are executed - only to replicate what is currently
in openstack-infra/openstack-zuul-jobs and provide the platform
to iterate on.

Change-Id: If86f31a6ff188c57c5981dcf9eddc26af7101b25
2017-10-17 22:17:20 +01:00
Kevin Carter 3c22200109 Update the LXC container create role
The LXC container create role has not been updated to use some of our
more well throughout patterns and layouts. This change updates the role
so that its following our normal role conventions and simplifying task
execution.

New tags have been added to follow the basic tag pattern found in all
other roles. The two tags now supported are lxc-config, and lxc-create.

The creation backends have been seperated out into dynamically included
files. This will reduce our "skips" which will improve execution time
and assist developers in understanding what is happening when a
container is created. Stubbs for BTRFS and ZFS container types have been
added so future work can continue on those two store options without
impacting our normal workflow.

All task files have been updated to use the "lxc_" prefix which follows
the pattern found in everyone of our roles.

Change-Id: I0982a42321cf88f66442b5f766729f17c68e8e4a
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-10-05 09:51:20 +00:00
OpenStack Release Bot 39a4a86162 Update reno for stable/pike
Change-Id: I59beaaa965504093a431fa20f33170a89ab95a1b
2017-08-21 10:36:43 +01:00
ZhongShengping 7554679038 Fix openstackdocstheme settings
To use openstackdocstheme 1.11.0 properly, this patch fixes
some settings according to follow[0].

[0]https://docs.openstack.org/openstackdocstheme/latest/

Change-Id: I136e996d09e775e7974ce3e0efd830fb8497ca76
2017-07-03 16:11:56 +08:00
Nolan Brubaker c744a4bfaf Add option to recreate containers
The `lxc_container_recreate` variable will allow for recreating already
deployed containers using either a playbook or a command line argument.

This option is most useful during an upgrade, where the containers are
thrown away and completely rebuilt from scratch.

Change-Id: I3ba35daf49111a3fdfb2e30cffddd9af23aafb28
2017-06-29 14:40:56 +00:00
Nolan Brubaker e311cb657e Write MAC addresses to local facts folder
This change allows for caching of the MAC addresses between runs by
using local facts on the physical host. This saves calculation time
after the first run, since the facts are effectively cached.

This also means any containers that rely on having stable MAC addresses
(such as neutron agents or rabbitmq) can be recreated with the same MAC
address if the container is destroyed. It will *not* be retained if
destroyed and removed from inventory, however, since the facts rely on
using the exact same hostname.

Change-Id: Id3d13299c1416cc4862437629b32f4309c2dc595
2017-06-29 10:10:07 +00:00
Jenkins aaa69073ce Merge "Add s390x as supported architecture" 2017-06-26 13:52:56 +00:00
Markus Zoeller 3e3d5cd07b Add s390x as supported architecture
The s390x architecture (aka IBM z Systems) supports OpenStack since
the Kilo release. This change adds the necessary tweaks to let
openstack-ansible do its work on that platform.

Change-Id: Ifa788182142b9fb4613007c087dae78eec52c5d9
Co-Authored-By: Chris Beukers <chris.beukers@icu-it.nl>
2017-06-26 15:04:12 +02:00
ZhongShengping 98519c5b22 Switch from oslosphinx to openstackdocstheme
As part of the docs migration work[0] for Pike we need to switch to use the
openstackdocstheme.

[0]https://review.openstack.org/#/c/472275/

Change-Id: Id9888937c5287bf07162e205a51bb4e37527037a
2017-06-26 14:32:02 +08:00
Logan V 4f4fca7507 Use wait_for_connection instead of wait_for to check container
After configuring networking in the container, we used a task to wait
for SSH to respond on the container, using the Ansible wait_for module
trying to connect to port 22.

When managing containers in Ansible using other connection plugins that
use LXC commands on the physical host to execute modules, there may not
be an SSH daemon running within the container. In these situations we
can accomplish the same check without SSH by using the wait_for_connection
module (new in ansible 2.3) to verify that Ansible has a working execution
path into the container, but not necessarily via SSH.

Change-Id: I81beda2590b5f5505b7de9ae94cef06bcbdf2f93
2017-04-27 09:57:27 -05:00
Logan V eeabfbc042 Enhance configurability of LXC net interfaces
Add the ability to append pre-up, post-up, pre-down, and post-down script
entries to the container_networks dict that are dropped along with the OSA
default configurations when templating the container's interface config files.

The keys preup, postup, predown, and postdown will be appended to the OSA
lxc_container_default_{pre,post}{up/down} lists when dropping the interface
config.

Change-Id: Idf15ec17bac03b55638fb8d862e5445093677f23
2017-03-22 11:48:04 -05:00
ji-xuepeng b11955b357 Use https instead of http for git.openstack.org
Trivialfix

Change-Id: I1bc740ed4b77f1061b02e2bab87626675628956e
2017-02-06 21:18:34 +08:00
OpenStack Release Bot 383d47f6f1 Update reno for stable/ocata
Change-Id: I5a6877537264246efd5938c553230e6c49423667
2017-02-03 18:57:39 +00:00
Jesse Pretorius e0ea41b4f8 Add ability to set a container base name prefix
In order to facilitate role-based base containers when
copy-on-write containers are created, a prefix can now
be used to differentiate the base containers.

Change-Id: If8094d5bc6a52524128bcaddff2aaf20acf39833
2016-11-14 13:15:39 +00:00
Kevin Carter f924bfb418 Add an option to generate fixed MAC addresses
This change resolves a long standing issue where a container's mac
address regenerates when it was restarted. In most cases when a
container is restarted and it's mac address is rotated and nothing bad
happens; mac learning will resolve itself given enough time in just
about all situations. However services like neutron-agents are long
lived and are highly sensitive to network changes. These types of
services expect consistent hardware addressing and when mac
addresses rotate may become confused.

To limit the possibility of prolonged downtime caused by mac address
rotation on network sensitive containers an option has been created to
allow a container to have a fixed mac address. If this option is enabled
the container will generate fixed addresses for all networks assosiated
with the specific container. The option is `lxc_container_fixed_mac` and
it has a default value of "false".

Change-Id: Ie1a8dc172c45fc2b4cfa724a2bafa67cb481ba73
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-10-15 05:30:47 +00:00
Andreas Jaeger 78ec7f45c4 Enable release notes translation
Releasenote translation publishing is being prepared. 'locale_dirs'
needs to be defined in conf.py to generate translated version of the
release notes.

Note that this repository might not get translated release notes - or
no translations at all - but we add the entry here nevertheless to
prepare for it.

Change-Id: Ieb84a1478a9062bd19f0bb814f12f6e60f149952
2016-10-06 20:35:06 +02:00
Davanum Srinivas 07135b6faa Update reno for stable/newton
Change-Id: Icc96d6d95375b0f6bce4047c414bbde812da07ed
2016-09-29 18:57:39 +00:00
Jesse Pretorius f75789f963 Implement LVM-backed CoW containers
This patch implements the ability to set 'copy-on-write' as the
'lxc_container_backing_method' for containers where the
'lxc_container_backing_store' is 'lvm'.

Change-Id: I571fe60d6d051a7d377ec95d83a2617e3f0dd384
Depends-On: I0bf227891a85bd7c8db53ca73fc5380b95e514fa
2016-08-22 15:36:22 +00:00
Kevin Carter e48e4fe204 Modify container network create for seamless additions
This change adds the ability for a container to have network interfaces
added without needing to restart to get the interfaces online. Adding
the interface with the container online will be faster and allow for
rolling changes in an environment that may effect critical services that
run from within a container.

Change-Id: I68048ae10cdd52fc3b5c43542686e056237a9305
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-12 17:01:59 +00:00
Jesse Pretorius 019f156ab3 Implement configurable start delay for containers
With the move of the container creation process from each service
playbook into the lxc-container-create playbook/role, it would be
appropriate to ensure that the delay implemented in the service
plays is implemented in the role.

This patch does so.

Change-Id: I473bcccde315ef66f45e912ad33ed665bed3b07c
2016-07-29 19:22:23 +01:00
Jesse Pretorius f26d4075e8 Allow container bind mounts to be set in group/host vars
To reduce the number of times a container is restarted during the
build process, this patch implements the facility to consume
LXC bind mounts items from the inventory.

This allows bind mounts to be set in group_vars and therefore have
them applied on container creation instead of later when the service
install playbook runs.

Previously the container_commands option was used, but the bind
mounts are a special case which are better served with its own
set of tasks to ensure that everything needed is in place on the
host and in the container.

Needed-By: Ie2a0528fbd56c8360dd679f55fb2047e0a061c31
Change-Id: I72cdc607d7b4364d78c840bf688e43e013f40709
2016-07-28 14:03:03 +01:00
Jenkins 05459b1cac Merge "Add release note for extra LXC command options" 2016-07-26 12:59:15 +00:00
Jesse Pretorius c9a9b940e0 Add release note for extra LXC command options
This adds a release note for https://review.openstack.org/344262

Change-Id: I40d07239d7369ac2af74426dcaa31530ef0591fc
2016-07-26 10:35:22 +00:00
Jesse Pretorius dc03ef6acf Allow extra LXC command options via group/host vars
To reduce the number of times a container is restarted during the
build process, this patch implements the facility to consume
LXC container_command items from the inventory.

This allows any arbitrary command, such as the creation of a bind
mount directory, to be set in group_vars and therefore have it
applied on container creation instead of later when the service
install playbook runs.

Change-Id: I2aa015a136d6efca501797430d82f1461c303edf
2016-07-26 11:30:26 +01:00
Kevin Carter f7fb95fbe1 Allow a deployer to disable container restarts
This changes allows a deployer to disable a container restart
by setting the option ``lxc_container_allow_restarts`` to ``false``.

Forward port based on:
 - https://review.openstack.org/344834
 - https://review.openstack.org/346064

Change-Id: I2c681d7e0681f8586286dc9f371d7b5e231bda68
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-07-26 01:17:55 +01:00
Jesse Pretorius 68e382ba2c Implement overlayfs-backed containers
Since overlayfs is now part of the mainstream kernel, it makes sense
to take advantage of it to speed up the container creation process.

This patch implements the ability to set 'overlayfs' as the backing
store for containers. This is an optional feature which must
explicitly be set by the deployer.

As this only works with Ansible > 2.0 a pre-requisite check has been
implemented to protect against its use with prior versions. The
inventory and key prep playbook have been adjusted to work with
Ansible versions <2 and >2.

The logging for the veth cleanup has been removed as overlayfs
containers do not have access to the /dev/log device. This causes
the container setup to be incomplete.

Depends-On: I20123b83af10c0890f4d5945b9fb230acd664213
Change-Id: If5b11ef6d94fe863a75efd174957ad43b9d2e030
2016-07-17 16:13:59 +00:00
Jesse Pretorius fb3afe5978 Update sphinx configuration
This patch updates the sphinx configuration for docs and releasenotes
to make it easier to replicate across repositories and to comply with
pep8 testing without exceptions.

Change-Id: I9ad5b8912ce67c4c1b7f722dd0cc280ccd4a8c2e
2016-07-12 16:51:07 +01:00
adreznec 41800e3eae Add Ubuntu ppc64le support
This commit adds support for container creation on Ubuntu ppc64le.
It maps the ansible architecture to the correct lxc architecture
and sets the container arch accordingly.

Change-Id: I1f142686d7190e5bfe7147366d406381b5011725
2016-06-29 22:58:51 -05:00
Jimmy McCrory ccddfc7731 Fix container hostname for RFC 1034/1035
In lxc-container create this update will ensure we're using good
hostnames. This is required in some logging cases as well as SSL.
This will also allow a deployer to customize the domain name based on
their needs.

A new variable has been created called ``lxc_container_domain`` with a
default value of "openstack.local". This change has no upgrade impact as
any changes that need to happen within an existing environment will be
automatically taken care of without impacting the functionality of an
existing deployment.

This is largely based on Ib31a48dd480ecb376a6a8c5b35b09dfa5d2e58f6, with
the intent being to move the tasks from a playbook in the integrated
repo to the lxc_container_create role, and with the addition of limiting
127.0.0.1 to localhost within /etc/hosts.

Change-Id: I9e72699354a467478742281cab74690e66b6a652
Co-Authored-By: Kevin Carter <kevin.carter@rackspace.com>
2016-05-06 19:40:59 -07:00