Commit Graph

20 Commits

Author SHA1 Message Date
Clark Boylan 1609bb6a44 Fix leading :: on class includes to make linter happy
Why this needed to be a linter rule I do not know.

Change-Id: I27ba74c6060c9d2ad09b52bc38090ff9c1f83721
2020-03-05 09:14:07 -08:00
Colleen Murphy e5996fd275 Add content parameter to httpd::vhost
Evaluating the template from the vhost defined type rather than the
module where it originates causes problems when dereferencing the
variables in the ERB file. If they are not accessed via the internal
scope object, they can't be found when using puppet 4. The scope object
is also useless when the variables are defined in a defined type and not
a class.

This patch adds a new parameter, $content, which overrides the $template
parameter. If provided, $content indicates the literal string content
for the vhost, as opposed to a reference to a template that needs to be
rendered. This can be used like this:

  $content = template('example/example.vhost.erb')
  httpd::vhost { 'vhostname':
    content => $content,
    priority => 50
  }

This way the template is evaluated when the template() function is
called and has access to variables in that scope.

Change-Id: Ibe3c609d92f3321f43f4794062a64b119b07a1d0
2018-05-28 15:04:15 -07:00
Yolanda Robla Mota 8fa18ba136 Fix selinux problems on vhost
When running on CentOS, that problem still persists: when trying
to access files under a vhost, apache was failing with
Access denied because search permissions are missing.

So running chcon on the docroot for each vhost

Please note that this change was reverted before. That was caused
by puppet-cgit sending a dummy location "MEANINGLESS ARGUMENT"
to docroot argument of vhost. To avoid that failure, execute only
the chcon call if docroot exists and is a directory.

Change-Id: I4ab7d4cc6d2115bd8f980be7f14a6a4557ffeb87
2016-07-22 08:57:46 +02:00
Paul Belanger fba135de66 Revert "Fix selinux problems on vhost"
We are reverting as this breaks our gitXX.o.o servers, which are centos-7. EG:

  (/Stage[main]/Cgit/Httpd::Vhost[git.openstack.org]/Exec[update_context_MEANINGLESS ARGUMENT]/returns) chcon: cannot access ‘MEANINGLESS’: No such file or directory

This reverts commit 10844f7c9e.

Change-Id: I06435e6203bd8770bc6a817d3f0b33a05d84bdf6
2016-07-20 23:24:41 +00:00
Yolanda Robla 10844f7c9e Fix selinux problems on vhost
When running on CentOS, two problems appeared:
- when using proxy, apache was failing with an error 500,
fixed by enabling httpd_can_network_connect

- when trying to access files under a vhost, apache was
failing with Access denied because search permissions
are missing. So running chcon on the docroot for each vhost

Change-Id: I87c4c0e51f05eab8f5c8e094c2c54504e60b97af
2016-06-26 09:53:35 +02:00
Andrey Nikitin 080f4bab6a Order of the classes parameters is refactored
Order and intendation of those parameters are changed
to follow Puppet Style Guide recommendation [0].
Moreover, it will allow to an user to find much faster
a variable in a list of variables.

[0]. https://docs.puppetlabs.com/guides/style_guide.html

Change-Id: If2443cbc57671784cfcb31bbe0ada0c09f78c996
2016-03-21 12:44:49 +03:00
Bruno Tavares d8e4764ac8 Fixes vhost and vhost::proxy on Precise.
We recently introduced on bf7ce40e2f the
use of mod_version. The module is enabled and installed by default on
Ubuntu Trusty 14.04, CentOS 6 and CentOS 7.

On Ubuntu Precise 12.04 the module comes installed, but not enabled by
default. This is needed to maintain compatibility with downstream pool
of servers.

Change-Id: I01a8a12b959e3cbecd0355562db0393404ae54bf
Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>
2015-10-20 18:07:41 -02:00
Colleen Murphy 17430b7507 Add Gemfile and puppet 4 checks
In anticipation of puppet 4, start trying to deal with puppet 4 things
that can be helpfully predicted by puppet lint plugins. Also fix errors
caught by the puppet-lint-unquoted_string-check and
puppet-lint-absolute_classname-check gems.

Change-Id: I9d74d25d2f2c95ec52a6db3bf070903240e1b933
2015-07-29 23:18:35 -07:00
Spencer Krum dab0f45bea Rename apache2 to httpd globally
This renames the classes and defined types from apache to httpd.
With the 'httpd' module available, we can migrate usage of 'apache'
to 'httpd.' Eventually this will free the 'apache' namespace.

A native ruby type and provider is contained in this class. It is
not namespaced to the class name so it has been renamed from a2mod
to httpd_mod.

Change-Id: I056eb28a13e7ccc95f1496019bedc332c17dd458
2015-02-05 05:49:30 -08:00
Ian Wienand 482441c9af Add rake "lint" target, fix errors
Add the rake "lint" target, and fix resulting minor errors, which were:

---
 manifests/mod/python.pp - WARNING: class not documented on line 1
 manifests/mod/wsgi.pp - WARNING: class not documented on line 1
 manifests/vhost.pp - WARNING: variable not enclosed in {} on line 80
 manifests/vhost.pp - WARNING: variable not enclosed in {} on line 82
 manifests/vhost/redirect.pp - WARNING: variable not enclosed in {} on line 43
 manifests/vhost/redirect.pp - WARNING: variable not enclosed in {} on line 45
---

Change-Id: I2213f314d4bf92b4ddf58dbb19a80783380a55ce
2014-11-20 10:56:33 +11:00
Eric Shamow 42c636341f Changes to match style guide and pass puppet-lint without error
No substantive behavior changes - only spacing, line alignment,
quotation, etc.
2012-04-20 21:07:54 -07:00
Walter Heck 42bc8ba49a changed name => path for file resources in order to name namevar by it's name 2012-04-16 15:31:54 +08:00
Walter Heck 073964152d style guide fixes: 'true' <> true, $operatingsystem needs to be $::operatingsystem, etc. 2012-04-16 15:20:00 +08:00
William Van Hevelingen 05fcec5f9c (#13073) Add missing puppet spec tests
This commit adds full puppet spec coverage
for all classes and defines.
2012-03-16 00:38:53 -07:00
Dan Bode d7516c7662 Make management of firewalls configurable for vhosts
Previously, it was necessary to configure a firewall
entry for every port associated with a vhost.

This commit makes the confuration of firewalls for vhosts
configurable. This configuration option has been added to spare
users from having to configure firewalls if they do not wish
to.
2012-02-21 13:04:52 -08:00
David Alden a776a8b46d (#11071) Fix to work with latest firewall module
The firewall module deprecated the use of jump => accept, this patch now
changes this parameter to action => accept making it compatible with the
latest release.
2011-12-01 01:05:56 +00:00
David Alden 2b79e8bdd1 (#11070) Add support for Scientific Linux
This patch adds Scientific Linux to the various case statements so it is
supported. This also fixed the various templates so that the log location
is variable depending on weither the OS is Redhat based or Debian based.
2011-12-01 00:56:45 +00:00
Gary Larizza 9a51b4aa8d Vhost File Declarations
Include apache::vhost file declarations and templates.
2011-07-15 15:26:22 -07:00
Gary Larizza 6cf7312ff3 Defaults for Parameters
Set sane default parameters for the apache::vhost subclass
and enter them into apache::params.
2011-07-15 15:25:31 -07:00
James Turnbull 35721a3f35 Initial commit 2010-09-01 18:01:04 -04:00