From 487f6d2e83c782f03df9649707794443a93b958e Mon Sep 17 00:00:00 2001 From: Jason Guiditta Date: Fri, 15 Jan 2016 15:46:13 -0500 Subject: [PATCH] Update non-openstack modules to their latest masters. Update apache to 5a277163de3807235f7f2fb4b11ec3d1f0b2d05f 5a277163de3807235f7f2fb4b11ec3d1f0b2d05f Merge pull request #1332 from tphoney/fm-3801 ee47dcbecdf93fa5e1b867495f3bbaf65bd3b84a install epel for RH in acceptance. clean itk test 6f14e7d2a6c84a9c8b95a6be24f492faff745ef6 Merge pull request #1330 from tphoney/fm-3801 80fb727f1a524261dcbf3fbbf2f3d8af6209066f fixing apache_parameters_spec.rb 050fee30b58e248d20628b877217a45cccc0b056 Merge pull request #1329 from tphoney/fm-3801 42bf228282fb540eb084d048f1d69748dc48f87d modify tests for debian 8 and add tests 5442a987d6bc5fed07ada84d226d9989452b4b92 Merge pull request #1327 from tphoney/proxy_test_fix 4a8211097975c1680eb575963bd27406680e6f9d a path is needed for ProxyPassReverse ff8ebaffe9d257579d68176d9d77877634da1e23 Merge pull request #1326 from igalic/proxy-pass-no-location 99add117df452d2c513a3a7c36d9fd0416e696b9 proxy: remove workaround for old broken clients 9507b9e9b801cc789280683423c244e684327410 Merge pull request #1323 from traylenator/pass_max_queue_size a2c49b0086b798acdbc63c770c949724dfa06604 Merge pull request #1324 from tphoney/redhat_itk_test_fix d4fb48aa501e0e86d4a57efd3e5fade978a24fdb itk tests on redhat need epel 2a979d276bb7e45570fc41b98ad5220cf36f99a0 Merge pull request #1321 from ryno75/master bd6239c59d3f77962ba9785024cf87f2ef7ff74c (MODULES-2964) Enable PassengerMaxRequestQueueSize to be set b1d20042f02931a05c64a29fd47c9078f6c0ab43 Add some mod::passenger documentation. d9034acf0040bb237fdc85eda29575a62d659c6d Fixing error in Amazon $operatingsystem comparison 1f3c7b904f1d2dd398645876e9a1af01a417ce84 Merge pull request #1320 from mpolenchuk/master cf92e835bbdd4066fe0527398911904b3fc76aa0 Update docs for predefined LogFormats 4c078b7dc6b27fa0d10c4bf01a57cb3f7d11e590 Merge pull request #1317 from jlambert121/proxy_pass_options 15fc6569ba32f062378c617dd13c8f2042dd6488 Merge pull request #1319 from tphoney/redhat_mod_security_fix 9dd474b760178fe42c7e568999099c1c87eab2c1 fix ordering of catalogue for redhat 7 ca432ee289cb15a23d76b76662a7fb9f56bdfbbf Merge pull request #1292 from cholyoak/shib2_debian 4ae775a3662f668deaf6a972db48947b0fa3bafb Fix paths and packages for the shib2 module on Debian pre Jessie 8a350af5cf956fe8f346df6786e5b157e8024dda Merge pull request #1316 from MiamiOH/master db5b0bfb09959622ea1c6cc299b58057b94c588f MODULES-2956: Enable options within location block on proxy_match 2e6cd7aad53a6e9db97c618fa0a432fc3182574c Support itk on redhat 2b43798124719b4672392818d60e05134c2088dc Merge pull request #1315 from pxsloot/ticket/2948-proxypass_parameters_ensure_order 19e3ee61e8a1a0ab5d6b0288038b6750ad4c8b7f (#2948) ensure order of ProxyPass and ProxyPassMatch parameters Change-Id: I53142f706cfcca09950345461fdcc4f5bbaa47cd Update ceph to d387b0725f8eb01f2e9b572f7e3c22d5e00c67d9 d387b0725f8eb01f2e9b572f7e3c22d5e00c67d9 Merge "Added default timeout for exec resources" 749a2a8026d4f5d3cc54c119b7be8dab12595eb9 Merge "fix mon creation to be more idempotent" 8fd97b5530c21ebfc82044fdeb368097cf72134a Merge "Be more specific with CentOS7 package exclude" 6a03609cce9f7b1f379230ef01d844723cf051da Added default timeout for exec resources 5096c97ddfbd4b491eb6050db41df04a93c0a8b9 fix mon creation to be more idempotent 618a5b2553590be76fe6a4c792b6c23d0a04bf0d Be more specific with CentOS7 package exclude Change-Id: I786a6e327e05c3d521259ef7ed98c5e2b5b561d5 Update elasticsearch to dbceae869eef2dde4ff3ad5504ec002bb4a98c3c dbceae869eef2dde4ff3ad5504ec002bb4a98c3c Merge pull request #554 from electrical/unmanaged 2427fcf8ee722f0e66a8562be91c1e72c2949afd Merge pull request #555 from electrical/doc_init_defaults fd8cb06c169bd17d9d23c761a7161dc4fb9fffc9 Improve readme about init_defaults 327747fab409e008bbbf5b926a322e7e2cdb491d Still create init script when status is unmanaged c195339b309fa6d91f0fed5bd6ffe8504f2638f7 Merge pull request #552 from elastic/commonupdate 7ed5ae17fbe8079c96615e0b4b5673e7419c2804 update common files ae7d561c56951ac6df20c0f14ddd1e6e6292f0df Merge pull request #551 from electrical/init_template b23ae04dbd88a05f155fef01b4d3fcbf716a02df Expose init_template variable correctly 97bcb1c8f366463e9cffa00fb9712c001bcce73f Merge pull request #544 from electrical/no_data_recursive 4c470893573bd79fc10a6e047540970ebba237eb Merge pull request #545 from electrical/plugin_provider 5cf2df447d467700d5c5e55cbe7f9449823c21c2 Merge pull request #550 from electrical/plugin_retry 89b2522f46c85a5d5214b42fa79fb2cf1805eded Add simple retry to plugin installation eb6af3c22c3f69d98fa01dea5a608ab7c06f099a Make sure we remove the directory after everything else 809134772febdd38cd2f7c0d72d2defe2910d79b Fix unit tests 558346bc7ca34d8d016aefa9f0d1541d0a116c24 Solve issues with ES being run 1101967f6693e453ebf195f14e4af96be8464728 Remove recurse option on data dir 665b4dc0bd6fbc3ca7e5148fc89b48a8a88c4fa7 Merge pull request #539 from ntent-ashton/master b183f762fc4e930db0b981d404a72440941f8221 Added ES_GC_LOG_FILE export in init files Per the official distribution init.d files which contain this line 785afdc9783a2d4e79584514b1b6fb6c223a32ba Merge pull request #527 from electrical/release/0.10.1 ef5395fb7dd33ecc9aa9b04b3fcadf6696d39950 Release 0.10.1 9d5d465e5d11f71cf8ac5fead9ed262e31ba3d31 Merge pull request #526 from electrical/proxy_fix 65ccaa5a204d5571f9ab45289f6c4cd0546f6ae7 Update unit test f07408c45443f8c9bae5403cb990099a478f4237 Fix for proxy handling in plugin provider Change-Id: I11aa26b348b88ace160b5fc1777f1ccff5773c04 Update mysql to 23672ca3265d129a4e8b97c1fc7d0e9aba05b318 23672ca3265d129a4e8b97c1fc7d0e9aba05b318 Merge pull request #779 from jmcclell/patch-1 1bad8ae56a3d7ff8ec20845c42a2cafa13ad30aa Fixes edge-case with dropping pre-existing users with grants 0b3e310ba72c2ac77e86b6c2435b476200bfa1a1 Merge pull request #791 from roidelapluie/empty-string-as-parameter e30e0bc958761890ea4f06cdd3f1fc7242a00fe2 Re-Add the ability to set a empty string as option parameter 1cfddec3ff2baa12e5eb87606712f33a2b2b0473 Merge pull request #790 from cadeauthom/service-unmanaged b33f9c663eb6eb3d96756c975638c49f3230fa9e Move all dependencies to not have them in case of service unmanaged Change-Id: Idb62862377741ad8258f31fced57e95f2e71dc2d Update opendaylight to bb401b1349363c75310d102d1de49f66f3003a31 bb401b1349363c75310d102d1de49f66f3003a31 Update templates and tarball URL for Li SR3 Change-Id: If68303d9925eaea7e424aabf73a32098739eee82 Update pacemaker to 00d99b66931d520af202b94d0a2fe3b43f11d8ee 00d99b66931d520af202b94d0a2fe3b43f11d8ee Merge pull request #70 from sathlan/rhbz/1298716 4ae9fabb3ff50dfc95a5f6b415e9e914a6ae8b00 Resource constraint with colon in the name (IPv6) Change-Id: Ia032a83c19fa8031e85e9ab95e29ba9c1cb4f9c4 Update rabbitmq to 45692304e66e4acfca06969574012b22def8f69b 45692304e66e4acfca06969574012b22def8f69b Merge pull request #422 from gpenaud/master 708176d761661f5b2a7a4aa1cf7cbf0ba588a7c2 Merge pull request #425 from DavidS/rebase-211 a4dbbf5d9dc8e2f3508aea475fd7fc5721bc7ab4 (MAINT) Fixup logic merge conflict and whitespace 58fd53326c9904c57431c0d97b413bdfb9bf30fb Adds configuration for rabbitmq_shovel plugin including static shovels 28fc64a7d536873daf2a93e6461611c7238e053e [docker|rabbitmq] - make an apt-get update after change repository sources to get last rabbitmq-server version (3.6.0) Change-Id: I2fb9a46657ff58486a39536e60c57736f32e9b44 Update sensu to 9bc7f4aa1bff8b2bb612f54d72df0a2730c7a0ea 9bc7f4aa1bff8b2bb612f54d72df0a2730c7a0ea Merge pull request #434 from sensu/feature/new-repos 95cf9eb6ad8776cc762cedfe68c927fc6e87933a [new-repos] update key id, matching Yelp/puppet-uchiwa#62 83666a3aa5da0ba8479c343f157435d3f159690d [new-repos] updated repository urls Change-Id: Idac33bad2dc84d9600d132f176894943be420aae Update uchiwa to a197642f71c8e5437d132d05444aff019f8ff817 a197642f71c8e5437d132d05444aff019f8ff817 Merge pull request #58 from jgnagy/master 8ffdeb89740af812ab0ea3508f76b5df1f9cc88d Changing 'install_package' to 'manage_package' a969e4cb50c9ba543a5c62b8b34ce0a40dfb123c Adding option to not install the uchiwa package This allows installing versions not yet in the sensuapp repo manually. Change-Id: I30dbeac609642d92c2baa8fdf2550ffae1b133b0 --- Puppetfile | 18 +- apache/README.md | 24 +- apache/manifests/mod/itk.pp | 20 + apache/manifests/mod/passenger.pp | 47 +- apache/manifests/mod/security.pp | 2 +- apache/manifests/params.pp | 11 +- .../spec/acceptance/apache_parameters_spec.rb | 18 +- apache/spec/acceptance/class_spec.rb | 12 +- apache/spec/acceptance/itk_spec.rb | 18 +- apache/spec/acceptance/mod_dav_svn_spec.rb | 12 +- apache/spec/acceptance/mod_deflate_spec.rb | 6 +- apache/spec/acceptance/mod_mime_spec.rb | 6 +- .../spec/acceptance/mod_negotiation_spec.rb | 18 +- apache/spec/acceptance/mod_pagespeed_spec.rb | 6 +- apache/spec/acceptance/mod_passenger_spec.rb | 11 +- apache/spec/acceptance/mod_php_spec.rb | 12 +- apache/spec/acceptance/mod_proxy_html_spec.rb | 6 +- apache/spec/acceptance/mod_security_spec.rb | 24 +- apache/spec/acceptance/mod_suphp_spec.rb | 6 +- .../acceptance/nodesets/debian-82-x64.yml | 10 + apache/spec/acceptance/prefork_worker_spec.rb | 18 +- apache/spec/acceptance/vhost_spec.rb | 72 ++- apache/spec/classes/mod/itk_spec.rb | 49 ++ apache/spec/classes/mod/passenger_spec.rb | 7 + apache/spec/classes/mod/php_spec.rb | 10 +- apache/spec/defines/vhost_spec.rb | 12 + apache/spec/spec_helper_acceptance.rb | 6 + apache/templates/mod/passenger.conf.erb | 3 + apache/templates/vhost/_proxy.erb | 43 +- ceph/manifests/mon.pp | 19 +- ceph/manifests/osd.pp | 6 + ceph/manifests/params.pp | 3 + ceph/manifests/pool.pp | 9 + ceph/manifests/repo.pp | 6 +- ceph/spec/classes/ceph_repo_spec.rb | 557 ++++++++++++++++++ ceph/spec/defines/ceph_mon_spec.rb | 12 +- elasticsearch/CHANGELOG.md | 19 + elasticsearch/LICENSE | 2 +- elasticsearch/README.md | 3 +- .../provider/elasticsearch_plugin/plugin.rb | 20 +- elasticsearch/manifests/init.pp | 2 +- elasticsearch/manifests/instance.pp | 6 +- elasticsearch/manifests/plugin.pp | 4 +- elasticsearch/manifests/service/init.pp | 36 +- elasticsearch/manifests/service/systemd.pp | 28 +- elasticsearch/metadata.json | 2 +- .../spec/acceptance/020_usergroup_spec.rb | 3 +- .../005_elasticsearch_instance_spec.rb | 21 +- .../010_elasticsearch_service_init_spec.rb | 5 +- .../011_elasticsearch_service_system_spec.rb | 6 +- .../spec/unit/provider/plugin_spec.rb | 9 +- elasticsearch/spec/unit/type/plugin_spec.rb | 2 +- .../etc/init.d/elasticsearch.Debian.erb | 1 + .../etc/init.d/elasticsearch.RedHat.erb | 1 + .../lib/puppet/provider/mysql_grant/mysql.rb | 6 +- mysql/manifests/server/service.pp | 48 +- mysql/spec/classes/mycnf_template_spec.rb | 5 + mysql/templates/my.cnf.erb | 2 +- opendaylight/manifests/params.pp | 2 +- opendaylight/spec/spec_helper.rb | 2 +- .../org.apache.karaf.features.cfg.erb | 2 +- .../provider/pcmk_constraint/default.rb | 27 +- pacemaker/manifests/constraint/base.pp | 24 +- rabbitmq/README.md | 8 + rabbitmq/manifests/config.pp | 2 + rabbitmq/manifests/init.pp | 32 +- rabbitmq/manifests/params.pp | 2 + rabbitmq/manifests/repo/apt.pp | 5 +- rabbitmq/spec/classes/rabbitmq_spec.rb | 54 +- rabbitmq/templates/rabbitmq.config.erb | 6 + sensu/manifests/init.pp | 8 +- sensu/manifests/repo/apt.pp | 2 +- sensu/manifests/repo/yum.pp | 4 +- sensu/spec/classes/sensu_package_spec.rb | 14 +- uchiwa/manifests/init.pp | 7 + uchiwa/manifests/install.pp | 10 +- uchiwa/manifests/params.pp | 1 + 77 files changed, 1315 insertions(+), 247 deletions(-) create mode 100644 apache/spec/acceptance/nodesets/debian-82-x64.yml diff --git a/Puppetfile b/Puppetfile index 53043a423..2b91ced40 100644 --- a/Puppetfile +++ b/Puppetfile @@ -3,7 +3,7 @@ mod 'aodh', :git => 'https://github.com/openstack/puppet-aodh.git' mod 'apache', - :commit => 'a78617b1919f44ab32fb88219783d836a77db148', + :commit => '5a277163de3807235f7f2fb4b11ec3d1f0b2d05f', :git => 'https://github.com/puppetlabs/puppetlabs-apache.git' mod 'aviator', @@ -19,7 +19,7 @@ mod 'ceilometer', :git => 'https://github.com/openstack/puppet-ceilometer.git' mod 'ceph', - :commit => 'e4b05caf4825af51f679f0618229dce4c3388a5f', + :commit => 'd387b0725f8eb01f2e9b572f7e3c22d5e00c67d9', :git => 'https://github.com/stackforge/puppet-ceph.git' mod 'certmonger', @@ -51,7 +51,7 @@ mod 'datacat', :git => 'http://github.com/richardc/puppet-datacat' mod 'elasticsearch', - :commit => '171a4a4dc89ad4543f486ed90040b5fbea8d81f0', + :commit => 'dbceae869eef2dde4ff3ad5504ec002bb4a98c3c', :git => 'https://github.com/elastic/puppet-elasticsearch.git' mod 'firewall', @@ -151,7 +151,7 @@ mod 'mongodb', :git => 'https://github.com/puppetlabs/puppetlabs-mongodb.git' mod 'mysql', - :commit => '5e7b999615bf99cc307b570c3eb27610d08df3c7', + :commit => '23672ca3265d129a4e8b97c1fc7d0e9aba05b318', :git => 'https://github.com/puppetlabs/puppetlabs-mysql.git' mod 'n1k_vsm', @@ -179,7 +179,7 @@ mod 'ntp', :git => 'https://github.com/puppetlabs/puppetlabs-ntp' mod 'opendaylight', - :commit => '33353e8d869f4956d706fedd6f4f9c8b4b59a4e0', + :commit => 'bb401b1349363c75310d102d1de49f66f3003a31', :git => 'https://github.com/dfarrell07/puppet-opendaylight.git' mod 'openstack_extras', @@ -191,7 +191,7 @@ mod 'openstacklib', :git => 'https://github.com/openstack/puppet-openstacklib.git' mod 'pacemaker', - :commit => 'e9a8f0d048c1bbc86a4bb1ee81417da3afe6673e', + :commit => '00d99b66931d520af202b94d0a2fe3b43f11d8ee', :git => 'https://github.com/redhat-openstack/puppet-pacemaker.git' mod 'puppet', @@ -203,7 +203,7 @@ mod 'qpid', :git => 'https://github.com/dprince/puppet-qpid' mod 'rabbitmq', - :commit => '67b9acc9a37faf2e15eae686e6b17642f82bdc40', + :commit => '45692304e66e4acfca06969574012b22def8f69b', :git => 'https://github.com/puppetlabs/puppetlabs-rabbitmq.git' mod 'redis', @@ -223,7 +223,7 @@ mod 'sahara', :git => 'https://github.com/openstack/puppet-sahara.git' mod 'sensu', - :commit => '553994fb8724f84ec820a0a36b347a148d4495e3', + :commit => '9bc7f4aa1bff8b2bb612f54d72df0a2730c7a0ea', :git => 'https://github.com/sensu/sensu-puppet.git' mod 'snmp', @@ -275,7 +275,7 @@ mod 'tuskar', :git => 'https://github.com/openstack/puppet-tuskar.git' mod 'uchiwa', - :commit => 'b3f9ed80d33f6f4f6ca69b60fc3c5aa74fb3ac85', + :commit => 'a197642f71c8e5437d132d05444aff019f8ff817', :git => 'https://github.com/Yelp/puppet-uchiwa.git' mod 'vcsrepo', diff --git a/apache/README.md b/apache/README.md index b0ea212a4..38277a326 100644 --- a/apache/README.md +++ b/apache/README.md @@ -161,6 +161,7 @@ [`mod_mpm_event`]: https://httpd.apache.org/docs/current/mod/event.html [`mod_negotiation`]: http://httpd.apache.org/docs/current/mod/mod_negotiation.html [`mod_pagespeed`]: https://developers.google.com/speed/pagespeed/module/?hl=en +[`mod_passenger`]: https://www.phusionpassenger.com/library/config/apache/reference/ [`mod_php`]: http://php.net/manual/en/book.apache.php [`mod_proxy`]: https://httpd.apache.org/docs/current/mod/mod_proxy.html [`mod_proxy_balancer`]: http://httpd.apache.org/docs/current/mod/mod_proxy_balancer.html @@ -1002,6 +1003,7 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combine LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent +LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"" forwarded ~~~ If your `log_formats` parameter contains one of those, it will be overwritten with **your** definition. @@ -1266,7 +1268,7 @@ The following Apache modules have supported classes, many of which allow for par * `negotiation` * `nss`* * `pagespeed` (see [`apache::mod::pagespeed`][]) -* `passenger`* +* `passenger`* (see [`apache::mod::passenger`][]) * `perl` * `peruser` * `php` (requires [`mpm_module`][] set to `prefork`) @@ -1481,6 +1483,18 @@ Installs and manages [`mod_info`][], which provides a comprehensive overview of - `apache_version`: Default: `$::apache::apache_version`, - `restrict_access`: Determines whether to enable access restrictions. If 'false', the `allow_from` whitelist is ignored and any IP address can access `/server-info`. Valid options: Boolean. Default: 'true'. +##### Class: `apache::mod::passenger` + +Installs and manages [`mod_passenger`][]. + +**Parameters within `apache::mod::passenger`**: +- `passenger_high_performance` Sets the [`PassengerHighPerformance`](https://www.phusionpassenger.com/library/config/apache/reference/#passengerhighperformance). Valid options: on, off. Default: undef. +- `passenger_pool_idle_time` Sets the [`PassengerPoolIdleTime`](https://www.phusionpassenger.com/library/config/apache/reference/#passengerpoolidletime). Default: undef +- `passenger_max_pool_size` Sets the [`PassengerMaxPoolSize`](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxpoolsize). Default: undef. +- `passenger_max_request_queue_size` Sets the [`PassengerMaxRequestQueueSize`](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequestqueuesize). Default: undef. +- `passenger_max_requests` Sets the [`PassengerMaxRequests`](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequests). Default: undef. +- ... + ##### Class: `apache::mod::ldap` Installs and configures [`mod_ldap`][]. Allows you to modify the @@ -2242,7 +2256,7 @@ Specifies the destination address of a [ProxyPass](http://httpd.apache.org/docs/ ##### `proxy_pass` -Specifies an array of `path => URI` for a [ProxyPass](http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass) configuration. Defaults to 'undef'. Optionally parameters can be added as an array. +Specifies an array of `path => URI` for a [ProxyPass](http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass) configuration. Defaults to 'undef'. Optionally parameters and location options can be added as an array. ~~~ puppet apache::vhost { 'site.name.fdqn': @@ -2251,6 +2265,8 @@ apache::vhost { 'site.name.fdqn': { 'path' => '/a', 'url' => 'http://backend-a/' }, { 'path' => '/b', 'url' => 'http://backend-b/' }, { 'path' => '/c', 'url' => 'http://backend-a/c', 'params' => {'max'=>20, 'ttl'=>120, 'retry'=>300}}, + { 'path' => '/c', 'url' => 'http://backend-a/c', + 'options' => {'Require'=>'valid-user', 'AuthType'=>'Kerberos', 'AuthName'=>'Kerberos Login'}}, { 'path' => '/l', 'url' => 'http://backend-xy', 'reverse_urls' => ['http://backend-x', 'http://backend-y'] }, { 'path' => '/d', 'url' => 'http://backend-a/d', @@ -3190,12 +3206,12 @@ Sets the [SSLProxyMachineCertificateFile](http://httpd.apache.org/docs/current/m ~~~ ##### `ssl_proxy_check_peer_cn` - + Sets the [SSLProxyMachinePeerCN](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeercn) directive, which specified whether the remote server certificate's CN field is compared against the hostname of the request URL . Defaults to 'undef'. ##### `ssl_proxy_check_peer_name` - + Sets the [SSLProxyMachinePeerName](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeername) directive, which specified whether the remote server certificate's CN field is compared against the hostname of the request URL . Defaults to 'undef'. ##### `ssl_options` diff --git a/apache/manifests/mod/itk.pp b/apache/manifests/mod/itk.pp index 990f853ea..6f0796675 100644 --- a/apache/manifests/mod/itk.pp +++ b/apache/manifests/mod/itk.pp @@ -54,6 +54,26 @@ } case $::osfamily { + 'redhat': { + package { 'httpd-itk': + ensure => present, + } + if versioncmp($apache_version, '2.4') >= 0 { + ::apache::mpm{ 'itk': + apache_version => $apache_version, + } + } + else { + file_line { '/etc/sysconfig/httpd itk enable': + ensure => present, + path => '/etc/sysconfig/httpd', + line => 'HTTPD=/usr/sbin/httpd.itk', + match => '#?HTTPD=/usr/sbin/httpd.itk', + require => Package['httpd'], + notify => Class['apache::service'], + } + } + } 'debian', 'freebsd': { apache::mpm{ 'itk': apache_version => $apache_version, diff --git a/apache/manifests/mod/passenger.pp b/apache/manifests/mod/passenger.pp index 4f7cb7f04..8d3622d30 100644 --- a/apache/manifests/mod/passenger.pp +++ b/apache/manifests/mod/passenger.pp @@ -1,27 +1,28 @@ class apache::mod::passenger ( - $passenger_conf_file = $::apache::params::passenger_conf_file, - $passenger_conf_package_file = $::apache::params::passenger_conf_package_file, - $passenger_high_performance = undef, - $passenger_pool_idle_time = undef, - $passenger_max_requests = undef, - $passenger_spawn_method = undef, - $passenger_stat_throttle_rate = undef, - $rack_autodetect = undef, - $rails_autodetect = undef, - $passenger_root = $::apache::params::passenger_root, - $passenger_ruby = $::apache::params::passenger_ruby, - $passenger_default_ruby = $::apache::params::passenger_default_ruby, - $passenger_max_pool_size = undef, - $passenger_min_instances = undef, - $passenger_use_global_queue = undef, - $passenger_app_env = undef, - $passenger_log_file = undef, - $mod_package = undef, - $mod_package_ensure = undef, - $mod_lib = undef, - $mod_lib_path = undef, - $mod_id = undef, - $mod_path = undef, + $passenger_conf_file = $::apache::params::passenger_conf_file, + $passenger_conf_package_file = $::apache::params::passenger_conf_package_file, + $passenger_high_performance = undef, + $passenger_pool_idle_time = undef, + $passenger_max_request_queue_size = undef, + $passenger_max_requests = undef, + $passenger_spawn_method = undef, + $passenger_stat_throttle_rate = undef, + $rack_autodetect = undef, + $rails_autodetect = undef, + $passenger_root = $::apache::params::passenger_root, + $passenger_ruby = $::apache::params::passenger_ruby, + $passenger_default_ruby = $::apache::params::passenger_default_ruby, + $passenger_max_pool_size = undef, + $passenger_min_instances = undef, + $passenger_use_global_queue = undef, + $passenger_app_env = undef, + $passenger_log_file = undef, + $mod_package = undef, + $mod_package_ensure = undef, + $mod_lib = undef, + $mod_lib_path = undef, + $mod_id = undef, + $mod_path = undef, ) { if $passenger_spawn_method { diff --git a/apache/manifests/mod/security.pp b/apache/manifests/mod/security.pp index 050b1bd6f..4571e2fd2 100644 --- a/apache/manifests/mod/security.pp +++ b/apache/manifests/mod/security.pp @@ -26,7 +26,7 @@ if $crs_package { package { $crs_package: ensure => 'latest', - before => File['security.conf'], + before => File[$::apache::confd_dir], } } diff --git a/apache/manifests/params.pp b/apache/manifests/params.pp index ab6c0d1e8..28692001c 100644 --- a/apache/manifests/params.pp +++ b/apache/manifests/params.pp @@ -52,7 +52,7 @@ } else { $verify_command = '/usr/sbin/apachectl -t' } - if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' { + if $::osfamily == 'RedHat' or $::operatingsystem =~ /^[Aa]mazon$/ { $user = 'apache' $group = 'apache' $root_group = 'root' @@ -224,13 +224,20 @@ 'python' => 'libapache2-mod-python', 'rpaf' => 'libapache2-mod-rpaf', 'security' => 'libapache2-modsecurity', + 'shib2' => 'libapache2-mod-shib2', 'suphp' => 'libapache2-mod-suphp', 'wsgi' => 'libapache2-mod-wsgi', 'xsendfile' => 'libapache2-mod-xsendfile', 'shib2' => 'libapache2-mod-shib2', } + if $::osfamily == 'Debian' and versioncmp($::operatingsystemrelease, '8') < 0 { + $shib2_lib = 'mod_shib_22.so' + } else { + $shib2_lib = 'mod_shib2.so' + } $mod_libs = { - 'php5' => 'libphp5.so', + 'php5' => 'libphp5.so', + 'shib2' => $shib2_lib } $conf_template = 'apache/httpd.conf.erb' $keepalive = 'Off' diff --git a/apache/spec/acceptance/apache_parameters_spec.rb b/apache/spec/acceptance/apache_parameters_spec.rb index 00e486fb6..923df6666 100644 --- a/apache/spec/acceptance/apache_parameters_spec.rb +++ b/apache/spec/acceptance/apache_parameters_spec.rb @@ -55,7 +55,11 @@ class { 'apache': describe service($service_name) do it { is_expected.to be_running } - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { is_expected.to be_enabled } + end end end @@ -72,7 +76,11 @@ class { 'apache': describe service($service_name) do it { is_expected.not_to be_running } - it { is_expected.not_to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { is_expected.not_to be_enabled } + end end end @@ -90,7 +98,11 @@ class { 'apache': describe service($service_name) do it { is_expected.not_to be_running } - it { is_expected.not_to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { is_expected.not_to be_enabled } + end end end diff --git a/apache/spec/acceptance/class_spec.rb b/apache/spec/acceptance/class_spec.rb index 0e797b61d..cd13985f6 100644 --- a/apache/spec/acceptance/class_spec.rb +++ b/apache/spec/acceptance/class_spec.rb @@ -18,7 +18,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -67,7 +71,11 @@ class { 'apache': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end end diff --git a/apache/spec/acceptance/itk_spec.rb b/apache/spec/acceptance/itk_spec.rb index c220a70f8..5be43b1fe 100644 --- a/apache/spec/acceptance/itk_spec.rb +++ b/apache/spec/acceptance/itk_spec.rb @@ -4,11 +4,21 @@ when 'Debian' service_name = 'apache2' majrelease = fact('operatingsystemmajrelease') - if [ '6', '7', '10.04', '12.04'].include?(majrelease) + if ['6', '7', '10.04', '12.04'].include?(majrelease) variant = :itk_only else variant = :prefork end +when 'RedHat' + unless fact('operatingsystemmajrelease') == '5' + service_name = 'httpd' + majrelease = fact('operatingsystemmajrelease') + if ['6'].include?(majrelease) + variant = :itk_only + else + variant = :prefork + end + end when 'FreeBSD' service_name = 'apache24' majrelease = fact('operatingsystemmajrelease') @@ -43,6 +53,10 @@ class { 'apache': describe service(service_name) do it { is_expected.to be_running } - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end end end diff --git a/apache/spec/acceptance/mod_dav_svn_spec.rb b/apache/spec/acceptance/mod_dav_svn_spec.rb index e4092d03a..9abd12aed 100644 --- a/apache/spec/acceptance/mod_dav_svn_spec.rb +++ b/apache/spec/acceptance/mod_dav_svn_spec.rb @@ -25,7 +25,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -46,7 +50,11 @@ class { 'apache::mod::dav_svn': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_deflate_spec.rb b/apache/spec/acceptance/mod_deflate_spec.rb index c1ee4d384..1b55e087a 100644 --- a/apache/spec/acceptance/mod_deflate_spec.rb +++ b/apache/spec/acceptance/mod_deflate_spec.rb @@ -12,7 +12,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_mime_spec.rb b/apache/spec/acceptance/mod_mime_spec.rb index ead76adc1..f8bc7c15c 100644 --- a/apache/spec/acceptance/mod_mime_spec.rb +++ b/apache/spec/acceptance/mod_mime_spec.rb @@ -12,7 +12,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_negotiation_spec.rb b/apache/spec/acceptance/mod_negotiation_spec.rb index 142b412ad..56c29e318 100644 --- a/apache/spec/acceptance/mod_negotiation_spec.rb +++ b/apache/spec/acceptance/mod_negotiation_spec.rb @@ -17,7 +17,11 @@ class { '::apache::mod::negotiation': } end describe service($service_name) do - it { should be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { should be_running } end end @@ -38,7 +42,11 @@ class { '::apache::mod::negotiation': end describe service($service_name) do - it { should be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { should be_running } end end @@ -59,7 +67,11 @@ class { '::apache::mod::negotiation': end describe service($service_name) do - it { should be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { should be_running } end end diff --git a/apache/spec/acceptance/mod_pagespeed_spec.rb b/apache/spec/acceptance/mod_pagespeed_spec.rb index ab50a54d0..2434fbb4e 100644 --- a/apache/spec/acceptance/mod_pagespeed_spec.rb +++ b/apache/spec/acceptance/mod_pagespeed_spec.rb @@ -48,7 +48,11 @@ class { 'apache::mod::pagespeed': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_passenger_spec.rb b/apache/spec/acceptance/mod_passenger_spec.rb index 88c8aff32..086c93eea 100644 --- a/apache/spec/acceptance/mod_passenger_spec.rb +++ b/apache/spec/acceptance/mod_passenger_spec.rb @@ -97,7 +97,11 @@ class { 'apache::mod::passenger': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -150,7 +154,7 @@ class { 'apache::mod::passenger': } # passenger-memory-stats output on newer Debian/Ubuntu verions do not contain # these two lines unless ((fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04') or - (fact('operatingsystem') == 'Debian' && fact('operatingsystemrelease') == '8.0')) + (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8')) expect(r.stdout).to match(/### Processes: [0-9]+/) expect(r.stdout).to match(/### Total private dirty RSS: [0-9\.]+ MB/) end @@ -167,7 +171,8 @@ class { 'apache::mod::passenger': } shell("PATH=/usr/bin:$PATH /usr/sbin/passenger-status") do |r| # spacing may vary expect(r.stdout).to match(/[\-]+ General information [\-]+/) - if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04' + if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04' or + fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8' expect(r.stdout).to match(/Max pool size[ ]+: [0-9]+/) expect(r.stdout).to match(/Processes[ ]+: [0-9]+/) expect(r.stdout).to match(/Requests in top-level queue[ ]+: [0-9]+/) diff --git a/apache/spec/acceptance/mod_php_spec.rb b/apache/spec/acceptance/mod_php_spec.rb index a5529851f..11bcafcba 100644 --- a/apache/spec/acceptance/mod_php_spec.rb +++ b/apache/spec/acceptance/mod_php_spec.rb @@ -23,7 +23,11 @@ class { 'apache::mod::php': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -66,7 +70,11 @@ class { 'apache::mod::php': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_proxy_html_spec.rb b/apache/spec/acceptance/mod_proxy_html_spec.rb index 3e1158691..f87d82583 100644 --- a/apache/spec/acceptance/mod_proxy_html_spec.rb +++ b/apache/spec/acceptance/mod_proxy_html_spec.rb @@ -24,7 +24,11 @@ class { 'apache::mod::proxy_html': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end end diff --git a/apache/spec/acceptance/mod_security_spec.rb b/apache/spec/acceptance/mod_security_spec.rb index 75f417588..d6f2987df 100644 --- a/apache/spec/acceptance/mod_security_spec.rb +++ b/apache/spec/acceptance/mod_security_spec.rb @@ -45,7 +45,11 @@ class { 'apache::mod::security': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -91,7 +95,11 @@ class { 'apache::mod::security': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -143,7 +151,11 @@ class { 'apache::mod::security': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -199,7 +211,11 @@ class { 'apache::mod::security': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/mod_suphp_spec.rb b/apache/spec/acceptance/mod_suphp_spec.rb index da2c6042e..fb23b504d 100644 --- a/apache/spec/acceptance/mod_suphp_spec.rb +++ b/apache/spec/acceptance/mod_suphp_spec.rb @@ -27,7 +27,11 @@ class { 'apache::mod::suphp': } end describe service('apache2') do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end diff --git a/apache/spec/acceptance/nodesets/debian-82-x64.yml b/apache/spec/acceptance/nodesets/debian-82-x64.yml new file mode 100644 index 000000000..800c49aaa --- /dev/null +++ b/apache/spec/acceptance/nodesets/debian-82-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-82: + roles: + - master + platform: debian-8-amd64 + box: puppetlabs/debian-8.2-64-nocm + hypervisor: vagrant +CONFIG: + log_level: debug + type: git diff --git a/apache/spec/acceptance/prefork_worker_spec.rb b/apache/spec/acceptance/prefork_worker_spec.rb index 7ba13950d..22eaaddea 100644 --- a/apache/spec/acceptance/prefork_worker_spec.rb +++ b/apache/spec/acceptance/prefork_worker_spec.rb @@ -21,7 +21,11 @@ class { 'apache': describe service($service_name) do it { is_expected.to be_running } - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end end end end @@ -44,7 +48,11 @@ class { 'apache': describe service($service_name) do it { is_expected.to be_running } - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end end end @@ -66,6 +74,10 @@ class { 'apache': describe service($service_name) do it { is_expected.to be_running } - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end end end diff --git a/apache/spec/acceptance/vhost_spec.rb b/apache/spec/acceptance/vhost_spec.rb index 9d5306b28..b9b3a80ac 100644 --- a/apache/spec/acceptance/vhost_spec.rb +++ b/apache/spec/acceptance/vhost_spec.rb @@ -173,7 +173,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -213,7 +217,11 @@ class { 'apache': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -265,7 +273,11 @@ class { 'apache': end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -322,7 +334,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -380,7 +396,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -414,7 +434,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -488,7 +512,11 @@ class { 'apache': } end describe service($service_name) do - it { should be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { should be_running } end @@ -523,7 +551,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -564,7 +596,11 @@ class { 'apache': } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -610,7 +646,11 @@ class { 'apache': default_vhost => false, } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -651,7 +691,11 @@ class { 'apache': default_vhost => false, } end describe service($service_name) do - it { is_expected.to be_enabled } + if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') + pending 'Should be enabled - Bug 760616 on Debian 8' + else + it { should be_enabled } + end it { is_expected.to be_running } end @@ -750,6 +794,8 @@ class { 'apache': } it { is_expected.not_to contain 'NameVirtualHost test.server' } elsif fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') =~ /(14\.04|13\.10)/ it { is_expected.not_to contain 'NameVirtualHost test.server' } + elsif fact('operatingsystem') == 'Debian' and fact('operatingsystemmajrelease') == '8' + it { is_expected.not_to contain 'NameVirtualHost test.server' } else it { is_expected.to contain 'NameVirtualHost test.server' } end @@ -1013,7 +1059,7 @@ class { 'apache': service_ensure => stopped, } describe file("#{$vhost_dir}/25-test.server.conf") do it { is_expected.to be_file } - it { is_expected.to contain 'ProxyPass / test2/' } + it { is_expected.to contain 'ProxyPass / test2/' } end end @@ -1076,8 +1122,8 @@ class { 'apache': service_ensure => stopped, } describe file("#{$vhost_dir}/25-test.server.conf") do it { is_expected.to be_file } - it { is_expected.to contain 'ProxyPass / http://test2/' } it { is_expected.to contain 'ProxyPass http://test2/test !' } + it { is_expected.to contain 'ProxyPass / http://test2/' } end end diff --git a/apache/spec/classes/mod/itk_spec.rb b/apache/spec/classes/mod/itk_spec.rb index cd2e6c67a..27369f144 100644 --- a/apache/spec/classes/mod/itk_spec.rb +++ b/apache/spec/classes/mod/itk_spec.rb @@ -55,6 +55,55 @@ it { is_expected.to contain_file("/etc/apache2/mods-enabled/itk.load").with_ensure('link') } end end + context "on a RedHat OS" do + let :facts do + { + :osfamily => 'RedHat', + :operatingsystemrelease => '6', + :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + :is_pe => false, + } + end + it { is_expected.to contain_class("apache::params") } + it { is_expected.not_to contain_apache__mod('itk') } + it { is_expected.to contain_file("/etc/httpd/conf.d/itk.conf").with_ensure('file') } + it { is_expected.to contain_package("httpd-itk") } + + context "with Apache version < 2.4" do + let :params do + { + :apache_version => '2.2', + } + end + + it { is_expected.to contain_file_line("/etc/sysconfig/httpd itk enable").with({ + 'require' => 'Package[httpd]', + }) + } + end + + context "with Apache version >= 2.4" do + let :pre_condition do + 'class { "apache": mpm_module => prefork, }' + end + + let :params do + { + :apache_version => '2.4', + } + end + + it { is_expected.to contain_file("/etc/httpd/conf.d/itk.load").with({ + 'ensure' => 'file', + 'content' => "LoadModule mpm_itk_module modules/mod_mpm_itk.so\n" + }) + } + end + end context "on a FreeBSD OS" do let :pre_condition do 'class { "apache": mpm_module => false, }' diff --git a/apache/spec/classes/mod/passenger_spec.rb b/apache/spec/classes/mod/passenger_spec.rb index 34dcc5c6f..1cae95c45 100644 --- a/apache/spec/classes/mod/passenger_spec.rb +++ b/apache/spec/classes/mod/passenger_spec.rb @@ -57,6 +57,13 @@ end it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerPoolIdleTime 1200$/) } end + describe "with passenger_max_request_queue_size => 100" do + let :params do + { :passenger_max_request_queue_size => 100 } + end + it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMaxRequestQueueSize 100$/) } + end + describe "with passenger_max_requests => 20" do let :params do { :passenger_max_requests => 20 } diff --git a/apache/spec/classes/mod/php_spec.rb b/apache/spec/classes/mod/php_spec.rb index 6814b8a8f..3aaa3d329 100644 --- a/apache/spec/classes/mod/php_spec.rb +++ b/apache/spec/classes/mod/php_spec.rb @@ -117,9 +117,13 @@ let :pre_condition do 'class { "apache": mpm_module => itk, }' end - it 'should raise an error' do - expect { expect(subject).to contain_class("apache::mod::itk") }.to raise_error Puppet::Error, /Unsupported osfamily RedHat/ - end + it { is_expected.to contain_class("apache::params") } + it { is_expected.to contain_class("apache::mod::itk") } + it { is_expected.to contain_apache__mod('php5') } + it { is_expected.to contain_package("php") } + it { is_expected.to contain_file("php5.load").with( + :content => "LoadModule php5_module modules/libphp5.so\n" + ) } end end describe "on a FreeBSD OS" do diff --git a/apache/spec/defines/vhost_spec.rb b/apache/spec/defines/vhost_spec.rb index 98d70239a..40d93a0ee 100644 --- a/apache/spec/defines/vhost_spec.rb +++ b/apache/spec/defines/vhost_spec.rb @@ -238,6 +238,11 @@ 'retry' => '0', 'timeout' => '5' }, + 'options' => { + 'Require' =>'valid-user', + 'AuthType' =>'Kerberos', + 'AuthName' =>'"Kerberos Login"' + }, 'setenv' => ['proxy-nokeepalive 1','force-proxy-request-1.0 1'], } ], @@ -440,6 +445,13 @@ /ProxyPassReverseCookiePath\s+\/a\s+http:\/\//) } it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( /ProxyPassReverseCookieDomain\s+foo\s+http:\/\/foo/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /Require valid-user/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /AuthType Kerberos/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-proxy').with_content( + /AuthName "Kerberos Login"/) } + it { is_expected.to contain_concat__fragment('rspec.example.com-rack') } it { is_expected.to contain_concat__fragment('rspec.example.com-redirect') } it { is_expected.to contain_concat__fragment('rspec.example.com-rewrite') } diff --git a/apache/spec/spec_helper_acceptance.rb b/apache/spec/spec_helper_acceptance.rb index 6bfdefd71..cdaec445d 100644 --- a/apache/spec/spec_helper_acceptance.rb +++ b/apache/spec/spec_helper_acceptance.rb @@ -43,6 +43,12 @@ if fact('osfamily') == 'RedHat' on host, puppet('module','install','stahnma/epel') on host, puppet('module','install','puppetlabs/inifile') + #we need epel installed, so we can get plugins, wsgi, mime ... + pp = <<-EOS + class { 'epel': } + EOS + + apply_manifest_on(host, pp, :catch_failures => true) end # Required for manifest to make mod_pagespeed repository available diff --git a/apache/templates/mod/passenger.conf.erb b/apache/templates/mod/passenger.conf.erb index 9bd13c22a..8a3e9d4f3 100644 --- a/apache/templates/mod/passenger.conf.erb +++ b/apache/templates/mod/passenger.conf.erb @@ -22,6 +22,9 @@ <%- if @passenger_pool_idle_time -%> PassengerPoolIdleTime <%= @passenger_pool_idle_time %> <%- end -%> + <%- if @passenger_max_request_queue_size -%> + PassengerMaxRequestQueueSize <%= @passenger_max_request_queue_size %> + <%- end -%> <%- if @passenger_max_requests -%> PassengerMaxRequests <%= @passenger_max_requests %> <%- end -%> diff --git a/apache/templates/vhost/_proxy.erb b/apache/templates/vhost/_proxy.erb index 16a889cb4..4e36361ca 100644 --- a/apache/templates/vhost/_proxy.erb +++ b/apache/templates/vhost/_proxy.erb @@ -14,74 +14,71 @@ <%- [@proxy_pass].flatten.compact.each do |proxy| -%> ProxyPass <%= proxy['path'] %> <%= proxy['url'] -%> <%- if proxy['params'] -%> - <%- proxy['params'].each_pair do |key, value| -%> <%= key %>=<%= value -%> + <%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%> <%- end -%> <%- end -%> <%- if proxy['keywords'] %> <%= proxy['keywords'].join(' ') -%> <%- end %> - > <%- if not proxy['reverse_cookies'].nil? -%> <%- Array(proxy['reverse_cookies']).each do |reverse_cookies| -%> <%- if reverse_cookies['path'] -%> - ProxyPassReverseCookiePath <%= reverse_cookies['path'] %> <%= reverse_cookies['url'] %> + ProxyPassReverseCookiePath <%= reverse_cookies['path'] %> <%= reverse_cookies['url'] %> <%- end -%> <%- if reverse_cookies['domain'] -%> - ProxyPassReverseCookieDomain <%= reverse_cookies['domain'] %> <%= reverse_cookies['url'] %> + ProxyPassReverseCookieDomain <%= reverse_cookies['domain'] %> <%= reverse_cookies['url'] %> <%- end -%> <%- end -%> <%- end -%> <%- if proxy['reverse_urls'].nil? -%> - ProxyPassReverse <%= proxy['url'] %> + ProxyPassReverse <%= proxy['path'] %> <%= proxy['url'] %> <%- else -%> <%- Array(proxy['reverse_urls']).each do |reverse_url| -%> - ProxyPassReverse <%= reverse_url %> + ProxyPassReverse <%= proxy['path'] %> <%= reverse_url %> <%- end -%> <%- end -%> <%- if proxy['setenv'] -%> <%- Array(proxy['setenv']).each do |setenv_var| -%> - SetEnv <%= setenv_var %> + SetEnv <%= setenv_var %> + <%- end -%> + <%- end -%> + <%- if proxy['options'] -%> + <%- proxy['options'].keys.sort.each do |key| -%> + <%= key %> <%= proxy['options'][key] %> <%- end -%> <%- end -%> - <% end -%> <% [@proxy_pass_match].flatten.compact.each do |proxy| %> ProxyPassMatch <%= proxy['path'] %> <%= proxy['url'] -%> <%- if proxy['params'] -%> - <%- proxy['params'].each_pair do |key, value| -%> <%= key %>=<%= value -%> + <%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%> <%- end -%> <%- end -%> <%- if proxy['keywords'] %> <%= proxy['keywords'].join(' ') -%> <%- end %> - > <%- if proxy['reverse_urls'].nil? -%> - ProxyPassReverse <%= proxy['url'] %> + ProxyPassReverse <%= proxy['path'] %> <%= proxy['url'] %> <%- else -%> <%- Array(proxy['reverse_urls']).each do |reverse_url| -%> - ProxyPassReverse <%= reverse_url %> + ProxyPassReverse <%= proxy['path'] %> <%= reverse_url %> <%- end -%> <%- end -%> <%- if proxy['setenv'] -%> <%- Array(proxy['setenv']).each do |setenv_var| -%> - SetEnv <%= setenv_var %> + SetEnv <%= setenv_var %> <%- end -%> <%- end -%> - <% end -%> <% if @proxy_dest -%> <%- Array(@no_proxy_uris).each do |uri| -%> ProxyPass <%= uri %> ! <% end -%> - ProxyPass / <%= @proxy_dest %>/ - - ProxyPassReverse <%= @proxy_dest %>/ - + ProxyPass / <%= @proxy_dest %>/ + ProxyPassReverse / <%= @proxy_dest %>/ <% end -%> <% if @proxy_dest_match -%> <%- Array(@no_proxy_uris_match).each do |uri| -%> - ProxyPassMatch <%= uri %> ! + ProxyPassMatch <%= uri %> ! <% end -%> - ProxyPassMatch / <%= @proxy_dest_match %>/ - - ProxyPassReverse <%= @proxy_dest_reverse_match %>/ - + ProxyPassMatch / <%= @proxy_dest_match %>/ + ProxyPassReverse / <%= @proxy_dest_reverse_match %>/ <% end -%> diff --git a/ceph/manifests/mon.pp b/ceph/manifests/mon.pp index 190f10742..f1429e7df 100644 --- a/ceph/manifests/mon.pp +++ b/ceph/manifests/mon.pp @@ -51,6 +51,9 @@ # [*keyring*] Path of the [mon.] keyring file # Optional. $key and $keyring are mutually exclusive. # +# [*exec_timeout*] The default exec resource timeout, in seconds +# Optional. Defaults to $::ceph::params::exec_timeout +# define ceph::mon ( $ensure = present, $public_addr = undef, @@ -58,6 +61,7 @@ $authentication_type = 'cephx', $key = undef, $keyring = undef, + $exec_timeout = $::ceph::params::exec_timeout, ) { # a puppet name translates into a ceph id, the meaning is different @@ -133,6 +137,9 @@ command => "/bin/true # comment to satisfy puppet syntax requirements set -ex touch /etc/ceph/${cluster_name}.client.admin.keyring", + unless => "/bin/true # comment to satisfy puppet syntax requirements +set -ex +test -e /etc/ceph/${cluster_name}.client.admin.keyring", } -> exec { $ceph_mkfs: @@ -151,21 +158,30 @@ rm -fr \$mon_data fi fi +", + unless => "/bin/true # comment to satisfy puppet syntax requirements +set -ex +mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data) +test -d \$mon_data ", logoutput => true, + timeout => $exec_timeout, } -> service { $mon_service: ensure => running, } - if $authentication_type == 'cephx' { if $key { Exec[$ceph_mkfs] -> Exec["rm-keyring-${id}"] exec { "rm-keyring-${id}": command => "/bin/rm ${keyring_path}", + unless => "/bin/true # comment to satisfy puppet syntax requirements +set -ex +test ! -e ${keyring_path} +", } } } @@ -188,6 +204,7 @@ test ! -d \$mon_data ", logoutput => true, + timeout => $exec_timeout, } -> Package<| tag == 'ceph' |> } } diff --git a/ceph/manifests/osd.pp b/ceph/manifests/osd.pp index 83583ada3..356442c6d 100644 --- a/ceph/manifests/osd.pp +++ b/ceph/manifests/osd.pp @@ -38,10 +38,14 @@ # [*cluster*] The ceph cluster # Optional. Same default as ceph. # +# [*exec_timeout*] The default exec resource timeout, in seconds +# Optional. Defaults to $::ceph::params::exec_timeout +# define ceph::osd ( $ensure = present, $journal = undef, $cluster = undef, + $exec_timeout = $::ceph::params::exec_timeout, ) { $data = $name @@ -76,6 +80,7 @@ ls -l /var/lib/ceph/osd/${cluster_name}-* | grep ' ${data}\$' ", logoutput => true, + timeout => $exec_timeout, } Exec[$ceph_prepare] -> Exec[$ceph_activate] @@ -135,6 +140,7 @@ fi ", logoutput => true, + timeout => $exec_timeout, } -> Ceph::Mon<| ensure == absent |> } diff --git a/ceph/manifests/params.pp b/ceph/manifests/params.pp index 4d2c50a2f..999da3758 100644 --- a/ceph/manifests/params.pp +++ b/ceph/manifests/params.pp @@ -22,6 +22,8 @@ # should be considered to be constant # # === Parameters: +# [*exec_timeout*] The default exec resource timeout, in seconds +# Optional. Defaults to 600 # # [*packages*] The ceph package name # Optional. Defaults to 'ceph' @@ -30,6 +32,7 @@ # Optional. Defaults to '/tmp/radosgw.sock' # class ceph::params ( + $exec_timeout = 600, $packages = 'ceph', # just provide the minimum per default $rgw_socket_path = '/tmp/radosgw.sock', ) { diff --git a/ceph/manifests/pool.pp b/ceph/manifests/pool.pp index fd2edf595..a30d21d5e 100644 --- a/ceph/manifests/pool.pp +++ b/ceph/manifests/pool.pp @@ -43,11 +43,15 @@ # Optional. Default is undef. # Increase or decrease the replica level of a pool. # +# [*exec_timeout*] The default exec resource timeout, in seconds +# Optional. Defaults to $::ceph::params::exec_timeout +# define ceph::pool ( $ensure = present, $pg_num = 64, $pgp_num = undef, $size = undef, + $exec_timeout = $::ceph::params::exec_timeout, ) { if $ensure == present { @@ -62,6 +66,7 @@ unless => "/bin/true # comment to satisfy puppet syntax requirements set -ex ceph osd lspools | grep ' ${name},'", + timeout => $exec_timeout, } exec { "set-${name}-pg_num": @@ -72,6 +77,7 @@ set -ex test $(ceph osd pool get ${name} pg_num | sed 's/.*:\s*//g') -ge ${pg_num}", require => Exec["create-${name}"], + timeout => $exec_timeout, } if $pgp_num { @@ -83,6 +89,7 @@ set -ex test $(ceph osd pool get ${name} pgp_num | sed 's/.*:\s*//g') -ge ${pgp_num}", require => Exec["create-${name}"], + timeout => $exec_timeout, } } @@ -95,6 +102,7 @@ set -ex test $(ceph osd pool get ${name} size | sed 's/.*:\s*//g') -eq ${size}", require => Exec["create-${name}"], + timeout => $exec_timeout, } } @@ -107,6 +115,7 @@ onlyif => "/bin/true # comment to satisfy puppet syntax requirements set -ex ceph osd lspools | grep ${name}", + timeout => $exec_timeout, } -> Ceph::Mon<| ensure == absent |> } else { diff --git a/ceph/manifests/repo.pp b/ceph/manifests/repo.pp index 5f791efa4..b17c6d093 100644 --- a/ceph/manifests/repo.pp +++ b/ceph/manifests/repo.pp @@ -107,7 +107,11 @@ $el = '7' } - if ($::operatingsystem == 'CentOS') { + # Firefly is the last ceph.com supported release which conflicts with + # the CentOS 7 base channel. Therefore make sure to only exclude the + # conflicting packages in the exact combination of CentOS7 and Firefly. + # TODO: Remove this once Firefly becomes EOL + if ($::operatingsystem == 'CentOS' and $el == '7' and $release == 'firefly') { file_line { 'exclude base': ensure => $ensure, path => '/etc/yum.repos.d/CentOS-Base.repo', diff --git a/ceph/spec/classes/ceph_repo_spec.rb b/ceph/spec/classes/ceph_repo_spec.rb index 4ff9dd820..92eb452ed 100644 --- a/ceph/spec/classes/ceph_repo_spec.rb +++ b/ceph/spec/classes/ceph_repo_spec.rb @@ -195,6 +195,8 @@ describe "with default params" do + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-6').with( :enabled => '1', :descr => 'External EPEL 6', @@ -237,6 +239,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-6').with( :enabled => '1', :descr => 'External EPEL 6', @@ -281,6 +285,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-6').with( :enabled => '0', :descr => 'External EPEL 6', @@ -346,6 +352,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-6').with( :enabled => '1', :descr => 'External EPEL 6', @@ -400,6 +408,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-6').with( :enabled => '1', :descr => 'External EPEL 6', @@ -460,6 +470,8 @@ describe "with default params" do + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-7').with( :enabled => '1', :descr => 'External EPEL 7', @@ -502,6 +514,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-7').with( :enabled => '1', :descr => 'External EPEL 7', @@ -546,6 +560,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-7').with( :enabled => '0', :descr => 'External EPEL 7', @@ -602,6 +618,8 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-7').with( :enabled => '1', :descr => 'External EPEL 7', @@ -646,6 +664,545 @@ } end + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-7').with( + :enabled => '1', + :descr => 'External EPEL 7', + :name => 'ext-epel-7', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el7/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el7/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with( + :enabled => '1', + :descr => 'FastCGI basearch packages for Ceph', + :name => 'ext-ceph-fastcgi', + :baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/autobuild.asc', + :mirrorlist => 'absent', + :priority => '20' + ) } + + end + end + + + describe 'CentOS6' do + + let :facts do + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + :operatingsystemmajrelease => '6', + } + end + + describe "with default params" do + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-6').with( + :enabled => '1', + :descr => 'External EPEL 6', + :name => 'ext-epel-6', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el6/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + end + + describe "when overriding ceph release" do + let :params do + { + :release => 'firefly' + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-6').with( + :enabled => '1', + :descr => 'External EPEL 6', + :name => 'ext-epel-6', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph firefly', + :name => 'ext-ceph-firefly', + :baseurl => 'http://ceph.com/rpm-firefly/el6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-firefly-noarch', + :baseurl => 'http://ceph.com/rpm-firefly/el6/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + end + + describe "with ensure => absent to disable" do + let :params do + { + :ensure => 'absent', + :extras => true, + :fastcgi => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-6').with( + :enabled => '0', + :descr => 'External EPEL 6', + :name => 'ext-epel-6', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '0', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '0', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el6/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-extras').with( + :enabled => '0', + :descr => 'External Ceph Extras', + :name => 'ext-ceph-extras', + :baseurl => 'http://ceph.com/packages/ceph-extras/rpm/rhel6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with( + :enabled => '0', + :descr => 'FastCGI basearch packages for Ceph', + :name => 'ext-ceph-fastcgi', + :baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel6-x86_64-basic/ref/master', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/autobuild.asc', + :mirrorlist => 'absent', + :priority => '20' + ) } + + end + + describe "with ceph extras" do + let :params do + { + :extras => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-6').with( + :enabled => '1', + :descr => 'External EPEL 6', + :name => 'ext-epel-6', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el6/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-extras').with( + :enabled => '1', + :descr => 'External Ceph Extras', + :name => 'ext-ceph-extras', + :baseurl => 'http://ceph.com/packages/ceph-extras/rpm/rhel6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + end + + describe "with ceph fast-cgi" do + let :params do + { + :fastcgi => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-6').with( + :enabled => '1', + :descr => 'External EPEL 6', + :name => 'ext-epel-6', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el6/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el6/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with( + :enabled => '1', + :descr => 'FastCGI basearch packages for Ceph', + :name => 'ext-ceph-fastcgi', + :baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel6-x86_64-basic/ref/master', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/autobuild.asc', + :mirrorlist => 'absent', + :priority => '20' + ) } + + end + end + + describe 'CentOS7' do + + let :facts do + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + :operatingsystemmajrelease => '7', + } + end + + describe "with default params" do + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-7').with( + :enabled => '1', + :descr => 'External EPEL 7', + :name => 'ext-epel-7', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el7/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el7/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + end + + describe "when overriding ceph release" do + let :params do + { + :release => 'firefly' + } + end + + it { is_expected.to contain_file_line('exclude base').with( + :ensure => 'present', + :path => '/etc/yum.repos.d/CentOS-Base.repo', + :after => '^\[base\]$', + :line => 'exclude=python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-epel-7').with( + :enabled => '1', + :descr => 'External EPEL 7', + :name => 'ext-epel-7', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph firefly', + :name => 'ext-ceph-firefly', + :baseurl => 'http://ceph.com/rpm-firefly/el7/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-firefly-noarch', + :baseurl => 'http://ceph.com/rpm-firefly/el7/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + end + + describe "with ensure => absent to disable" do + let :params do + { + :ensure => 'absent', + :extras => true, + :fastcgi => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-7').with( + :enabled => '0', + :descr => 'External EPEL 7', + :name => 'ext-epel-7', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '0', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el7/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '0', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el7/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.not_to contain_yumrepo('ext-ceph-extras') } + + it { is_expected.to contain_yumrepo('ext-ceph-fastcgi').with( + :enabled => '0', + :descr => 'FastCGI basearch packages for Ceph', + :name => 'ext-ceph-fastcgi', + :baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/autobuild.asc', + :mirrorlist => 'absent', + :priority => '20' + ) } + + end + + describe "with ceph extras" do + let :params do + { + :extras => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + + it { is_expected.to contain_yumrepo('ext-epel-7').with( + :enabled => '1', + :descr => 'External EPEL 7', + :name => 'ext-epel-7', + :baseurl => 'absent', + :gpgcheck => '1', + :gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', + :mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', + :priority => '20', + :exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', + ) } + + it { is_expected.to contain_yumrepo('ext-ceph').with( + :enabled => '1', + :descr => 'External Ceph hammer', + :name => 'ext-ceph-hammer', + :baseurl => 'http://ceph.com/rpm-hammer/el7/$basearch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( + :enabled => '1', + :descr => 'External Ceph noarch', + :name => 'ext-ceph-hammer-noarch', + :baseurl => 'http://ceph.com/rpm-hammer/el7/noarch', + :gpgcheck => '1', + :gpgkey => 'https://git.ceph.com/release.asc', + :mirrorlist => 'absent', + :priority => '10' + ) } + + it { is_expected.not_to contain_yumrepo('ext-ceph-extras') } + end + + describe "with ceph fast-cgi" do + let :params do + { + :fastcgi => true + } + end + + it { is_expected.not_to contain_file_line('exclude base') } + it { is_expected.to contain_yumrepo('ext-epel-7').with( :enabled => '1', :descr => 'External EPEL 7', diff --git a/ceph/spec/defines/ceph_mon_spec.rb b/ceph/spec/defines/ceph_mon_spec.rb index 5c4656f32..ee52c282a 100644 --- a/ceph/spec/defines/ceph_mon_spec.rb +++ b/ceph/spec/defines/ceph_mon_spec.rb @@ -234,7 +234,10 @@ it { is_expected.to contain_exec('ceph-mon-ceph.client.admin.keyring-A').with( 'command' => '/bin/true # comment to satisfy puppet syntax requirements set -ex -touch /etc/ceph/ceph.client.admin.keyring' +touch /etc/ceph/ceph.client.admin.keyring', + 'unless' => '/bin/true # comment to satisfy puppet syntax requirements +set -ex +test -e /etc/ceph/ceph.client.admin.keyring' ) } it { is_expected.to contain_exec('ceph-mon-mkfs-A').with( 'command' => "/bin/true # comment to satisfy puppet syntax requirements @@ -257,7 +260,12 @@ it { is_expected.to contain_file('/tmp/ceph-mon-keyring-A').with( 'mode' => '0444', 'content' => "[mon.]\n\tkey = AQATGHJTUCBqIBAA7M2yafV1xctn1pgr3GcKPg==\n\tcaps mon = \"allow *\"\n") } - it { is_expected.to contain_exec('rm-keyring-A').with('command' => '/bin/rm /tmp/ceph-mon-keyring-A') } + it { is_expected.to contain_exec('rm-keyring-A').with( + 'command' => '/bin/rm /tmp/ceph-mon-keyring-A', + 'unless' => '/bin/true # comment to satisfy puppet syntax requirements +set -ex +test ! -e /tmp/ceph-mon-keyring-A +') } end describe 'with keyring' do diff --git a/elasticsearch/CHANGELOG.md b/elasticsearch/CHANGELOG.md index 3e1bcdb30..e7be456af 100644 --- a/elasticsearch/CHANGELOG.md +++ b/elasticsearch/CHANGELOG.md @@ -1,3 +1,22 @@ +##0.10.1 ( Dec 17, 2015 ) + +###Summary +Bugfix release for proxy functionality in plugin installation + +####Features + +####Bugfixes +* Proxy settings were not passed on correctly + +####Changes +* Cleanup .pmtignore to exclude more files + +####Testing changes + +####Known bugs +* Possible package conflicts when using ruby/python defines with main package name + + ##0.10.0 ( Dec 14, 2015 ) ###Summary diff --git a/elasticsearch/LICENSE b/elasticsearch/LICENSE index 619edcc24..0455cacdf 100644 --- a/elasticsearch/LICENSE +++ b/elasticsearch/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2015 Elasticsearch +Copyright (c) 2012-2016 Elasticsearch Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 80737b620..413637871 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -335,8 +335,7 @@ class { 'elasticsearch': #####hash representation ```puppet $config_hash = { - 'ES_USER' => 'elasticsearch', - 'ES_GROUP' => 'elasticsearch', + 'ES_HEAP_SIZE' => '30g', } class { 'elasticsearch': diff --git a/elasticsearch/lib/puppet/provider/elasticsearch_plugin/plugin.rb b/elasticsearch/lib/puppet/provider/elasticsearch_plugin/plugin.rb index 4c8bb2913..6fb29b0f5 100644 --- a/elasticsearch/lib/puppet/provider/elasticsearch_plugin/plugin.rb +++ b/elasticsearch/lib/puppet/provider/elasticsearch_plugin/plugin.rb @@ -73,12 +73,24 @@ def install2x def create es_version commands = [] - commands << @resource[:proxy_args] if @resource[:proxy_args] + commands << @resource[:proxy_args].split(' ') if @resource[:proxy_args] commands << 'install' commands << install1x if is1x? commands << install2x if is2x? + debug("Commands: #{commands.inspect}") - plugin(commands) + retry_count = 3 + retry_times = 0 + begin + plugin(commands) + rescue Puppet::ExecutionFailure => e + retry_times += 1 + debug("Failed to install plugin. Retrying... #{retry_times} of #{retry_count}") + sleep 2 + retry if retry_times < retry_count + raise "Failed to install plugin. Received error: #{e.inspect}" + end + writepluginfile end @@ -89,9 +101,7 @@ def destroy def es_version return @es_version if @es_version begin - version = es('-v') # ES 1.x - rescue - version = es('--version') # ES 2.x + version = es('-version') rescue raise "Unknown ES version. Got #{version.inspect}" ensure diff --git a/elasticsearch/manifests/init.pp b/elasticsearch/manifests/init.pp index 768cf4c6f..0792cb59e 100644 --- a/elasticsearch/manifests/init.pp +++ b/elasticsearch/manifests/init.pp @@ -227,7 +227,7 @@ $service_provider = 'init', $init_defaults = undef, $init_defaults_file = undef, - $init_template = undef, + $init_template = "${module_name}/etc/init.d/${elasticsearch::params::init_template}", $config = undef, $datadir = $elasticsearch::params::datadir, $plugindir = $elasticsearch::params::plugindir, diff --git a/elasticsearch/manifests/instance.pp b/elasticsearch/manifests/instance.pp index f1e14fcdc..a3bd6739f 100644 --- a/elasticsearch/manifests/instance.pp +++ b/elasticsearch/manifests/instance.pp @@ -79,7 +79,8 @@ $logging_template = undef, $logging_level = $elasticsearch::default_logging_level, $init_defaults = undef, - $init_defaults_file = undef + $init_defaults_file = undef, + $init_template = $elasticsearch::init_template ) { require elasticsearch::params @@ -211,7 +212,6 @@ owner => $elasticsearch::elasticsearch_user, group => undef, mode => '0644', - recurse => true, require => [ Exec["mkdir_datadir_elasticsearch_${name}"], Class['elasticsearch::package'] ], before => Elasticsearch::Service[$name], } @@ -309,7 +309,7 @@ status => $status, init_defaults => $init_defaults_new, init_defaults_file => $init_defaults_file, - init_template => "${module_name}/etc/init.d/${elasticsearch::params::init_template}", + init_template => $init_template, require => $require_service, before => $before_service, } diff --git a/elasticsearch/manifests/plugin.pp b/elasticsearch/manifests/plugin.pp index b515a4906..5e8dc0190 100644 --- a/elasticsearch/manifests/plugin.pp +++ b/elasticsearch/manifests/plugin.pp @@ -92,7 +92,7 @@ # elasticsearch::proxy_url or use no proxy at all if ($proxy_host != undef and $proxy_port != undef) { - $proxy = " -DproxyPort=${proxy_port} -DproxyHost=${proxy_host}" + $proxy = "-DproxyPort=${proxy_port} -DproxyHost=${proxy_host}" } elsif ($elasticsearch::proxy_url != undef) { $proxy_host_from_url = regsubst($elasticsearch::proxy_url, '(http|https)://([^:]+)(|:\d+).+', '\2') @@ -100,7 +100,7 @@ # validate parsed values before using them if (is_string($proxy_host_from_url) and is_integer($proxy_port_from_url)) { - $proxy = " -DproxyPort=${proxy_port_from_url} -DproxyHost=${proxy_host_from_url}" + $proxy = "-DproxyPort=${proxy_port_from_url} -DproxyHost=${proxy_host_from_url}" } } else { diff --git a/elasticsearch/manifests/service/init.pp b/elasticsearch/manifests/service/init.pp index 0d37e1df7..59fc75db5 100644 --- a/elasticsearch/manifests/service/init.pp +++ b/elasticsearch/manifests/service/init.pp @@ -113,7 +113,7 @@ } - if ( $status != 'unmanaged' and $ensure == 'present' ) { + if ( $ensure == 'present' ) { # defaults file content. Either from a hash or file if ($init_defaults_file != undef) { @@ -127,11 +127,13 @@ notify => $notify_service, } - } elsif ($init_defaults != undef and is_hash($init_defaults) ) { + } else { - if(has_key($init_defaults, 'ES_USER')) { - if($init_defaults['ES_USER'] != $elasticsearch::elasticsearch_user) { - fail('Found ES_USER setting for init_defaults but is not same as elasticsearch_user setting. Please use elasticsearch_user setting.') + if ($init_defaults != undef and is_hash($init_defaults) ) { + if(has_key($init_defaults, 'ES_USER')) { + if($init_defaults['ES_USER'] != $elasticsearch::elasticsearch_user) { + fail('Found ES_USER setting for init_defaults but is not same as elasticsearch_user setting. Please use elasticsearch_user setting.') + } } } @@ -163,7 +165,7 @@ } - } elsif ($status != 'unmanaged') { + } else { file { "/etc/init.d/elasticsearch-${name}": ensure => 'absent', @@ -177,19 +179,15 @@ } - - if ( $status != 'unmanaged') { - - # action - service { "elasticsearch-instance-${name}": - ensure => $service_ensure, - enable => $service_enable, - name => "elasticsearch-${name}", - hasstatus => $elasticsearch::params::service_hasstatus, - hasrestart => $elasticsearch::params::service_hasrestart, - pattern => $elasticsearch::params::service_pattern, - } - + # action + service { "elasticsearch-instance-${name}": + ensure => $service_ensure, + enable => $service_enable, + name => "elasticsearch-${name}", + hasstatus => $elasticsearch::params::service_hasstatus, + hasrestart => $elasticsearch::params::service_hasrestart, + pattern => $elasticsearch::params::service_pattern, } + } diff --git a/elasticsearch/manifests/service/systemd.pp b/elasticsearch/manifests/service/systemd.pp index fb7912fbf..13b680f8a 100644 --- a/elasticsearch/manifests/service/systemd.pp +++ b/elasticsearch/manifests/service/systemd.pp @@ -108,7 +108,7 @@ false => Exec["systemd_reload_${name}"] } - if ( $status != 'unmanaged' and $ensure == 'present' ) { + if ( $ensure == 'present' ) { # defaults file content. Either from a hash or file if ($init_defaults_file != undef) { @@ -174,7 +174,7 @@ $service_require = Exec["systemd_reload_${name}"] - } elsif($status != 'unmanaged') { + } else { file { "/lib/systemd/system/elasticsearch-${name}.service": ensure => 'absent', @@ -197,20 +197,16 @@ refreshonly => true, } - if ($status != 'unmanaged') { - - # action - service { "elasticsearch-instance-${name}": - ensure => $service_ensure, - enable => $service_enable, - name => "elasticsearch-${name}.service", - hasstatus => $elasticsearch::params::service_hasstatus, - hasrestart => $elasticsearch::params::service_hasrestart, - pattern => $elasticsearch::params::service_pattern, - provider => 'systemd', - require => $service_require, - } - + # action + service { "elasticsearch-instance-${name}": + ensure => $service_ensure, + enable => $service_enable, + name => "elasticsearch-${name}.service", + hasstatus => $elasticsearch::params::service_hasstatus, + hasrestart => $elasticsearch::params::service_hasrestart, + pattern => $elasticsearch::params::service_pattern, + provider => 'systemd', + require => $service_require, } } diff --git a/elasticsearch/metadata.json b/elasticsearch/metadata.json index 0b76368e4..883fbfab3 100644 --- a/elasticsearch/metadata.json +++ b/elasticsearch/metadata.json @@ -1,6 +1,6 @@ { "name": "elasticsearch-elasticsearch", - "version": "0.10.0", + "version": "0.10.1", "source": "https://github.com/elastic/puppet-elasticsearch", "author": "elasticsearch", "license": "Apache-2.0", diff --git a/elasticsearch/spec/acceptance/020_usergroup_spec.rb b/elasticsearch/spec/acceptance/020_usergroup_spec.rb index c5cfad8d2..5e6922102 100644 --- a/elasticsearch/spec/acceptance/020_usergroup_spec.rb +++ b/elasticsearch/spec/acceptance/020_usergroup_spec.rb @@ -71,7 +71,8 @@ class { 'elasticsearch': config => { 'cluster.name' => '#{test_settings['cluster it 'should run successfully' do pp = "class { 'elasticsearch': ensure => 'absent' } - elasticsearch::instance{ 'es-01': ensure => 'absent' } + elasticsearch::instance{ 'es-01': ensure => 'absent' } -> + file { '/usr/share/elasticsearch': ensure => 'absent', force => true } " apply_manifest(pp, :catch_failures => true) diff --git a/elasticsearch/spec/defines/005_elasticsearch_instance_spec.rb b/elasticsearch/spec/defines/005_elasticsearch_instance_spec.rb index b4ef74a5d..7e831c79e 100644 --- a/elasticsearch/spec/defines/005_elasticsearch_instance_spec.rb +++ b/elasticsearch/spec/defines/005_elasticsearch_instance_spec.rb @@ -312,11 +312,11 @@ it { should contain_file('/etc/elasticsearch/es-01/logging.yml').with(:owner => 'myesuser', :group => 'myesgroup') } end - context "setting different service status then main class" do + context "setting different service status then main class" do let(:pre_condition) { 'class {"elasticsearch": status => "enabled" }' } - context "staus option" do + context "status option" do let :params do { :status => 'running' @@ -325,5 +325,22 @@ it { should contain_service('elasticsearch-instance-es-01').with(:ensure => 'running', :enable => false) } end + + end + + context "init_template" do + + context "default" do + let(:pre_condition) { 'class {"elasticsearch": }' } + + it { should contain_elasticsearch__service('es-01').with(:init_template => 'elasticsearch/etc/init.d/elasticsearch.RedHat.erb') } + end + + context "override in main class" do + let(:pre_condition) { 'class {"elasticsearch": init_template => "elasticsearch/etc/init.d/elasticsearch.systemd.erb" }' } + + it { should contain_elasticsearch__service('es-01').with(:init_template => 'elasticsearch/etc/init.d/elasticsearch.systemd.erb') } + end + end end diff --git a/elasticsearch/spec/defines/010_elasticsearch_service_init_spec.rb b/elasticsearch/spec/defines/010_elasticsearch_service_init_spec.rb index ae7e143be..20d33ed77 100644 --- a/elasticsearch/spec/defines/010_elasticsearch_service_init_spec.rb +++ b/elasticsearch/spec/defines/010_elasticsearch_service_init_spec.rb @@ -42,9 +42,8 @@ } end it { should contain_elasticsearch__service__init('es-01') } - it { should_not contain_service('elasticsearch-instance-es-01') } - it { should_not contain_file('/etc/init.d/elasticsearch-es-01') } - it { should_not contain_file('/etc/sysconfig/elasticsearch-es-01') } + it { should contain_service('elasticsearch-instance-es-01').with(:enable => false) } + it { should contain_augeas('defaults_es-01') } end diff --git a/elasticsearch/spec/defines/011_elasticsearch_service_system_spec.rb b/elasticsearch/spec/defines/011_elasticsearch_service_system_spec.rb index 0880899bb..14cc44ab1 100644 --- a/elasticsearch/spec/defines/011_elasticsearch_service_system_spec.rb +++ b/elasticsearch/spec/defines/011_elasticsearch_service_system_spec.rb @@ -43,10 +43,10 @@ :status => 'unmanaged' } end + it { should contain_elasticsearch__service__systemd('es-01') } - it { should_not contain_service('elasticsearch-instance-es-01') } - it { should_not contain_file('/lib/systemd/system/elasticsearch-es-01.service') } - it { should_not contain_file('/etc/sysconfig/elasticsearch-es-01') } + it { should contain_service('elasticsearch-instance-es-01').with(:enable => false) } + it { should contain_augeas('defaults_es-01') } end diff --git a/elasticsearch/spec/unit/provider/plugin_spec.rb b/elasticsearch/spec/unit/provider/plugin_spec.rb index 79ac15135..373600cf8 100644 --- a/elasticsearch/spec/unit/provider/plugin_spec.rb +++ b/elasticsearch/spec/unit/provider/plugin_spec.rb @@ -21,7 +21,7 @@ describe "ES 1.x" do before(:each) do - provider_class.expects(:es).with('-v').returns("Version: 1.7.1, Build: b88f43f/2015-07-29T09:54:16Z, JVM: 1.7.0_79") + provider_class.expects(:es).with('-version').returns("Version: 1.7.1, Build: b88f43f/2015-07-29T09:54:16Z, JVM: 1.7.0_79") allow(File).to receive(:open) provider.es_version end @@ -49,7 +49,7 @@ it 'with proxy' do resource[:proxy_args] = '-dproxyport=3128 -dproxyhost=localhost' - provider.expects(:plugin).with(['-dproxyport=3128 -dproxyhost=localhost', 'install', [resource_name] ]) + provider.expects(:plugin).with([['-dproxyport=3128', '-dproxyhost=localhost'], 'install', [resource_name] ]) provider.create end @@ -67,8 +67,7 @@ describe "ES 2.x" do before(:each) do - allow(provider_class).to receive(:es).with('-v').and_raise(Puppet::ExecutionFailure) - allow(provider_class).to receive(:es).with('--version').and_return("Version: 2.0.0, Build: de54438/2015-10-22T08:09:48Z, JVM: 1.8.0_66") + allow(provider_class).to receive(:es).with('-version').and_return("Version: 2.0.0, Build: de54438/2015-10-22T08:09:48Z, JVM: 1.8.0_66") allow(File).to receive(:open) provider.es_version end @@ -95,7 +94,7 @@ it 'with proxy' do resource[:proxy_args] = '-dproxyport=3128 -dproxyhost=localhost' - provider.expects(:plugin).with(['-dproxyport=3128 -dproxyhost=localhost', 'install', [resource_name] ]) + provider.expects(:plugin).with([['-dproxyport=3128', '-dproxyhost=localhost'], 'install', [resource_name] ]) provider.create end end diff --git a/elasticsearch/spec/unit/type/plugin_spec.rb b/elasticsearch/spec/unit/type/plugin_spec.rb index cdc6c0856..afd6721d1 100644 --- a/elasticsearch/spec/unit/type/plugin_spec.rb +++ b/elasticsearch/spec/unit/type/plugin_spec.rb @@ -47,7 +47,7 @@ ) allow(File).to receive(:open) provider = prov_c.new(resource) - provider.expects(:es).with('-v').returns('Version: 1.7.3, Build: b88f43f/2015-07-29T09:54:16Z, JVM: 1.7.0_79') + provider.expects(:es).with('-version').returns('Version: 1.7.3, Build: b88f43f/2015-07-29T09:54:16Z, JVM: 1.7.0_79') provider.expects(:plugin).with(['install', ['lmenezes/elasticsearch-kopf']]) provider.create end diff --git a/elasticsearch/templates/etc/init.d/elasticsearch.Debian.erb b/elasticsearch/templates/etc/init.d/elasticsearch.Debian.erb index cccc8dbd6..a4447b2ab 100644 --- a/elasticsearch/templates/etc/init.d/elasticsearch.Debian.erb +++ b/elasticsearch/templates/etc/init.d/elasticsearch.Debian.erb @@ -112,6 +112,7 @@ export ES_DIRECT_SIZE export ES_JAVA_OPTS export ES_CLASSPATH export ES_INCLUDE +export ES_GC_LOG_FILE # Check DAEMON exists test -x $DAEMON || exit 0 diff --git a/elasticsearch/templates/etc/init.d/elasticsearch.RedHat.erb b/elasticsearch/templates/etc/init.d/elasticsearch.RedHat.erb index 3cab1f57f..ae778521f 100644 --- a/elasticsearch/templates/etc/init.d/elasticsearch.RedHat.erb +++ b/elasticsearch/templates/etc/init.d/elasticsearch.RedHat.erb @@ -44,6 +44,7 @@ export ES_JAVA_OPTS export ES_CLASSPATH export JAVA_HOME export ES_INCLUDE +export ES_GC_LOG_FILE lockfile=/var/lock/subsys/$prog diff --git a/mysql/lib/puppet/provider/mysql_grant/mysql.rb b/mysql/lib/puppet/provider/mysql_grant/mysql.rb index e7a58f57f..8b19d2031 100644 --- a/mysql/lib/puppet/provider/mysql_grant/mysql.rb +++ b/mysql/lib/puppet/provider/mysql_grant/mysql.rb @@ -114,7 +114,11 @@ def revoke(user, table, revoke_privileges = ['ALL']) end def destroy - revoke(@property_hash[:user], @property_hash[:table]) + # if the user was dropped, it'll have been removed from the user hash + # as the grants are alraedy removed by the DROP statement + if self.class.users.include? @property_hash[:user] + revoke(@property_hash[:user], @property_hash[:table]) + end @property_hash.clear exists? ? (return false) : (return true) diff --git a/mysql/manifests/server/service.pp b/mysql/manifests/server/service.pp index b9289cf0a..9aa60f1b2 100644 --- a/mysql/manifests/server/service.pp +++ b/mysql/manifests/server/service.pp @@ -33,34 +33,34 @@ enable => $mysql::server::real_service_enabled, provider => $mysql::server::service_provider, } - } - # only establish ordering between service and package if - # we're managing the package. - if $mysql::server::package_manage { - Service['mysqld'] { - require => Package['mysql-server'], + # only establish ordering between service and package if + # we're managing the package. + if $mysql::server::package_manage { + Service['mysqld'] { + require => Package['mysql-server'], + } } - } - # only establish ordering between config file and service if - # we're managing the config file. - if $mysql::server::manage_config_file { - File['mysql-config-file'] -> Service['mysqld'] - } + # only establish ordering between config file and service if + # we're managing the config file. + if $mysql::server::manage_config_file { + File['mysql-config-file'] -> Service['mysqld'] + } - if $mysql::server::override_options and $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['socket'] { - $mysqlsocket = $mysql::server::override_options['mysqld']['socket'] - } else { - $mysqlsocket = $options['mysqld']['socket'] - } + if $mysql::server::override_options and $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['socket'] { + $mysqlsocket = $mysql::server::override_options['mysqld']['socket'] + } else { + $mysqlsocket = $options['mysqld']['socket'] + } - exec { 'wait_for_mysql_socket_to_open': - command => "test -S ${mysqlsocket}", - unless => "test -S ${mysqlsocket}", - tries => '3', - try_sleep => '10', - require => Service['mysqld'], - path => '/bin:/usr/bin', + exec { 'wait_for_mysql_socket_to_open': + command => "test -S ${mysqlsocket}", + unless => "test -S ${mysqlsocket}", + tries => '3', + try_sleep => '10', + require => Service['mysqld'], + path => '/bin:/usr/bin', + } } } diff --git a/mysql/spec/classes/mycnf_template_spec.rb b/mysql/spec/classes/mycnf_template_spec.rb index 6446c90f9..9c0c433e1 100644 --- a/mysql/spec/classes/mycnf_template_spec.rb +++ b/mysql/spec/classes/mycnf_template_spec.rb @@ -29,6 +29,11 @@ end end + describe 'skip-name-resolve set to an empty string' do + let(:params) {{ :override_options => { 'mysqld' => { 'skip-name-resolve' => '' }}}} + it { is_expected.to contain_file('mysql-config-file').with_content(/^skip-name-resolve$/) } + end + describe 'ssl set to true' do let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}} it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) } diff --git a/mysql/templates/my.cnf.erb b/mysql/templates/my.cnf.erb index 7d832d978..7d1f1486b 100644 --- a/mysql/templates/my.cnf.erb +++ b/mysql/templates/my.cnf.erb @@ -6,7 +6,7 @@ <% v.sort.map do |ki, vi| -%> <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%> <% next %> -<% elsif vi == true or v == '' -%> +<% elsif vi == true or vi == '' -%> <%= ki %> <% elsif vi.is_a?(Array) -%> <% vi.each do |vii| -%> diff --git a/opendaylight/manifests/params.pp b/opendaylight/manifests/params.pp index 6e7350a73..f79995caa 100644 --- a/opendaylight/manifests/params.pp +++ b/opendaylight/manifests/params.pp @@ -12,7 +12,7 @@ $extra_features = [] $odl_rest_port = '8080' $install_method = 'rpm' - $tarball_url = 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.2-Lithium-SR2/distribution-karaf-0.3.2-Lithium-SR2.tar.gz' + $tarball_url = 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.3-Lithium-SR3/distribution-karaf-0.3.3-Lithium-SR3.tar.gz' $unitfile_url = 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz' $enable_l3 = 'no' } diff --git a/opendaylight/spec/spec_helper.rb b/opendaylight/spec/spec_helper.rb index 33b777fb9..5df9a73b4 100644 --- a/opendaylight/spec/spec_helper.rb +++ b/opendaylight/spec/spec_helper.rb @@ -131,7 +131,7 @@ def tarball_install_tests(options = {}) # Extract params # NB: These default values should be the same as ones in opendaylight::params # TODO: Remove this possible source of bugs^^ - tarball_url = options.fetch(:tarball_url, 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.2-Lithium-SR2/distribution-karaf-0.3.2-Lithium-SR2.tar.gz') + tarball_url = options.fetch(:tarball_url, 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.3.3-Lithium-SR3/distribution-karaf-0.3.3-Lithium-SR3.tar.gz') unitfile_url = options.fetch(:unitfile_url, 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz') osfamily = options.fetch(:osfamily, 'RedHat') diff --git a/opendaylight/templates/org.apache.karaf.features.cfg.erb b/opendaylight/templates/org.apache.karaf.features.cfg.erb index 57deb5c95..7ef41cf12 100644 --- a/opendaylight/templates/org.apache.karaf.features.cfg.erb +++ b/opendaylight/templates/org.apache.karaf.features.cfg.erb @@ -36,7 +36,7 @@ # # Comma separated list of features repositories to register by default # -featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.3.2-Lithium-SR2/xml/features +featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.3.3-Lithium-SR3/xml/features # # Comma separated list of features to install at startup diff --git a/pacemaker/lib/puppet/provider/pcmk_constraint/default.rb b/pacemaker/lib/puppet/provider/pcmk_constraint/default.rb index 1c7c426c9..ae397b9c5 100644 --- a/pacemaker/lib/puppet/provider/pcmk_constraint/default.rb +++ b/pacemaker/lib/puppet/provider/pcmk_constraint/default.rb @@ -3,14 +3,18 @@ ### overloaded methods def create + resource_resource = @resource[:resource].gsub(':', '.') + resource_name = @resource[:name].gsub(':', '.') + resource_location = @resource[:location].gsub(':', '.') case @resource[:constraint_type] when :location - cmd = 'constraint location add ' + @resource[:name] + ' ' + @resource[:resource] + ' ' + @resource[:location] + ' ' + @resource[:score] + cmd = 'constraint location add ' + resource_name + ' ' + resource_resource + ' ' + @resource[:location] + ' ' + @resource[:score] when :colocation + resource_location = @resource[:location].gsub(':', '.') if @resource[:master_slave] - cmd = 'constraint colocation add ' + @resource[:resource] + ' with master ' + @resource[:location] + ' ' + @resource[:score] + cmd = 'constraint colocation add ' + resource_resource + ' with master ' + resource_location + ' ' + @resource[:score] else - cmd = 'constraint colocation add ' + @resource[:resource] + ' with ' + @resource[:location] + ' ' + @resource[:score] + cmd = 'constraint colocation add ' + resource_resource + ' with ' + resource_location + ' ' + @resource[:score] end else fail(String(@resource[:constraint_type]) + ' is an invalid location type') @@ -21,30 +25,35 @@ def create end def destroy + resource_resource = @resource[:resource].gsub(':', '.') + resource_name = @resource[:name].gsub(':', '.') + resource_location = @resource[:location].gsub(':', '.') case @resource[:constraint_type] when :location - cmd = 'constraint location remove ' + @resource[:name] + cmd = 'constraint location remove ' + resource_name when :colocation - cmd = 'constraint colocation remove ' + @resource[:resource] + ' ' + @resource[:location] + cmd = 'constraint colocation remove ' + resource_resource + ' ' + resource_location end pcs('constraint delete', cmd) end def exists? + resource_name = @resource[:name].gsub(':', '.') + resource_resource = @resource[:resource].gsub(':', '.') + resource_location = @resource[:location].gsub(':', '.') cmd = 'constraint ' + String(@resource[:constraint_type]) + ' show --full' pcs_out = pcs('show', cmd) - # find the constraint for line in pcs_out.lines.each do case @resource[:constraint_type] when :location - return true if line.include? @resource[:name] + return true if line.include? resource_name when :colocation if @resource[:master_slave] - return true if line.include? @resource[:resource] + ' with ' + @resource[:location] and line.include? "with-rsc-role:Master" + return true if line.include? resource_resource + ' with ' + resource_location and line.include? "with-rsc-role:Master" else - return true if line.include? @resource[:resource] + ' with ' + @resource[:location] + return true if line.include? resource_resource + ' with ' + resource_location end end end diff --git a/pacemaker/manifests/constraint/base.pp b/pacemaker/manifests/constraint/base.pp index c58e26412..a9514580f 100644 --- a/pacemaker/manifests/constraint/base.pp +++ b/pacemaker/manifests/constraint/base.pp @@ -32,19 +32,23 @@ $_constraint_params = "" } + $first_resource_cleaned = regsubst($first_resource, '(:)', '.', 'G') + $second_resource_cleaned = regsubst($second_resource, '(:)', '.', 'G') + if($ensure == absent) { if($constraint_type == 'location') { + $name_cleaned = regsubst($name, '(:)', '.', 'G') exec { "Removing location constraint ${name}": - command => "/usr/sbin/pcs constraint location remove ${name}", - onlyif => "/usr/sbin/pcs constraint location show --full | grep ${name}", + command => "/usr/sbin/pcs constraint location remove ${name_cleaned}", + onlyif => "/usr/sbin/pcs constraint location show --full | grep ${name_cleaned}", require => Exec["wait-for-settle"], tries => $tries, try_sleep => $try_sleep, } } else { exec { "Removing ${constraint_type} constraint ${name}": - command => "/usr/sbin/pcs constraint ${constraint_type} remove ${first_resource} ${second_resource}", - onlyif => "/usr/sbin/pcs constraint ${constraint_type} show | grep ${first_resource} | grep ${second_resource}", + command => "/usr/sbin/pcs constraint ${constraint_type} remove ${first_resource_cleaned} ${second_resource_cleaned}", + onlyif => "/usr/sbin/pcs constraint ${constraint_type} show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned}", require => Exec["wait-for-settle"], tries => $tries, try_sleep => $try_sleep, @@ -55,8 +59,8 @@ 'colocation': { fail("Deprecated use pacemaker::constraint::colocation") exec { "Creating colocation constraint ${name}": - command => "/usr/sbin/pcs constraint colocation add ${first_resource} ${second_resource} ${score}", - unless => "/usr/sbin/pcs constraint colocation show | grep ${first_resource} | grep ${second_resource} > /dev/null 2>&1", + command => "/usr/sbin/pcs constraint colocation add ${first_resource_cleaned} ${second_resource_cleaned} ${score}", + unless => "/usr/sbin/pcs constraint colocation show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], tries => $tries, try_sleep => $try_sleep, @@ -64,8 +68,8 @@ } 'order': { exec { "Creating order constraint ${name}": - command => "/usr/sbin/pcs constraint order ${first_action} ${first_resource} then ${second_action} ${second_resource} ${_constraint_params}", - unless => "/usr/sbin/pcs constraint order show | grep ${first_resource} | grep ${second_resource} > /dev/null 2>&1", + command => "/usr/sbin/pcs constraint order ${first_action} ${first_resource_cleaned} then ${second_action} ${second_resource_cleaned} ${_constraint_params}", + unless => "/usr/sbin/pcs constraint order show | grep ${first_resource_cleaned} | grep ${second_resource_cleaned} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], tries => $tries, try_sleep => $try_sleep, @@ -74,8 +78,8 @@ 'location': { fail("Deprecated use pacemaker::constraint::location") exec { "Creating location constraint ${name}": - command => "/usr/sbin/pcs constraint location add ${name} ${first_resource} ${location} ${score}", - unless => "/usr/sbin/pcs constraint location show | grep ${first_resource} > /dev/null 2>&1", + command => "/usr/sbin/pcs constraint location add ${name} ${first_resource_cleaned} ${location} ${score}", + unless => "/usr/sbin/pcs constraint location show | grep ${first_resource_cleaned} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], tries => $tries, try_sleep => $try_sleep, diff --git a/rabbitmq/README.md b/rabbitmq/README.md index a40d4c6c3..2dbea56d4 100644 --- a/rabbitmq/README.md +++ b/rabbitmq/README.md @@ -189,6 +189,14 @@ The path to write the RabbitMQ configuration file to. Boolean to enable or disable stomp. +####`config_shovel` + +Boolean to enable or disable shovel. + +####`config_shovel_statics` + +Hash of static shovel configurations + ####`config_variables` To set config variables in rabbitmq.config diff --git a/rabbitmq/manifests/config.pp b/rabbitmq/manifests/config.pp index fce23ceae..c544666c3 100644 --- a/rabbitmq/manifests/config.pp +++ b/rabbitmq/manifests/config.pp @@ -10,6 +10,8 @@ $config_cluster = $rabbitmq::config_cluster $config_path = $rabbitmq::config_path $config_stomp = $rabbitmq::config_stomp + $config_shovel = $rabbitmq::config_shovel + $config_shovel_statics = $rabbitmq::config_shovel_statics $default_user = $rabbitmq::default_user $default_pass = $rabbitmq::default_pass $env_config = $rabbitmq::env_config diff --git a/rabbitmq/manifests/init.pp b/rabbitmq/manifests/init.pp index 4bca59666..ae2d04bf1 100644 --- a/rabbitmq/manifests/init.pp +++ b/rabbitmq/manifests/init.pp @@ -7,6 +7,8 @@ $config_cluster = $rabbitmq::params::config_cluster, $config_path = $rabbitmq::params::config_path, $config_stomp = $rabbitmq::params::config_stomp, + $config_shovel = $rabbitmq::params::config_shovel, + $config_shovel_statics = $rabbitmq::params::config_shovel_statics, $default_user = $rabbitmq::params::default_user, $default_pass = $rabbitmq::params::default_pass, $delete_guest_user = $rabbitmq::params::delete_guest_user, @@ -84,6 +86,8 @@ validate_absolute_path($config_path) validate_bool($config_cluster) validate_bool($config_stomp) + validate_bool($config_shovel) + validate_hash($config_shovel_statics) validate_string($default_user) validate_string($default_pass) validate_bool($delete_guest_user) @@ -210,9 +214,10 @@ include '::rabbitmq::install::rabbitmqadmin' rabbitmq_plugin { 'rabbitmq_management': - ensure => present, - require => Class['rabbitmq::install'], - notify => Class['rabbitmq::service'], + ensure => present, + require => Class['rabbitmq::install'], + notify => Class['rabbitmq::service'], + provider => 'rabbitmqplugins', } Class['::rabbitmq::service'] -> Class['::rabbitmq::install::rabbitmqadmin'] @@ -235,6 +240,27 @@ } } + if ($config_shovel) { + rabbitmq_plugin { 'rabbitmq_shovel': + ensure => present, + require => Class['rabbitmq::install'], + notify => Class['rabbitmq::service'], + provider => 'rabbitmqplugins', + } + + if ($admin_enable) { + rabbitmq_plugin { 'rabbitmq_shovel_management': + ensure => present, + require => Class['rabbitmq::install'], + notify => Class['rabbitmq::service'], + provider => 'rabbitmqplugins', + } + } + } + + # Anchor this as per #8040 - this ensures that classes won't float off and + # mess everything up. You can read about this at: + # http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues anchor { 'rabbitmq::begin': } anchor { 'rabbitmq::end': } diff --git a/rabbitmq/manifests/params.pp b/rabbitmq/manifests/params.pp index 1101ebb36..f4bbd2111 100644 --- a/rabbitmq/manifests/params.pp +++ b/rabbitmq/manifests/params.pp @@ -80,6 +80,8 @@ $config_cluster = false $config_path = '/etc/rabbitmq/rabbitmq.config' $config_stomp = false + $config_shovel = false + $config_shovel_statics = {} $default_user = 'guest' $default_pass = 'guest' $delete_guest_user = false diff --git a/rabbitmq/manifests/repo/apt.pp b/rabbitmq/manifests/repo/apt.pp index e9553fba3..0dd7cb7c4 100644 --- a/rabbitmq/manifests/repo/apt.pp +++ b/rabbitmq/manifests/repo/apt.pp @@ -13,7 +13,10 @@ $pin = $rabbitmq::package_apt_pin - Class['rabbitmq::repo::apt'] -> Package<| title == 'rabbitmq-server' |> + # ordering / ensure to get the last version of repository + Class['rabbitmq::repo::apt'] + -> Class['apt::update'] + -> Package<| title == 'rabbitmq-server' |> $ensure_source = $rabbitmq::repos_ensure ? { false => 'absent', diff --git a/rabbitmq/spec/classes/rabbitmq_spec.rb b/rabbitmq/spec/classes/rabbitmq_spec.rb index d9f7be036..ff75acab0 100644 --- a/rabbitmq/spec/classes/rabbitmq_spec.rb +++ b/rabbitmq/spec/classes/rabbitmq_spec.rb @@ -659,6 +659,58 @@ end end + describe 'configuring shovel plugin' do + let :params do + { + :config_shovel => true + } + end + + it { should contain_rabbitmq_plugin('rabbitmq_shovel') } + + it { should contain_rabbitmq_plugin('rabbitmq_shovel_management') } + + describe 'with admin_enable false' do + let :params do + { + :config_shovel => true, + :admin_enable => false + } + end + + it { should_not contain_rabbitmq_plugin('rabbitmq_shovel_management') } + end + + describe 'with static shovels' do + let :params do + { + :config_shovel => true, + :config_shovel_statics => { + 'shovel_first' => %q({sources,[{broker,"amqp://"}]}, + {destinations,[{broker,"amqp://site1.example.com"}]}, + {queue,<<"source_one">>}), + 'shovel_second' => %q({sources,[{broker,"amqp://"}]}, + {destinations,[{broker,"amqp://site2.example.com"}]}, + {queue,<<"source_two">>}) + } + } + end + + it "should generate correct configuration" do + verify_contents(catalogue, 'rabbitmq.config', [ +' {rabbitmq_shovel,', +' [{shovels,[', +' {shovel_first,[{sources,[{broker,"amqp://"}]},', +' {destinations,[{broker,"amqp://site1.example.com"}]},', +' {queue,<<"source_one">>}]},', +' {shovel_second,[{sources,[{broker,"amqp://"}]},', +' {destinations,[{broker,"amqp://site2.example.com"}]},', +' {queue,<<"source_two">>}]}', +' ]}]}' ]) + end + end + end + describe 'default_user and default_pass set' do let(:params) {{ :default_user => 'foo', :default_pass => 'bar' }} it 'should set default_user and default_pass to specified values' do @@ -744,7 +796,7 @@ %r{keyfile,"/path/to/key"} ) end - it 'should set ssl managment port to specified values' do + it 'should set ssl managment port to specified values' do should contain_file('rabbitmq.config').with_content( %r{port, 13141} ) diff --git a/rabbitmq/templates/rabbitmq.config.erb b/rabbitmq/templates/rabbitmq.config.erb index 8a7502f6b..4027ba590 100644 --- a/rabbitmq/templates/rabbitmq.config.erb +++ b/rabbitmq/templates/rabbitmq.config.erb @@ -121,5 +121,11 @@ {log, <%= @ldap_log %>} ]} <%- end -%> +<%- if @config_shovel and not @config_shovel_statics.empty? -%>, + {rabbitmq_shovel, + [{shovels,[ + <%= @config_shovel_statics.sort.map{|k,v| "{#{k},[#{v}]}"}.join(",\n ") %> + ]}]} +<%- end -%> ]. % EOF diff --git a/sensu/manifests/init.pp b/sensu/manifests/init.pp index 774b65651..fbffdc194 100644 --- a/sensu/manifests/init.pp +++ b/sensu/manifests/init.pp @@ -49,11 +49,11 @@ # [*repo_key_id*] # String. The apt GPG key id -# Default: 8911D8FF37778F24B4E726A218609E3D7580C77F +# Default: EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB # # [*repo_key_source*] # String. URL of the apt GPG key -# Default: http://repos.sensuapp.org/apt/pubkey.gpg +# Default: http://repositories.sensuapp.org/apt/pubkey.gpg # # [*client*] # Boolean. Include the sensu client @@ -281,8 +281,8 @@ $enterprise_dashboard_version = 'latest', $repo = 'main', $repo_source = undef, - $repo_key_id = '8911D8FF37778F24B4E726A218609E3D7580C77F', - $repo_key_source = 'http://repos.sensuapp.org/apt/pubkey.gpg', + $repo_key_id = 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', + $repo_key_source = 'http://repositories.sensuapp.org/apt/pubkey.gpg', $enterprise_repo_key_id = '910442FF8781AFD0995D14B311AB27E8C3FE3269', $client = true, $server = false, diff --git a/sensu/manifests/repo/apt.pp b/sensu/manifests/repo/apt.pp index d565ef7eb..328bcbd2b 100644 --- a/sensu/manifests/repo/apt.pp +++ b/sensu/manifests/repo/apt.pp @@ -20,7 +20,7 @@ if $sensu::repo_source { $url = $sensu::repo_source } else { - $url = 'http://repos.sensuapp.org/apt' + $url = 'http://repositories.sensuapp.org/apt' } apt::source { 'sensu': diff --git a/sensu/manifests/repo/yum.pp b/sensu/manifests/repo/yum.pp index ac4dbff42..97e335b9c 100644 --- a/sensu/manifests/repo/yum.pp +++ b/sensu/manifests/repo/yum.pp @@ -13,8 +13,8 @@ $url = $sensu::repo_source } else { $url = $sensu::repo ? { - 'unstable' => "http://repos.sensuapp.org/yum-unstable/el/\$basearch/", - default => "http://repos.sensuapp.org/yum/el/\$basearch/" + 'unstable' => "http://repositories.sensuapp.org/yum-unstable/\$basearch/", + default => "http://repositories.sensuapp.org/yum/\$basearch/" } } diff --git a/sensu/spec/classes/sensu_package_spec.rb b/sensu/spec/classes/sensu_package_spec.rb index b85d84919..38a6cade9 100644 --- a/sensu/spec/classes/sensu_package_spec.rb +++ b/sensu/spec/classes/sensu_package_spec.rb @@ -72,11 +72,11 @@ context 'default' do it { should contain_apt__source('sensu').with( :ensure => 'present', - :location => 'http://repos.sensuapp.org/apt', + :location => 'http://repositories.sensuapp.org/apt', :release => 'sensu', :repos => 'main', :include => { 'src' => false }, - :key => { 'id' => '8911D8FF37778F24B4E726A218609E3D7580C77F', 'source' => 'http://repos.sensuapp.org/apt/pubkey.gpg' }, + :key => { 'id' => 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', 'source' => 'http://repositories.sensuapp.org/apt/pubkey.gpg' }, :before => 'Package[sensu]' ) } end @@ -91,7 +91,7 @@ it { should contain_apt__source('sensu').with( :location => 'http://repo.mydomain.com/apt') } it { should_not contain_apt__key('sensu').with( - :key => { 'id' => '8911D8FF37778F24B4E726A218609E3D7580C77F', 'source' => 'http://repo.mydomain.com/apt/pubkey.gpg' } + :key => { 'id' => 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', 'source' => 'http://repo.mydomain.com/apt/pubkey.gpg' } ) } end @@ -108,8 +108,8 @@ it { should contain_apt__source('sensu').with_ensure('absent') } it { should_not contain_apt__key('sensu').with( - :key => '8911D8FF37778F24B4E726A218609E3D7580C77F', - :key_source => 'http://repos.sensuapp.org/apt/pubkey.gpg' + :key => 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', + :key_source => 'http://repositories.sensuapp.org/apt/pubkey.gpg' ) } it { should contain_package('sensu').with( :require => nil ) } @@ -127,7 +127,7 @@ context 'default' do it { should contain_yumrepo('sensu').with( :enabled => 1, - :baseurl => 'http://repos.sensuapp.org/yum/el/$basearch/', + :baseurl => 'http://repositories.sensuapp.org/yum/$basearch/', :gpgcheck => 0, :before => 'Package[sensu]' ) } @@ -135,7 +135,7 @@ context 'unstable repo' do let(:params) { { :repo => 'unstable' } } - it { should contain_yumrepo('sensu').with(:baseurl => 'http://repos.sensuapp.org/yum-unstable/el/$basearch/' )} + it { should contain_yumrepo('sensu').with(:baseurl => 'http://repositories.sensuapp.org/yum-unstable/$basearch/' )} end context 'override repo url' do diff --git a/uchiwa/manifests/init.pp b/uchiwa/manifests/init.pp index 7157b9e8a..5277872fc 100755 --- a/uchiwa/manifests/init.pp +++ b/uchiwa/manifests/init.pp @@ -47,6 +47,11 @@ # Default: http://repositories.sensuapp.org/apt/pubkey.gpg # GPG key for the repo we're installing # +# [*manage_package*] +# Boolean +# Default: true +# Should we install the package from the repo? +# # [*manage_services*] # Boolean # Default: true @@ -134,6 +139,7 @@ $repo_source = $uchiwa::params::repo_source, $repo_key_id = $uchiwa::params::repo_key_id, $repo_key_source = $uchiwa::params::repo_key_source, + $manage_package = $uchiwa::params::manage_package, $manage_services = $uchiwa::params::manage_services, $manage_user = $uchiwa::params::manage_user, $host = $uchiwa::params::host, @@ -148,6 +154,7 @@ # validate parameters here validate_bool($install_repo) + validate_bool($manage_package) validate_bool($manage_services) validate_bool($manage_user) validate_string($package_name) diff --git a/uchiwa/manifests/install.pp b/uchiwa/manifests/install.pp index 982116075..7548baf1a 100755 --- a/uchiwa/manifests/install.pp +++ b/uchiwa/manifests/install.pp @@ -38,10 +38,12 @@ } } - package { $uchiwa::package_name: - ensure => $uchiwa::version, - require => $repo_require, - notify => Service['uchiwa'], + if ($uchiwa::manage_package) { + package { $uchiwa::package_name: + ensure => $uchiwa::version, + require => $repo_require, + notify => Service['uchiwa'], + } } } diff --git a/uchiwa/manifests/params.pp b/uchiwa/manifests/params.pp index 197dac79f..f978951a2 100755 --- a/uchiwa/manifests/params.pp +++ b/uchiwa/manifests/params.pp @@ -25,6 +25,7 @@ $repo_key_id = 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB' $repo_key_source = 'http://repositories.sensuapp.org/apt/pubkey.gpg' $manage_services = true + $manage_package = true $manage_user = true $sensu_api_endpoints = [