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.

188 lines
5.9KB

  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. 'user': 'apache',
  8. 'group': 'apache',
  9. 'configfile': '/etc/apache2/httpd.conf',
  10. 'mod_wsgi': 'www-apache/mod_wsgi',
  11. 'mod_fcgid': 'www-apache/mod_fcgid',
  12. 'vhostdir': '/etc/apache2/vhosts.d',
  13. 'confdir': '/etc/conf.d/apache2',
  14. 'confext': '.conf',
  15. 'default_site': 'default',
  16. 'default_site_ssl': 'default-ssl',
  17. 'logdir': '/var/log/apache2',
  18. 'logrotatedir': '/etc/logrotate.d/apache2',
  19. 'wwwdir': '/var/www',
  20. },
  21. 'Debian': {
  22. 'server': 'apache2',
  23. 'service': 'apache2',
  24. 'user': 'www-data',
  25. 'group': 'www-data',
  26. 'configfile': '/etc/apache2/apache2.conf',
  27. 'portsfile': '/etc/apache2/ports.conf',
  28. 'mod_wsgi': 'libapache2-mod-wsgi',
  29. 'mod_php5': 'libapache2-mod-php5',
  30. 'mod_perl2': 'libapache2-mod-perl2',
  31. 'mod_fcgid': 'libapache2-mod-fcgid',
  32. 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb',
  33. 'mod_xsendfile': 'libapache2-mod-xsendfile',
  34. 'mod_fastcgi': 'libapache2-mod-fastcgi',
  35. 'vhostdir': '/etc/apache2/sites-available',
  36. 'confdir': '/etc/apache2/conf.d',
  37. 'confext': '.conf',
  38. 'default_site': 'default',
  39. 'default_site_ssl': 'default-ssl',
  40. 'logdir': '/var/log/apache2',
  41. 'logrotatedir': '/etc/logrotate.d/apache2',
  42. 'wwwdir': '/srv',
  43. },
  44. 'RedHat': {
  45. 'server': 'httpd',
  46. 'service': 'httpd',
  47. 'user': 'apache',
  48. 'group': 'apache',
  49. 'configfile': '/etc/httpd/conf/httpd.conf',
  50. 'mod_wsgi': 'mod_wsgi',
  51. 'conf_mod_wsgi': '/etc/httpd/conf.d/wsgi.conf',
  52. 'mod_php5': 'php',
  53. 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm',
  54. 'vhostdir': '/etc/httpd/vhosts.d',
  55. 'confdir': '/etc/httpd/conf.d',
  56. 'confext': '.conf',
  57. 'default_site': 'default',
  58. 'default_site_ssl': 'default-ssl',
  59. 'logdir': '/var/log/httpd',
  60. 'logrotatedir': '/etc/logrotate.d/httpd',
  61. 'wwwdir': '/var/www',
  62. 'default_charset': 'UTF-8',
  63. },
  64. 'Suse': {
  65. 'server': 'apache2',
  66. 'service': 'apache2',
  67. 'user': 'wwwrun',
  68. 'group': 'www',
  69. 'configfile': '/etc/apache2/httpd.conf',
  70. 'mod_wsgi': 'apache2-mod_wsgi',
  71. 'mod_php5': 'apache2-mod_php5',
  72. 'mod_fcgid': 'apache2-mod_fcgid',
  73. 'vhostdir': '/etc/apache2/vhosts.d',
  74. 'confdir': '/etc/apache2/conf.d',
  75. 'confext': '.conf',
  76. 'default_site': 'vhost.template',
  77. 'default_site_ssl': 'vhost-ssl.template',
  78. 'logdir': '/var/log/apache2',
  79. 'wwwdir': '/srv/www',
  80. },
  81. 'FreeBSD': {
  82. 'server': 'apache22',
  83. 'service': 'apache22',
  84. 'user': 'www',
  85. 'group': 'www',
  86. 'configfile': '/usr/local/etc/apache22/httpd.conf',
  87. 'portsfile': '/usr/local/etc/apache22/ports.conf',
  88. 'mod_php5': 'mod_php56',
  89. 'mod_perl2': 'ap22-mod_perl2',
  90. 'mod_wsgi': 'ap22-mod_wsgi3',
  91. 'vhostdir': '/usr/local/etc/apache22/Includes',
  92. 'confdir': '/usr/local/etc/apache22/extra',
  93. 'modulesdir': '/usr/local/etc/apache22/modules.d',
  94. 'global_document_root': '/usr/local/www/apache22/data',
  95. 'confext': '',
  96. 'default_site': 'default',
  97. 'default_site_ssl': 'default-ssl',
  98. 'logdir': '/var/log/',
  99. 'wwwdir': '/usr/local/www/apache22/',
  100. },
  101. }, merge=salt['grains.filter_by']({
  102. 'precise': {
  103. 'confext': '',
  104. 'default_site': 'default',
  105. 'default_site_ssl': 'default-ssl',
  106. },
  107. 'trusty': {
  108. 'confext': '.conf',
  109. 'default_site': '000-default.conf',
  110. 'default_site_ssl': 'default-ssl.conf',
  111. },
  112. 'utopic': {
  113. 'confext': '.conf',
  114. 'default_site': '000-default.conf',
  115. 'default_site_ssl': 'default-ssl.conf',
  116. },
  117. 'vivid': {
  118. 'confext': '.conf',
  119. 'default_site': '000-default.conf',
  120. 'default_site_ssl': 'default-ssl.conf',
  121. },
  122. 'wily': {
  123. 'confext': '.conf',
  124. 'default_site': '000-default.conf',
  125. 'default_site_ssl': 'default-ssl.conf',
  126. },
  127. 'xenial': {
  128. 'confext': '.conf',
  129. 'default_site': '000-default.conf',
  130. 'default_site_ssl': 'default-ssl.conf',
  131. },
  132. 'yakkety': {
  133. 'confext': '.conf',
  134. 'default_site': '000-default.conf',
  135. 'default_site_ssl': 'default-ssl.conf',
  136. },
  137. 'zesty': {
  138. 'confext': '.conf',
  139. 'default_site': '000-default.conf',
  140. 'default_site_ssl': 'default-ssl.conf',
  141. },
  142. 'artful': {
  143. 'confext': '.conf',
  144. 'default_site': '000-default.conf',
  145. 'default_site_ssl': 'default-ssl.conf',
  146. },
  147. 'jessie': {
  148. 'wwwdir': '/var/www',
  149. 'confext': '.conf',
  150. 'default_site': '000-default.conf',
  151. 'default_site_ssl': 'default-ssl.conf',
  152. },
  153. 'stretch': {
  154. 'wwwdir': '/var/www',
  155. 'confext': '.conf',
  156. 'default_site': '000-default.conf',
  157. 'default_site_ssl': 'default-ssl.conf',
  158. },
  159. 'buster': {
  160. 'wwwdir': '/var/www',
  161. 'confext': '.conf',
  162. 'default_site': '000-default.conf',
  163. 'default_site_ssl': 'default-ssl.conf',
  164. },
  165. }, grain='oscodename', merge=salt['grains.filter_by'](
  166. osfingermap
  167. , grain='osfinger', merge=salt['pillar.get']('apache:lookup')))) %}
  168. {% set modsecurity = salt['grains.filter_by'](
  169. modsec
  170. , grain='os_family', merge=salt['pillar.get']('apache:mod_security')) or {} %}
  171. {# merge the os family/codename mod_sec's specific data over the defaults #}
  172. {% do apache.update({ 'mod_security': modsecurity }) %}