67 Commits

Author SHA1 Message Date
Tobias Urdin
63cd960253 Inherit pyvers from openstacklib::defaults
Depends-On: https://review.openstack.org/#/c/633162/
Change-Id: Ied4fcd08ce82543907c4cf8fd5f2780e63a47eed
2019-01-25 15:55:18 +00:00
Tobias Urdin
489d1573c4 Set pyvers in defaults
This allows openstacklib::defaults to be inherited by each component
module avoiding duplicating the logic currently required when setting
this for the various base distrobutions.

Change-Id: I84b767921d151a61429b2c89e6372c4b447f0d7d
2019-01-11 14:36:07 +00:00
Tobias Urdin
7f898a48eb Fix lint
Fixes the lint issues now that the lint jobs fail
properly.

Change-Id: I78caa461fc9b2327a5d1ba39488f924f26da4354
2018-12-18 11:07:09 +01:00
Tobias Urdin
f2d1977191 Deprecate Puppet 4
Adds a message that Puppet 4 is deprecated as of
this release, is minimally tested and will be
officially unsupported in the next release.

Change-Id: I5fbd87fc179ee80a749bad02764f129420330f5c
2018-11-08 10:13:12 +01:00
20ac1f925a Install python3-openstackclient in Fedora or RedHat > 7
Fedora repo [1] has python3 packages, start consuming those.

[1] http://trunk.rdoproject.org/fedora/current/

Change-Id: I8e2ec45e38275fb0910f5921662cb7cf865edd0a
2018-10-25 16:49:16 +05:30
Javier Pena
33b05434f3 Make sure the wsgi script dir mode is 0755
When the system-wide umask setting is more restrictive than the
default setting, the wsgi script directory permissions may not allow
the apache process to access them, resulting in errors.

A similar fix was applied to Keystone some time ago, see [1].

[1] - 4f15fb64b1

Change-Id: Ie9769657dc530bc895a3119b3e458864a8b5f293
2018-10-03 15:16:58 +02:00
Benedikt Trefzer
a39a44faf9 make openstackclient package name configurable
Change-Id: Ie7d770af6d1238c3f68b7c743e8fa5255a9a5995
2018-09-10 10:33:01 +02:00
Tobias Urdin
4ef3b1e843 Remove allow_virtual for Package in defaults
We only test and support Puppet 4 and Puppet 5
now and this parameter to the Package resource
defaults to true in these versions making this
unneccesary.

Change-Id: I1459cf5382cd3090c051b25c884399d5cf37d264
2018-05-18 13:49:12 +02:00
Thomas Goirand
78c08ad6dc Add environment param to service_validation.pp
To be able to pass OS_PASSWORD=, we need the environment param
to be added to this class.

Needed-By: I8ab8a2c7bb1d93d6fb9d16eabd3a1112b1e1237b
Change-Id: If10b57a38c61cadca48e1e3c1e76d659397849fb
2018-05-15 16:11:07 +02:00
Zuul
56dba5e68c Merge "openstacklib::openstackclient Debian python3" 2018-05-02 17:26:38 +00:00
Tobias Urdin
709b28006b openstacklib::openstackclient Debian python3
This change adds support for installing the
python3-openstackclient package on Debian.

On Ubuntu and RedHat based the package name
is still python-openstackclient.

Change-Id: I8a0c5dfa9274dca167ad3bb33ab151fb693f5d4d
2018-04-24 15:54:35 +02:00
Tobias Urdin
809396defb Add support for multiple WSGI script aliases
This patch adds a new parameter named custom_wsgi_script_aliases
to the openstacklib::wsgi::apache class. This can be used to specify
extra WSGI script alias statements for the apache::vhost resource
which is merged with the default one calculated using $path,
$wsgi_script_dir and $wsgi_script_file.

This is the final piece to be able to move keystone::wsgi::apache
over to using openstacklib::wsgi::apache.

Change-Id: I31096140a6f355ec99496053fb06ce6c73094180
2018-04-23 22:37:41 +02:00
Tobias Urdin
2b239ef5e7 Add support for keystone options to wsgi::apache
This patch adds the params that keystone currently
supports to openstacklib::wsgi::apache so we can move
keystone::wsgi::apache to using this and not drop
any existing available options.

Change-Id: Ifb988fedce958d2607365634efeccf2d7b88d073
2018-04-16 08:44:02 +02:00
Alex Schultz
2040b31029 Ensure policy file exists
With the move of existing policy.json files into code, the file may no
longer be shipped by packaging. The json augeas lens requires that the
file exist or it fails. This change adds a file resource to ensure the
file exists with a basic json construct prior to managing the contents
with augeas.

Change-Id: I26e8b1384f4f69712da9d06a4c565dfd1f17c9ed
Related-Bug: #1742154
2018-01-09 15:56:33 -07:00
Juan Antonio Osorio Robles
546eb8fb41 Allow setting log files for apache vhost
This allows the setting of the error and access file logs, as well as
the access log format. This was done in a similar fashion as one can
configure these ones in the keystone wsgi manifest.

Change-Id: I5e7d3588b7b3b106813d6d37b55aa812273d04d6
2017-10-05 14:24:47 +03:00
Juan Antonio Osorio Robles
ca0bf6ea34 apache wsgi: Exchange defaults for workers and threads
Due to Python's GIL [1], we can't use multiple threads for running
OpenStack services without a performance penalty, since the execution
ends up serialized, which defeats the purpose.

Instead, we should use several processes, since this approach doesn't
have this limitation.

[1] https://wiki.python.org/moin/GlobalInterpreterLock

Change-Id: I09b4dfa0873c5a086d4492a7e2ebb72460e507c9
2017-09-19 15:12:36 +00:00
Benedikt Trefzer
8832df01b0 add parameter to overwrite/add wsgi process options
Add two parameters to apache wsgi to allow overwrite
    and/or add additional wsgi process options.

Change-Id: I41914ce3361988d5db1695f09d21209772fdf548
2017-08-16 06:54:10 +02:00
Carlos Camacho
a3cef1d6cc Fix lint issues to upgrade to puppet-lint 2.3
2017-07-20 14:41:23.253791 | manifests/db/mysql/host_access.pp:52:WARNING: arrow should be on the right operand's line
2017-07-20 14:41:23.253911 | manifests/db/mysql/host_access.pp:62:WARNING: arrow should be on the right operand's line
2017-07-20 14:41:23.253949 | manifests/policy/base.pp:43:WARNING: arrow should be on the right operand's line
2017-07-20 14:41:23.253987 | manifests/service_validation.pp:94:WARNING: arrow should be on the right operand's line

Change-Id: I4cee893ae8f2e430149e2cd56b2e9d9d592a75d5
2017-07-20 20:42:31 +02:00
Alex Schultz
76de885d5b Fix httpd dependency
When we switched to the collector as part of
Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b this included using name ==
'httpd' but the package name is different between RHEL/Ubuntu so it
needs to be title == 'httpd' because the title[0] is fixed to be 'httpd'

[0] https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/package.pp#L32

Change-Id: I9d535ab38afea852559df2b3073bd4b74a2a3947
2017-07-13 14:32:57 -06:00
ZhongShengping
7ce50f94b8 Update resource references for dependencies
The latest version of puppet now reports these as catalog failures so
this change removes the unnecessary references and the references
should be updated.

Change-Id: Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b
Closes-Bug: #1702964
2017-07-11 17:23:15 +08:00
Benedikt Trefzer
75aa4228e9 fix copy of wsgi file beeing a symlink
if wsgi_script file is a symlink to another file (eg.
in a virtual environment) the file resource copied the
symlink instead of creating a new file.

This patch ensures, that symlinks are followed and a
ordinary file is created instead of copying the symlink.

Change-Id: I53e59dbfb8810a519fce24e1e381e0f83c5a1c29
2017-06-28 11:34:22 +02:00
Jenkins
6a980b5d33 Merge "Add tls options to mysql user creation" 2016-12-20 08:09:37 +00:00
Juan Antonio Osorio Robles
83653d442e Add tls options to mysql user creation
This enables us to set several TLS requirements for the users created
by the host_access resource.

Change-Id: If550f184f85f8fdbc197fc9f930d4446de67090a
2016-12-16 07:58:13 +02:00
Xing Zhou
ed9c5cf626 Add customization for wsgi process display name
when ceilometer api is deployed in httpd, however
 the process name is like '/usr/sbin/httpd -DFOREGROUND',
