2015-08-25 21:38:16 +02:00
|
|
|
{% import_yaml "apache/osfingermap.yaml" as osfingermap %}
|
2016-05-11 03:48:26 +02:00
|
|
|
{% import_yaml "apache/modsecurity.yaml" as modsec %}
|
2015-08-25 21:38:16 +02:00
|
|
|
|
2013-08-23 05:14:28 +02:00
|
|
|
{% set apache = salt['grains.filter_by']({
|
2016-08-25 18:08:26 +02:00
|
|
|
'Gentoo': {
|
|
|
|
'server': 'www-servers/apache',
|
|
|
|
'service': 'apache2',
|
2017-03-29 12:32:18 +02:00
|
|
|
'user': 'apache',
|
|
|
|
'group': 'apache',
|
2016-08-25 18:08:26 +02:00
|
|
|
'configfile': '/etc/apache2/httpd.conf',
|
|
|
|
|
|
|
|
'mod_wsgi': 'www-apache/mod_wsgi',
|
|
|
|
'mod_fcgid': 'www-apache/mod_fcgid',
|
|
|
|
|
|
|
|
'vhostdir': '/etc/apache2/vhosts.d',
|
|
|
|
'confdir': '/etc/conf.d/apache2',
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
|
|
|
'logdir': '/var/log/apache2',
|
|
|
|
'logrotatedir': '/etc/logrotate.d/apache2',
|
|
|
|
'wwwdir': '/var/www',
|
|
|
|
},
|
2013-08-23 05:14:28 +02:00
|
|
|
'Debian': {
|
|
|
|
'server': 'apache2',
|
|
|
|
'service': 'apache2',
|
2017-03-29 12:32:18 +02:00
|
|
|
'user': 'www-data',
|
|
|
|
'group': 'www-data',
|
2015-06-19 20:44:53 +02:00
|
|
|
'configfile': '/etc/apache2/apache2.conf',
|
2016-02-01 17:03:47 +01:00
|
|
|
'portsfile': '/etc/apache2/ports.conf',
|
2013-08-28 00:27:19 +02:00
|
|
|
|
2013-08-27 04:45:38 +02:00
|
|
|
'mod_wsgi': 'libapache2-mod-wsgi',
|
2015-06-19 20:44:53 +02:00
|
|
|
'mod_php5': 'libapache2-mod-php5',
|
2017-01-08 12:30:33 +01:00
|
|
|
'mod_perl2': 'libapache2-mod-perl2',
|
2015-06-19 20:44:53 +02:00
|
|
|
'mod_fcgid': 'libapache2-mod-fcgid',
|
2015-11-19 22:04:03 +01:00
|
|
|
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb',
|
2017-02-07 16:02:51 +01:00
|
|
|
'mod_xsendfile': 'libapache2-mod-xsendfile',
|
|
|
|
'mod_fastcgi': 'libapache2-mod-fastcgi',
|
2013-08-28 00:27:19 +02:00
|
|
|
|
|
|
|
'vhostdir': '/etc/apache2/sites-available',
|
2018-01-09 23:38:47 +01:00
|
|
|
'confdir': '/etc/apache2/conf-available',
|
2015-04-17 14:39:57 +02:00
|
|
|
'confext': '.conf',
|
2014-10-01 10:35:53 +02:00
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
2013-08-28 00:27:19 +02:00
|
|
|
'logdir': '/var/log/apache2',
|
2016-01-07 19:54:10 +01:00
|
|
|
'logrotatedir': '/etc/logrotate.d/apache2',
|
2013-08-28 00:27:19 +02:00
|
|
|
'wwwdir': '/srv',
|
2013-08-23 05:14:28 +02:00
|
|
|
},
|
|
|
|
'RedHat': {
|
|
|
|
'server': 'httpd',
|
|
|
|
'service': 'httpd',
|
2017-03-29 12:32:18 +02:00
|
|
|
'user': 'apache',
|
|
|
|
'group': 'apache',
|
2015-06-19 20:44:53 +02:00
|
|
|
'configfile': '/etc/httpd/conf/httpd.conf',
|
2013-08-28 00:27:19 +02:00
|
|
|
|
2017-10-23 15:35:31 +02:00
|
|
|
'mod_ssl': 'mod_ssl',
|
2013-08-27 04:45:38 +02:00
|
|
|
'mod_wsgi': 'mod_wsgi',
|
2017-04-06 14:03:37 +02:00
|
|
|
'conf_mod_wsgi': '/etc/httpd/conf.d/wsgi.conf',
|
2015-07-22 10:13:38 +02:00
|
|
|
'mod_php5': 'php',
|
2015-11-19 22:04:03 +01:00
|
|
|
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm',
|
2013-08-28 00:27:19 +02:00
|
|
|
|
2015-07-22 14:36:25 +02:00
|
|
|
'vhostdir': '/etc/httpd/vhosts.d',
|
2013-08-28 00:27:19 +02:00
|
|
|
'confdir': '/etc/httpd/conf.d',
|
2014-02-09 15:11:55 +01:00
|
|
|
'confext': '.conf',
|
2014-10-01 10:35:53 +02:00
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
2013-08-28 00:27:19 +02:00
|
|
|
'logdir': '/var/log/httpd',
|
2016-01-07 19:54:10 +01:00
|
|
|
'logrotatedir': '/etc/logrotate.d/httpd',
|
2013-08-28 00:27:19 +02:00
|
|
|
'wwwdir': '/var/www',
|
2016-06-29 18:18:30 +02:00
|
|
|
'default_charset': 'UTF-8',
|
2013-08-23 05:14:28 +02:00
|
|
|
},
|
2015-03-08 22:12:36 +01:00
|
|
|
'Suse': {
|
|
|
|
'server': 'apache2',
|
|
|
|
'service': 'apache2',
|
2017-05-21 23:31:24 +02:00
|
|
|
'user': 'wwwrun',
|
|
|
|
'group': 'www',
|
2015-06-19 20:44:53 +02:00
|
|
|
'configfile': '/etc/apache2/httpd.conf',
|
2015-03-08 22:12:36 +01:00
|
|
|
|
|
|
|
'mod_wsgi': 'apache2-mod_wsgi',
|
2015-06-19 20:44:53 +02:00
|
|
|
'mod_php5': 'apache2-mod_php5',
|
|
|
|
'mod_fcgid': 'apache2-mod_fcgid',
|
2015-03-08 22:12:36 +01:00
|
|
|
|
|
|
|
'vhostdir': '/etc/apache2/vhosts.d',
|
2017-03-17 13:49:55 +01:00
|
|
|
'confdir': '/etc/apache2/conf.d',
|
2015-03-08 22:12:36 +01:00
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': 'vhost.template',
|
|
|
|
'default_site_ssl': 'vhost-ssl.template',
|
|
|
|
'logdir': '/var/log/apache2',
|
|
|
|
'wwwdir': '/srv/www',
|
|
|
|
},
|
2014-01-30 03:12:47 +01:00
|
|
|
'FreeBSD': {
|
2018-01-09 22:11:19 +01:00
|
|
|
'server': 'apache24',
|
|
|
|
'service': 'apache24',
|
2017-03-29 12:32:18 +02:00
|
|
|
'user': 'www',
|
|
|
|
'group': 'www',
|
2018-01-09 22:11:19 +01:00
|
|
|
'configfile': '/usr/local/etc/apache24/httpd.conf',
|
|
|
|
'portsfile': '/usr/local/etc/apache24/ports.conf',
|
2014-01-30 03:12:47 +01:00
|
|
|
|
2016-09-27 02:16:21 +02:00
|
|
|
'mod_php5': 'mod_php56',
|
2018-01-09 22:11:19 +01:00
|
|
|
'mod_perl2': 'ap24-mod_perl2',
|
|
|
|
'mod_wsgi': 'ap24-mod_wsgi3',
|
2014-01-30 03:12:47 +01:00
|
|
|
|
2018-01-09 22:11:19 +01:00
|
|
|
'vhostdir': '/usr/local/etc/apache24/Includes',
|
|
|
|
'confdir': '/usr/local/etc/apache24/extra',
|
|
|
|
'modulesdir': '/usr/local/etc/apache24/modules.d',
|
|
|
|
'global_document_root': '/usr/local/www/apache24/data',
|
2016-09-27 02:00:41 +02:00
|
|
|
|
2014-02-09 15:11:55 +01:00
|
|
|
'confext': '',
|
2014-10-01 10:35:53 +02:00
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
2014-01-30 03:12:47 +01:00
|
|
|
'logdir': '/var/log/',
|
2018-01-09 22:11:19 +01:00
|
|
|
'wwwdir': '/usr/local/www/apache24/',
|
2014-01-30 03:12:47 +01:00
|
|
|
},
|
2017-11-03 17:47:20 +01:00
|
|
|
'Arch': {
|
|
|
|
'server': 'apache',
|
|
|
|
'service': 'httpd',
|
|
|
|
'user': 'http',
|
|
|
|
'group': 'http',
|
|
|
|
'configfile': '/etc/httpd/conf/httpd.conf',
|
|
|
|
|
|
|
|
'mod_wsgi': 'mod_wsgi',
|
|
|
|
|
|
|
|
'vhostdir': '/etc/httpd/conf/vhosts',
|
|
|
|
'confdir': '/etc/httpd/conf/extra',
|
|
|
|
'modulesdir': '/usr/lib/httpd/modules',
|
|
|
|
'confext': '.conf',
|
|
|
|
'logdir': '/var/log/httpd',
|
|
|
|
'wwwdir': '/srv/http',
|
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
|
|
|
},
|
2014-10-01 10:35:53 +02:00
|
|
|
}, merge=salt['grains.filter_by']({
|
2016-03-24 15:22:23 +01:00
|
|
|
'precise': {
|
|
|
|
'confext': '',
|
|
|
|
'default_site': 'default',
|
|
|
|
'default_site_ssl': 'default-ssl',
|
|
|
|
},
|
2015-03-11 20:43:18 +01:00
|
|
|
'trusty': {
|
2014-10-01 10:35:53 +02:00
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
2014-10-28 15:13:13 +01:00
|
|
|
},
|
2015-03-11 20:43:18 +01:00
|
|
|
'utopic': {
|
2014-10-28 15:13:13 +01:00
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
2014-10-01 10:35:53 +02:00
|
|
|
},
|
2015-11-22 12:05:53 +01:00
|
|
|
'vivid': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
|
|
|
'wily': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
2016-06-28 18:36:33 +02:00
|
|
|
'xenial': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
2017-06-08 16:09:07 +02:00
|
|
|
'yakkety': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
|
|
|
'zesty': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
|
|
|
'artful': {
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
2015-03-11 20:43:18 +01:00
|
|
|
'jessie': {
|
2015-01-10 16:18:59 +01:00
|
|
|
'wwwdir': '/var/www',
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
2017-06-08 16:09:07 +02:00
|
|
|
'stretch': {
|
|
|
|
'wwwdir': '/var/www',
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
|
|
|
'buster': {
|
|
|
|
'wwwdir': '/var/www',
|
|
|
|
'confext': '.conf',
|
|
|
|
'default_site': '000-default.conf',
|
|
|
|
'default_site_ssl': 'default-ssl.conf',
|
|
|
|
},
|
2015-08-25 21:38:16 +02:00
|
|
|
}, grain='oscodename', merge=salt['grains.filter_by'](
|
|
|
|
osfingermap
|
|
|
|
, grain='osfinger', merge=salt['pillar.get']('apache:lookup')))) %}
|
2016-05-11 03:48:26 +02:00
|
|
|
|
|
|
|
{% set modsecurity = salt['grains.filter_by'](
|
|
|
|
modsec
|
|
|
|
, grain='os_family', merge=salt['pillar.get']('apache:mod_security')) or {} %}
|
|
|
|
|
|
|
|
{# merge the os family/codename mod_sec's specific data over the defaults #}
|
|
|
|
{% do apache.update({ 'mod_security': modsecurity }) %}
|
|
|
|
|