57 Commits

Author SHA1 Message Date
Takashi Kajinami
378f34a813 Drop openstack-ansible-linters-ubuntu-bionic
It seems the job was already removed and the remaining reference is
causing a config error.

```
  Job openstack-ansible-linters-ubuntu-bionic not defined
```

Change-Id: I8d1099c4b3fe07e0517d0e82b21a787b2d91fdfb
2024-02-20 10:10:29 +09:00
a1e2335045 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

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

Sem-Ver: feature
Change-Id: I2aa96d3d7b778f7dfee33b272c6c3d6b016feffb
2023-12-07 11:05:45 +00:00
Danila Balagansky
371ff2c1d8 Fix pyargv value rendering
There is no need to escape double quotes in block scalar. This broke
non-OVN neutron-servers which use uWSGI and `pyargv`.

Change-Id: If22d5d2737914a90e0a3868faf3ee6815235a70a
2023-07-25 20:19:29 +03:00
Dmitriy Rabotyagov
83ae6cce1d Fix linters and metadata
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223
Change-Id: I43eaa6d471cf5f8b72febdeda1bf8a6df438eb11
2023-07-12 12:11:47 +02:00
Dmitriy Rabotyagov
3fa317e79a Replace imports with dynamic includes
A weird behaviour has been spotted in AIO, where role, that was
importing python_venv_build and uwsgi roles was failing, as
venv_build_distro_package_list definition from uwsgi role was applied
on upper level even before uwsgi runtime

As a result, previous import was failing with
uwsgi_build_distro_package_list being undefined.

Replacing any import with inlcude was solving the issue. Since we re-use
uwsgi role a lot and using include make sense in the role, we
start replacing static imports from here.

Change-Id: I3b11220dd30a03fd6465f7b5e041027fbd8bad1d
2023-04-13 18:58:32 +02:00
Dmitriy Rabotyagov
085a32d26f Ensure service is restarted on unit file changes
At the moment we don't restart services if systemd unit file is changed.

We knowingly prevent systemd_service role handlers to execute
by providing `state: started` as otherwise service will be restarted twice.
With that now  we ensure that role handlers will also listen for systemd
unit changes.