it is ambiguous and make monitoring more difficult.
the aodh, gnocchi module are also like that.
so we should set an appropriate name for wsgi process.

Change-Id: I5e8c9be062a88e9ed6442e6cbce6573fba385030
Related-Bug: #1626550
2016-12-15 15:25:11 +08:00
Alex Schultz
d91a4c7b36 Add ability to skip mysql user/grants
Previously if you wanted to use the openstack::db::mysql for to create a
database and use the same user for multiple databases, the catalog would
fail due to a duplicate mysql_user definition. This change adds the
ability to disable the user creation as well as the grant if the user
does not need it.

Change-Id: Id04a622cc900254fe60bc257a9e42d16c676bf40
Related-Bug: 1649341
2016-12-12 14:46:07 -07:00
Juan Antonio Osorio Robles
3388c98ab0 Add wsgi_chunked_request option for apache vhost resource
This sets the WSGIChunkedRequest setting in the vhost, which is
something that services like glance need when running over httpd.

Change-Id: I1c8816e9e5a9a38a3a86f3c0c5016df18f09ea62
2016-11-17 10:42:33 +02:00
Juan Antonio Osorio Robles
59ee7b0930 Add support for allow_encoded_slashes for apache
This ends up as the AllowEncodedSlashes option in the vhost.

Change-Id: I9a9246522810de546a7c460ab1133d6bf9081a15
2016-11-10 15:34:19 +02:00
Maksym Yatsenko
a5f39c6233 Change worker defaults to ::os_workers
This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: I458791aa8027cffeeec49698b302cb96ae5af2e2
2016-10-10 19:34:03 +03:00
David Moreau-Simard
48a89dfeea Add a refreshonly parameter to service_validation
This will allow to run the service_validation on demand when required
from a notification, for example.

Change-Id: I18ea45f39cd7f4930de4916d658653d22d8530b3
2016-09-27 10:45:42 -04:00
Carlos Camacho
b51b2881dc Remove unnecesary spaces in log messages.
Spaces added by mistake in some log messages.

Change-Id: Iaf5b6f3d402a465957a9610619988d23da080153
2016-09-26 14:31:47 +02:00
David Moreau-Simard
ab226968e0 Add support for setting a timeout for service_validation
The default exec timeout in puppet is 300 seconds, this can be a
very long while on services that do not return immediately.
With default values, a command that never returns we're looking at
10*300 seconds (or 50 minutes).
Let's default to something more reasonable, 60 seconds, and also
make it configurable.

Change-Id: I53bd4935fbbb3a86ac1ad522a0f3d8f017151dd0
2016-09-19 12:17:19 -04:00
Carlos Camacho
b12479ba5b Fix puppet-lint before upgrading gem
Removing puppet-lint warnings
in favor of upgrading to latest gem

2016-09-13 21:12:33.947117 | manifests/db/postgresql.pp:37:WARNING: line has more than 140 characters

Change-Id: If40b8e5874c791e0a94bd634c09768c77f0c2d93
2016-09-14 13:59:31 +02:00
Emilien Macchi
f37a0a339a service validation: log output on failures
When validating a service, it's useful to have logs when exec output
fails.
This patch adds this feature.

Change-Id: I43c9eff8516ea562bf9bde8d5651ddceeb496163
2016-07-14 18:16:49 -04:00
Jenkins
d15ec4ffc7 Merge "Add optional params for idempotency in service_validation" 2016-07-14 22:12:34 +00:00
Oleksiy Molchanov
5aaaff5d90 Add optional params for idempotency in service_validation
Change-Id: Ib3c2d2864a19b0b5761f546d6cbb9c4a51203412
2016-07-12 10:14:26 +00:00
Ben Nemec
b61adb6257 Make Apache vhost respect X-Forwarded-Proto header
Without this, some OpenStack services will return invalid URLs if
you are using SSL termination at a proxy in front of the service.

Change-Id: I3ee6b5838f4703e3b8b1b6632dd45c94057b2202
Closes-Bug: 1597935
2016-07-11 21:07:20 +00:00
Sofer Athlan-Guyot
8cf821dc2f Default file for all. Use it for virtual package.
This file is to be included by all puppet modules.

First feature is to make sure that allow_virtual is set to true for all
openstack modules.  It's set to false for puppet 3.6.1 to
4.0.0 [1]

[1] https://docs.puppet.com/puppet/3.6/reference/release_notes.html#puppet-361

Change-Id: I9d0a10d48124ee71ea80134ceef96436c8ee196e
Closes-Bug: 1599113
Related-Bug: 1597753
Depends-On: I2699eaa3a10589c9a0c680bb1de489994fe01b67
2016-07-06 15:24:37 +02:00
Oleksiy Molchanov
157c6d1d7d Downcase all hostnames for MySQL user/db creation
Mysql puppet providers apply downcase method for hostnames, that
lead us to errors when we use hostnames with upper-case letters.

Change-Id: I0da9e9aac3504d3defdfbb8b916ae7e9ae2339db
Closes-Bug: 1584247
2016-05-27 13:30:39 +00:00
Matthew Black
45f8a57770 Added policy-rc.d class.
On debian os family systems the methodology is to
start services when installed. This causes a problem
with keystone sometimes at random in CI jobs.

Change-Id: Id0b38743a9bf536f69d155e1d6e664a5585e5e1d
2016-04-22 10:41:36 -04:00
Jenkins
4a6ca33462 Merge "Avoid duplicate client resource" 2015-12-08 02:52:55 +00:00
Matt Fischer
8469027d44 Avoid duplicate client resource
python-openstackclient is used by a few other classes, so switch to
ensure_resource to avoid duplicate package declarations.

Partial-Bug: #1523643

Change-Id: I437b266344cf6ace683379c1999fc08fbdee756c
2015-12-07 16:49:27 -07:00
Sergey Kolekonov
2ff3a400f8 Pass necessary options to Apache when using WSGI
It's recommended to use WSGIApplicationGroup and WSGIPassAuthorization
options when a service is running under Apache.

Change-Id: Ia6bacab44c1d25f0253c84183f4a561d7682c6e8
2015-10-09 13:24:29 +03:00
vsaienko
670e2de5ad Allow to path custom fragment to vhost
Add possibility to pass custom_fragment to apache::vhost
  in order to provide lines, that are not supported by module.
  (for example LimitRequestFieldSize for keystone)

Change-Id: Ib199dc75c17de0bcdc385afcc33cb3854668a1b2
2015-09-21 16:52:10 +03:00
Jamie Lennox
23814124a8 Add include on ::mysql::server
Mysql server is referenced however not included in this file which
causes problems if you have not already included it.

Change-Id: I833c357cb536b5e1f423dceb89d61530b32a4ee6
Closes-Bug: #1472837
2015-07-09 12:07:02 +10:00
Emilien Macchi
6122ac4ebb MySQL: change default MySQL collate to utf8_general_ci
Install & configure MySQL database by using utf8_general_ci collation
which is the way documented in OpenStack [1] and already the default
in puppetlabs-mysql [2].

[1] http://goo.gl/GA5gyZ
[2] https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/db.pp#L7

Change-Id: I7ceecaa3e7fe964e53714cfd4c6fd2b8ff90fce0
Closes-bug: #1446375
2015-04-22 08:59:26 -04:00
Jenkins
9ddc6332c5 Merge "wsgi/apache: fix wsgi_process_group doc" 2015-04-20 13:14:09 +00:00
Colleen Murphy
11d033131e Correct wsgi_daemon_process_options key
'owner' is not a valid option for the WSGIDaemonProcess directive. The
correct option is 'user' [1]. Trying to set 'owner' causes the service
to be unable to start. This patch corrects that option name.

[1] https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess

Change-Id: I907fbcb48db823ea8f5caca4496efaaa456ef69c
2015-04-07 14:18:11 -07:00
Emilien Macchi
a68fed0de2 wsgi/apache: fix wsgi_process_group doc
Fix wsgi_process_group documentation parameter.

Change-Id: Id6b9644601b51c709c295d09be09974c44629e20
2015-04-07 10:00:49 -04:00
Jenkins
8ca603c2de Merge "Add puppet-lint-param-docs plugins to puppet-lint" 2015-04-02 13:21:15 +00:00
Jenkins
83e5d1a1bc Merge "Add Puppet 4.x lint checks" 2015-04-02 13:17:38 +00:00