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
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
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
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
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
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>
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
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
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
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.
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.
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.