Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.8KB

  1. {% import_yaml "apache/osfingermap.yaml" as osfingermap %}
  2. {% import_yaml "apache/modsecurity.yaml" as modsec %}
  3. {% set apache = salt['grains.filter_by']({
  4. 'Gentoo': {
  5. 'server': 'www-servers/apache',
  6. 'service': 'apache2',
  7. 'configfile': '/etc/apache2/httpd.conf',
  8. 'mod_wsgi': 'www-apache/mod_wsgi',
  9. 'mod_fcgid': 'www-apache/mod_fcgid',
  10. 'vhostdir': '/etc/apache2/vhosts.d',
  11. 'confdir': '/etc/conf.d/apache2',
  12. 'confext': '.conf',
  13. 'default_site': 'default',
  14. 'default_site_ssl': 'default-ssl',
  15. 'logdir': '/var/log/apache2',
  16. 'logrotatedir': '/etc/logrotate.d/apache2',
  17. 'wwwdir': '/var/www',
  18. 'use_require': False,
  19. },
  20. 'Debian': {
  21. 'server': 'apache2',
  22. 'service': 'apache2',
  23. 'configfile': '/etc/apache2/apache2.conf',
  24. 'portsfile': '/etc/apache2/ports.conf',
  25. 'mod_wsgi': 'libapache2-mod-wsgi',
  26. 'mod_php5': 'libapache2-mod-php5',
  27. 'mod_fcgid': 'libapache2-mod-fcgid',
  28. 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb',
  29. 'vhostdir': '/etc/apache2/sites-available',
  30. 'confdir': '/etc/apache2/conf.d',
  31. 'confext': '.conf',
  32. 'default_site': 'default',
  33. 'default_site_ssl': 'default-ssl',
  34. 'logdir': '/var/log/apache2',
  35. 'logrotatedir': '/etc/logrotate.d/apache2',
  36. 'wwwdir': '/srv',
  37. 'use_require': False,
  38. },
  39. 'RedHat': {
  40. 'server': 'httpd',
  41. 'service': 'httpd',
  42. 'configfile': '/etc/httpd/conf/httpd.conf',
  43. 'mod_wsgi': 'mod_wsgi',
  44. 'mod_php5': 'php',
  45. 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm',
  46. 'vhostdir': '/etc/httpd/vhosts.d',
  47. 'confdir': '/etc/httpd/conf.d',
  48. 'confext': '.conf',
  49. 'default_site': 'default',
  50. 'default_site_ssl': 'default-ssl',
  51. 'logdir': '/var/log/httpd',
  52. 'logrotatedir': '/etc/logrotate.d/httpd',
  53. 'wwwdir': '/var/www',
  54. 'default_charset': 'UTF-8',
  55. 'use_require': False,
  56. },
  57. 'Suse': {
  58. 'server': 'apache2',
  59. 'service': 'apache2',
  60. 'configfile': '/etc/apache2/httpd.conf',
  61. 'mod_wsgi': 'apache2-mod_wsgi',
  62. 'mod_php5': 'apache2-mod_php5',
  63. 'mod_fcgid': 'apache2-mod_fcgid',
  64. 'vhostdir': '/etc/apache2/vhosts.d',
  65. 'confdir': '/etc/httpd/conf.d',
  66. 'confext': '.conf',
  67. 'default_site': 'vhost.template',
  68. 'default_site_ssl': 'vhost-ssl.template',
  69. 'logdir': '/var/log/apache2',
  70. 'wwwdir': '/srv/www',
  71. 'use_require': True,
  72. },
  73. 'FreeBSD': {
  74. 'server': 'apache22',
  75. 'service': 'apache22',
  76. 'configfile': '/usr/local/etc/apache22/httpd.conf',
  77. 'mod_wsgi': 'ap22-mod_wsgi3',
  78. 'vhostdir': '/usr/local/etc/apache22/Includes',
  79. 'confdir': '/usr/local/etc/apache22/Includes',
  80. 'confext': '',
  81. 'default_site': 'default',
  82. 'default_site_ssl': 'default-ssl',
  83. 'logdir': '/var/log/',
  84. 'wwwdir': '/usr/local/www/apache22/',
  85. 'use_require': False,
  86. },
  87. }, merge=salt['grains.filter_by']({
  88. 'precise': {
  89. 'confext': '',
  90. 'default_site': 'default',
  91. 'default_site_ssl': 'default-ssl',
  92. 'use_require': True,
  93. },
  94. 'trusty': {
  95. 'confext': '.conf',
  96. 'default_site': '000-default.conf',
  97. 'default_site_ssl': 'default-ssl.conf',
  98. 'use_require': True,
  99. },
  100. 'utopic': {
  101. 'confext': '.conf',
  102. 'default_site': '000-default.conf',
  103. 'default_site_ssl': 'default-ssl.conf',
  104. 'use_require': True,
  105. },
  106. 'vivid': {
  107. 'confext': '.conf',
  108. 'default_site': '000-default.conf',
  109. 'default_site_ssl': 'default-ssl.conf',
  110. 'use_require': True,
  111. },
  112. 'wily': {
  113. 'confext': '.conf',
  114. 'default_site': '000-default.conf',
  115. 'default_site_ssl': 'default-ssl.conf',
  116. 'use_require': True,
  117. },
  118. 'xenial': {
  119. 'confext': '.conf',
  120. 'default_site': '000-default.conf',
  121. 'default_site_ssl': 'default-ssl.conf',
  122. 'use_require': True,
  123. },
  124. 'jessie': {
  125. 'wwwdir': '/var/www',
  126. 'confext': '.conf',
  127. 'default_site': '000-default.conf',
  128. 'default_site_ssl': 'default-ssl.conf',
  129. 'use_require': True,
  130. },
  131. }, grain='oscodename', merge=salt['grains.filter_by'](
  132. osfingermap
  133. , grain='osfinger', merge=salt['pillar.get']('apache:lookup')))) %}
  134. {% set modsecurity = salt['grains.filter_by'](
  135. modsec
  136. , grain='os_family', merge=salt['pillar.get']('apache:mod_security')) or {} %}
  137. {# merge the os family/codename mod_sec's specific data over the defaults #}
  138. {% do apache.update({ 'mod_security': modsecurity }) %}