Change-Id: I802ebfbdec5140b2414086c04ae1297868ec256b
2023-04-10 15:35:42 +02:00
Zuul
e157a116e9 Merge "Allow extra arguments to be passed to the uwsgi application through pyargv" 2023-02-11 11:46:00 +00:00
Jonathan Rosser
19bb89faaa Allow extra arguments to be passed to the uwsgi application through pyargv
Related-Bug: 1987405
Change-Id: I89f7b27838647e4993cc2656d0fded9902e5f7c6
2023-01-31 10:11:31 +00:00
Zuul
cd49d19055 Merge "Enable uwsgi to bind to multiple different IP addresses" 2022-12-30 19:56:28 +00:00
Dmitriy Rabotyagov
a5466a0434 Update tox.ini to work with 4.0
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`


Change-Id: Icb55e725014dd174bf54e00fe89ad1cdd496ccb1
2022-12-27 17:53:06 +01:00
Jonathan Rosser
c354def47a Enable uwsgi to bind to multiple different IP addresses
Previously the template could only insert one http-socket or
https-socket line into the uwsgi configuration file. This meant
a choice between binding to a specific IP address, or 0.0.0.0 to
listen on all addresses.

This patch makes the template distinguish between uwsgi_bind_address
being an iterable list of addresses, or a single address. It is now
possible to specify a number of specific addresses to bind to.

Change-Id: I088a64c65a9f9912091bd10402028db574767ca4
2022-12-19 13:49:33 +00:00
847ee272a1 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: Idf31f2aba788580fd699d7b69cca22fa9cf4f882
2022-12-13 13:06:20 +00:00
Damian Dabrowski
a56b3adcff Install OpenSSL development headers
As it's mentioned in uWSGI docs[1]:
"In order to use https option be sure that you have OpenSSL development
headers installed (e.g. libssl-dev on Debian). Install them and rebuild
uWSGI so the build system will automatically detect it."

This change ensures that required package is installed on the host where
uWSGI is being built.

We don't need to force reinstall during an openstack upgrade because
uWSGI version was bumped in Zed[2] so uWSGI is going to be
reinstalled/upgraded anyway.

According to my tests, OpenSSL development headers are not required for
distro installs.

[1] https://uwsgi-docs.readthedocs.io/en/latest/HTTPS.html
[2] https://review.opendev.org/c/openstack/openstack-ansible/+/864579

Change-Id: Ib3cf675fa22a61ddf800af6276071410163bcf68
2022-12-02 09:55:14 +00:00
Dmitriy Rabotyagov
3ea15d74fa Drop bindep file
We don't really need bindep file on our roles so it can be safely
removed.

At the moment role breaks due to content of bindep as with switch to
Ubuntu Jammy python2 packages are no longer available.

Change-Id: I091d2073bd2d1ba73a6ad026cd1e2d846bac3bee
2022-11-24 18:01:15 +01:00
Erik Berg
fd69759ddf Remove redundant vars line
This line was introduced by I56d130c242b440c02a54f9971bfb4e0866dbbc3d
but should already be covered by the distribution_major_version line
above.

Change-Id: Icbf855ec7ecbddcc05f32febb89067679e3ad7dd
2022-09-15 15:02:52 +02:00
Dmitriy Rabotyagov
d77e0583f2 Remove mention of haproxy-endpoints role
Role was never migrated to usage of haproxy-endpoints role
and included task was used instead the whole time.
With that to reduce complexity and to have unified approach, all mention
of the role and handler are removed from the code.

Change-Id: Ie397e5d28027341a3c3b67ea588dcce035121d19
2022-06-14 18:02:51 +00:00
Dmitriy Rabotyagov
d30b01f30f Switch sphinx language to en
With sphinx release of 5.0.0, they changed default for language variable
to 'en' from None. With that current None valuable is not valid and should
not be used.


Change-Id: I6c7bb111601e7ae04f66b2336164679042169767
2022-05-30 16:01:09 +02:00
Zuul
1ee7758da3 Merge "Refactor installation of libpython for debian/ubuntu" 2022-04-27 11:00:59 +00:00
Jonathan Rosser
6925998659 Refactor installation of libpython for debian/ubuntu
Previously this required a separate vars file for each OS release to
install the correct version of libpython. This change moves to a single
vars file and uses a dictionary to look up the libpython package name
based on the OS distribution release.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/838762
Change-Id: I876339092fc3e68e0fb526e8093851d1de3ff73a
2022-04-21 12:54:07 +00:00
Zuul
940f66ae0c Merge "Refactor use of include_vars" 2022-01-12 14:48:42 +00:00
Jonathan Rosser
de791427dc Refactor use of include_vars
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.

This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.

Change-Id: I54fce299febb8c93434919f1c15a223850045cbc
2022-01-12 07:53:08 +00:00
Damian Dabrowski
924b7d132e Enable recursion in combine() filter
Ansible's combine() filter needs recursive=True parameter in order to recursively merge nested hashes.

https: //docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#combining-hashes-dictionaries
Change-Id: Ifda8ecff5baab4b09e278600181781fd13c8c24e
2022-01-11 19:24:29 +01:00
James Gibson
15008b2e35 Add support for TLS to UWSGI
If user defines a TLS certificate and private key pair for a
service UWSGI will only accept a TLS connection

Change-Id: I1d0e3ec4eddecca3bca62ea5f02914ca0493f2e0
2021-12-09 08:02:02 +00:00
Dmitriy Rabotyagov
fcf2504f68 Refactor definition of lock path
Change-Id: Id6fec2801783c5a323aad23f0fbaf8b5694a8471
2021-12-02 19:27:38 +02:00
Dmitriy Rabotyagov
6341c2a91c Use config_template as a collection
Since we still use ceph-ansible that has their own implementation of
config_template module it's worth to use mentioned module as a collection
explicitly.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819814



Change-Id: Ieeacec78e89d280c1205d074240c30503f7723d6
2021-11-30 15:17:07 +02:00
Dmitriy Rabotyagov
5507c98d1f Install GCC for source installs
GCC presence is required [1] to build uwsgi package  otherwise it will
fail on processing uwsgiconfig.py
While it's got installe with openstack-hosts this might be an issue
when uwsgi is used as a standalone role

[1] 2989143935/uwsgiconfig.py (L714-L720)

Change-Id: I60baab1f6ebbe9e424ebe41967d65a1dcdec4235
2021-08-29 16:49:21 +03:00
Jonathan Rosser
5f2a073243 Use the system trust store for python requests rather than certifi
Custom CA are added to the system trust store, never to certifi.
It is necessary to use the system trust store to cover the scenario
where private or self-signed certificate authrorities are used to
secure APIs that the uwsgi service should communicate with.

The default is changed to the system trust store, and can be overridden
per service through uwsgi_services, or globally through uwsgi_ini_overrides.

Change-Id: Idb532c206c3338b9934dfa47e76170aebbb5a5ef
2021-06-23 16:52:35 +00:00
Jonathan Rosser
95f74142a3 Add support for debian bullseye
Change-Id: Ic7f97ba252191cc2313c2648de0ca90e0ac49ce2
2021-05-13 16:49:49 +00:00
Jonathan Rosser
a47fa00d40 Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I7c7d2dc350b34c0b54d2c92b366d43c210a46796
2021-03-16 09:01:13 +00:00
Jonathan Rosser
13dfe075b1 Switch default python version to python3
Change-Id: I654dd384d98b7c3f8f905fff2f1488e1133b11af
2021-03-10 12:09:38 +00:00
Jonathan Rosser
15f24d11f3 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ibadca3bdce6d7adf51ddce9591a0d404e38d5e71
2021-02-24 14:23:38 +00:00
dmitriy
498241e2e1 [reno] Stop publishing release notes
Since we copy all release notes to the integrated repo there is not need
in publishing release notes for each repository. We should only verify their
validity and linting.


Change-Id: Idff881e8cb7f351c2d6f5d52f9c606f6f1559d1c
2021-01-22 18:29:28 +02:00
Dmitriy Rabotyagov
50a941f552 Allow to globaly override uwsgi params
Related-Bug: #1902585
Change-Id: Ifecbcf175acfa3cbab71bbe7417ea350c03c86a1
2020-11-03 16:58:57 +00:00
Jonathan Rosser
82784a675a Add vars file for ubuntu bionic
Change-Id: Ie605a2df06ef327c7eb5dcf0155cc51356849c8a
2020-10-14 13:50:55 +01:00
Jonathan Rosser
3548698dc4 Ensure that libpython is present.
This is required to run our uwsgi applications. On centos libpython3
is a dependancy of uwsgi-plugin-python3.

Also mark linters as non voting as fixing linters in this repo
is currently a circular dependancy

Change-Id: I56d130c242b440c02a54f9971bfb4e0866dbbc3d
2020-10-07 15:50:18 +01:00
Dmitriy Rabotyagov
1b52c1799a Fix uwsgi_venv_tag
Change-Id: I49d5154d80db6e7050cab7e71f1caa587e5cfe15
2020-08-05 11:08:45 +03:00
Dmitriy Rabotyagov
da08f49f80 Use X-Forwarded-For header in logs
Set log-x-forwarded-for to true by default to true to use
originating IP in logs instead of haproxy one.

Change-Id: I8afba713b6375865e1978f4b3d32c7d8d0db5a70
2020-07-10 16:47:14 +03:00
Dmitriy Rabotyagov
aad1a01696 Add Centos-8 support
Change-Id: Ie1fb51bf019db1527c6eb6e74c5c8ab6589764e2
2020-06-16 16:11:14 +03:00
Andreas Jaeger
fe4d46af10 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: If9888d7a1a005c4b98b8170d5cc1f41b7af0c136
2020-06-03 18:58:41 +02:00
3c92251091 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: I2a3d96ac823274e18c3cd7770159465c09154ad2
Sem-Ver: feature
2020-06-01 13:08:16 +00:00
Zuul
73a7ef31b0 Merge "Update docstheme for style" 2020-05-22 09:24:52 +00:00
Andreas Jaeger
5a734d333e 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: If0417f430b5fbca7ada9b103023e75870c23ff42
2020-05-20 17:25:39 +00:00
Jonathan Rosser
331c798f45 Do not use bare variables in ansible conditionals
This change avoids the following warning:

[DEPRECATION WARNING]: evaluating 'uwsgi_services' as a bare variable, this
behaviour will go away and you might need to add |bool to the expression in the
future.

Change-Id: I647b703d548b543d35cac5a08eb4a32afdf5a064
2020-05-19 16:32:19 +00:00
Andreas Jaeger
0619a2b0a3 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 in this repo
- Cleanup */source/conf.py to remove now obsolete content.
- Remove install_command from tox.ini, the default is fine
- Sync doc/requirements.txt with openstack-ansible-tests

Change-Id: Iac3ae185777f4fd7189811726019e16336316bee
2020-04-28 09:30:45 +02:00
Zuul
1fc708485c Merge "Fix uwsgi groupname usage" 2020-03-09 11:14:59 +00:00
Ghanshyam Mann
6e3ae608cc [ussuri][goal] Updates for python 2.7 drop
OpenStack is dropping the py2.7 support in ussuri cycle.

openstack-ansible repos only need updates on requirements
and tox file.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ib5eb8ea1f504d6f6b21d3d3208b7ddf257fd3989
2020-03-02 20:08:42 +00:00
Dmitriy Rabotyagov
655bf000a1 Fix uwsgi groupname usage
There was an error where uwsgi services were launched
always with groupname = username, even when another
group was provided in uwsgi_services or set via
uwsgi_system_group_name.

Change-Id: Ifb4b026145849eb2c642d4c558d11f167548341e
2020-02-24 18:18:48 +02:00
Dmitriy Rabotyagov
b2a0db4b47 Run uwsgi tasks only when uwsgi_services defined
Change-Id: I000b8a4ae4c8ee0c9ce44e520e0c74cdd0f4afea
2020-01-30 11:17:45 +02:00
Zuul
b4db9513d9 Merge "Test linters with integrated repo" 2020-01-14 14:24:10 +00:00
Dmitriy Rabotyagov
20484b7ec0 Stop service when app can't be started
uWSGI service can be showed as running even if it's unable to
find wsgi file. It will generate error like [1] and continue re-trying
To prevent this from happening, we should exit when app error occur

[1] `no python application found, check your startup logs for errors`

Change-Id: I24566df66caa651926b13891f00220bd8795bdb3
2020-01-02 19:27:02 +02:00