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.

158 lines
5.0KB

  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. 'portsfile': '/usr/local/etc/apache22/ports.conf',
  78. 'mod_php5': 'mod_php56',
  79. 'mod_wsgi': 'ap22-mod_wsgi3',
  80. 'vhostdir': '/usr/local/etc/apache22/Includes',
  81. 'confdir': '/usr/local/etc/apache22/extra',
  82. 'modulesdir': '/usr/local/etc/apache22/modules.d',
  83. 'global_document_root': '/usr/local/www/apache22/data',
  84. 'confext': '',
  85. 'default_site': 'default',
  86. 'default_site_ssl': 'default-ssl',
  87. 'logdir': '/var/log/',
  88. 'wwwdir': '/usr/local/www/apache22/',
  89. 'use_require': False,
  90. },
  91. }, merge=salt['grains.filter_by']({
  92. 'precise': {
  93. 'confext': '',
  94. 'default_site': 'default',
  95. 'default_site_ssl': 'default-ssl',
  96. 'use_require': True,
  97. },
  98. 'trusty': {
  99. 'confext': '.conf',
  100. 'default_site': '000-default.conf',
  101. 'default_site_ssl': 'default-ssl.conf',
  102. 'use_require': True,
  103. },
  104. 'utopic': {
  105. 'confext': '.conf',
  106. 'default_site': '000-default.conf',
  107. 'default_site_ssl': 'default-ssl.conf',
  108. 'use_require': True,
  109. },
  110. 'vivid': {
  111. 'confext': '.conf',
  112. 'default_site': '000-default.conf',
  113. 'default_site_ssl': 'default-ssl.conf',
  114. 'use_require': True,
  115. },
  116. 'wily': {
  117. 'confext': '.conf',
  118. 'default_site': '000-default.conf',
  119. 'default_site_ssl': 'default-ssl.conf',
  120. 'use_require': True,
  121. },
  122. 'xenial': {
  123. 'confext': '.conf',
  124. 'default_site': '000-default.conf',
  125. 'default_site_ssl': 'default-ssl.conf',
  126. 'use_require': True,
  127. },
  128. 'jessie': {
  129. 'wwwdir': '/var/www',
  130. 'confext': '.conf',
  131. 'default_site': '000-default.conf',
  132. 'default_site_ssl': 'default-ssl.conf',
  133. 'use_require': True,
  134. },
  135. }, grain='oscodename', merge=salt['grains.filter_by'](
  136. osfingermap
  137. , grain='osfinger', merge=salt['pillar.get']('apache:lookup')))) %}
  138. {% set modsecurity = salt['grains.filter_by'](
  139. modsec
  140. , grain='os_family', merge=salt['pillar.get']('apache:mod_security')) or {} %}
  141. {# merge the os family/codename mod_sec's specific data over the defaults #}
  142. {% do apache.update({ 'mod_security': modsecurity }) %}