forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODULES-1789 add initial mod_geoip support
- Loading branch information
1 parent
7dde9fc
commit 43c5c5e
Showing
5 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class apache::mod::geoip ( | ||
$enable = 'Off', | ||
$dbfile = '/usr/share/GeoIP/GeoIP.dat', | ||
$flag = 'Standard', | ||
$output = 'All', | ||
$enableutf8 = undef, | ||
$scanproxyheaders = undef, | ||
$uselastxforwarededforip = undef, | ||
) { | ||
::apache::mod { 'geoip': } | ||
|
||
# Template uses: | ||
# - enable | ||
# - dbfile | ||
# - flag | ||
# - output | ||
# - enableutf8 | ||
# - scanproxyheaders | ||
# - uselastxforwarededforip | ||
file { 'geoip.conf': | ||
ensure => file, | ||
path => "${::apache::mod_dir}/geoip.conf", | ||
content => template('apache/mod/geoip.conf.erb'), | ||
require => Exec["mkdir ${::apache::mod_dir}"], | ||
before => File[$::apache::mod_dir], | ||
notify => Class['apache::service'], | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
GeoIPEnable <%= @enable %> | ||
|
||
<%- if @dbfile and ! [ false, 'false', '' ].include?(@dbfile) -%> | ||
<%- if @dbfile.kind_of?(Array) -%> | ||
<%- Array(@dbfile).each do |file| -%> | ||
GeoIPDBFile <%= file %> <%= @flag %> | ||
<%- end -%> | ||
<%- else -%> | ||
GeoIPDBFile <%= @dbfile %> <%= @flag %> | ||
<%- end -%> | ||
<%- end -%> | ||
GeoIPOutput <%= @output %> | ||
<% if @enableutf8 -%> | ||
GeoIPEnableUTF8 <%= @enableutf8 %> | ||
<% end -%> | ||
<% if @scanproxyheaders -%> | ||
GeoIPScanProxyHeaders <%= @scanproxyheaders %> | ||
<% end -%> | ||
<% if @uselastxforwarededforip -%> | ||
GeoIPUseLastXForwardedForIP <%= @uselastxforwarededforip %> | ||
<% end -%> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters