Saltstack Official PHP 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.

map.jinja 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. {% macro sls_block(dict) %}
  2. {% for key, value in dict.items() %}
  3. - {{ key }}: {{ value|json() }}
  4. {% endfor %}
  5. {% endmacro %}
  6. {% set php = salt['pillar.get']('php:ng', {
  7. 'lookup': salt['grains.filter_by']({
  8. 'Debian': {
  9. 'pkgs': {
  10. 'php': 'php5',
  11. 'apc': 'php-apc',
  12. 'cgi': 'php5-cgi',
  13. 'cli': 'php5-cli',
  14. 'curl': 'php5-curl',
  15. 'fpm': 'php5-fpm',
  16. 'gd': 'php5-gd',
  17. 'mbstring': 'php5',
  18. 'mcrypt': 'php5-mcrypt',
  19. 'memcache': 'php5-memcache',
  20. 'memcached': 'php5-memcached',
  21. 'mysql': 'php5-mysql',
  22. 'mysqlnd': 'php5-mysqlnd',
  23. 'pear': ' php-pear',
  24. 'soap': ' php-soap',
  25. 'xml': ' php5-xml',
  26. 'imagick': 'php5-imagick',
  27. 'suhosin': 'php5-suhosin',
  28. 'imap': 'php5-imap',
  29. 'adodb': 'php5-adodb',
  30. 'pgsql': 'php5-pgsql',
  31. 'ldap': 'php5-ldap',
  32. },
  33. 'fpm': {
  34. 'conf': '/etc/php5/fpm/php-fpm.conf',
  35. 'ini': '/etc/php5/fpm/php.ini',
  36. 'pools': '/etc/php5/fpm/pool.d',
  37. 'service': 'php5-fpm',
  38. 'defaults': odict([
  39. ('global', odict([
  40. ('pid', '/var/run/php5-fpm.pid'),
  41. ('error_log', '/var/log/php5-fpm.log'),
  42. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  43. ])),
  44. ]),
  45. },
  46. 'apache2_mod_php_ini': '/etc/php5/apache2/php.ini',
  47. },
  48. 'RedHat': {
  49. 'pkgs': {
  50. 'php': 'php',
  51. 'apc': 'php-pecl-apc',
  52. 'cgi': 'php-cgi',
  53. 'cli': 'php-cli',
  54. 'curl': 'curl',
  55. 'fpm': 'php-fpm',
  56. 'gd': 'php-gd',
  57. 'mbstring': 'php-mbstring',
  58. 'mcrypt': 'php-mcrypt',
  59. 'memcache': 'php-pecl-memcache',
  60. 'memcached': 'php-pecl-memcached',
  61. 'mysql': 'php-mysql',
  62. 'mysqlnd': 'php-mysqlnd',
  63. 'pear': ' php-pear',
  64. 'soap': ' php-soap',
  65. 'xml': ' php-xml',
  66. 'imagick': 'php-imagick',
  67. 'suhosin': 'php-suhosin',
  68. 'imap': 'php-imap',
  69. 'adodb': 'php-adodb',
  70. 'pgsql': 'php-pgsql',
  71. 'ldap': 'php-ldap',
  72. },
  73. 'fpm': {
  74. 'conf': '/etc/php-fpm.conf',
  75. 'ini': '/etc/php.ini',
  76. 'pools': '/etc/php-fpm.d',
  77. 'service': 'php-fpm',
  78. 'defaults': {
  79. 'global': {
  80. 'pid': '/var/run/php-fpm/php-fpm.pid',
  81. 'error_log': '/var/log/php-fpm/error.log',
  82. 'include': '/etc/php-fpm.d/*.conf',
  83. },
  84. },
  85. },
  86. 'apache2_mod_php_ini': '/etc/php.ini',
  87. },
  88. }),
  89. 'installed': {},
  90. 'fpm': {
  91. 'service': {
  92. 'enabled': True,
  93. 'opts': {},
  94. },
  95. 'config': {
  96. 'ini': {
  97. 'opts': {},
  98. 'settings': {},
  99. },
  100. 'conf': {
  101. 'opts': {},
  102. 'settings': {},
  103. },
  104. },
  105. 'pools': {
  106. 'managed_opts': {},
  107. 'absent_opts': {},
  108. 'managed': {},
  109. },
  110. },
  111. 'ini': {
  112. 'defaults': {
  113. 'PHP': {
  114. 'engine': 'On',
  115. 'short_open_tag': 'Off',
  116. 'asp_tags': 'Off',
  117. 'precision': 14,
  118. 'output_buffering': 4096,
  119. 'zlib.output_compression': 'Off',
  120. 'implicit_flush': 'Off',
  121. 'serialize_precision': 17,
  122. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  123. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  124. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  125. 'zend.enable_gc': 'On',
  126. 'expose_php': 'On',
  127. 'max_execution_time': 30,
  128. 'max_input_time': 60,
  129. 'max_input_nesting_level': 64,
  130. 'max_input_vars': 1000,
  131. 'memory_limit': '128M',
  132. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  133. 'display_errors': 'Off',
  134. 'display_startup_errors': 'Off',
  135. 'log_errors': 'On',
  136. 'log_errors_max_len': 1024,
  137. 'ignore_repeated_errors': 'Off',
  138. 'ignore_repeated_source': 'Off',
  139. 'report_memleaks': 'On',
  140. 'track_errors': 'Off',
  141. 'html_errors': 'On',
  142. 'variables_order': 'GPCS',
  143. 'request_order': 'GP',
  144. 'register_argc_argv': 'Off',
  145. 'auto_globals_jit': 'On',
  146. 'post_max_size': '8M',
  147. 'default_mimetype': '"text/html"',
  148. 'enable_dl': 'Off',
  149. 'file_uploads': 'On',
  150. 'upload_max_filesize': '2M',
  151. 'max_file_uploads': 20,
  152. 'allow_url_fopen': 'On',
  153. 'allow_url_include': 'Off',
  154. 'default_socket_timeout': 60
  155. },
  156. 'CLI Server': {
  157. 'cli_server.color': 'On'
  158. },
  159. 'Date': {
  160. 'date.timezone': 'America/New_York'
  161. },
  162. 'Pdo_mysql': {
  163. 'pdo_mysql.cache_size': 2000
  164. },
  165. 'mail function': {
  166. 'SMTP': 'localhost',
  167. 'mail.add_x_header': 'On'
  168. },
  169. 'SQL': {
  170. 'sql.safe_mode': 'Off'
  171. },
  172. 'ODBC': {
  173. 'odbc.allow_persistent': 'On',
  174. 'odbc.check_persistent': 'On',
  175. 'odbc.max_persistent': '-1',
  176. 'odbc.max_links': '-1',
  177. 'odbc.defaultlrl': 4096,
  178. 'odbc.defaultbinmode': 1
  179. },
  180. 'Interbase': {
  181. 'ibase.allow_persistent': 1,
  182. 'ibase.max_persistent': -1,
  183. 'ibase.max_links': -1,
  184. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  185. 'ibase.dateformat': '"%Y-%m-%d"',
  186. 'ibase.timeformat': '"%H:%M:%S"'
  187. },
  188. 'MySQL': {
  189. 'mysql.allow_local_infile': 'On',
  190. 'mysql.allow_persistent': 'On',
  191. 'mysql.cache_size': '2000',
  192. 'mysql.max_persistent': -1,
  193. 'mysql.max_links': -1,
  194. 'mysql.connect_timeout': 60,
  195. 'mysql.trace_mode': 'Off'
  196. },
  197. 'MySQLi': {
  198. 'mysqli.max_persistent': -1,
  199. 'mysqli.allow_persistent': 'On',
  200. 'mysqli.max_links': -1,
  201. 'mysqli.cache_size': 2000,
  202. 'mysqli.default_port': 3306,
  203. 'mysqli.reconnect': 'Off'
  204. },
  205. 'mysqlnd': {
  206. 'mysqlnd.collect_statistics': 'On',
  207. 'mysqlnd.collect_memory_statistics': 'Off'
  208. },
  209. 'PostgreSQL': {
  210. 'pgsql.allow_persistent': 'On',
  211. 'pgsql.auto_reset_persistent': 'Off',
  212. 'pgsql.max_persistent': -1,
  213. 'pgsql.max_links': -1,
  214. 'pgsql.ignore_notice': 0,
  215. 'pgsql.log_notice': 0
  216. },
  217. 'Sybase-CT': {
  218. 'sybct.allow_persistent': 'On',
  219. 'sybct.max_persistent': -1,
  220. 'sybct.max_links': -1,
  221. 'sybct.min_server_severity': 10,
  222. 'sybct.min_client_severity': 10
  223. },
  224. 'bcmath': {
  225. 'bcmath.scale': 0
  226. },
  227. 'Session': {
  228. 'session.save_handler': 'files',
  229. 'session.use_strict_mode': 0,
  230. 'session.use_cookies': 1,
  231. 'session.use_only_cookies': 1,
  232. 'session.name': 'PHPSESSID',
  233. 'session.auto_start': 0,
  234. 'session.cookie_lifetime': 0,
  235. 'session.cookie_path': '/',
  236. 'session.serialize_handler': 'php',
  237. 'session.gc_probability': 0,
  238. 'session.gc_divisor': 1000,
  239. 'session.gc_maxlifetime': 1440,
  240. 'session.bug_compat_42': 'Off',
  241. 'session.bug_compat_warn': 'Off',
  242. 'session.cache_limiter': 'nocache',
  243. 'session.cache_expire': '180',
  244. 'session.use_trans_sid': 0,
  245. 'session.hash_function': 0,
  246. 'session.hash_bits_per_character': 5,
  247. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  248. },
  249. 'MSSQL': {
  250. 'mssql.allow_persistent': 'On',
  251. 'mssql.max_persistent': -1,
  252. 'mssql.max_links': -1,
  253. 'mssql.min_error_severity': 10,
  254. 'mssql.min_message_severity': 10,
  255. 'mssql.compatibility_mode': 'Off',
  256. 'mssql.secure_connection': 'Off'
  257. },
  258. 'Tidy': {
  259. 'tidy.clean_output': 'Off'
  260. },
  261. 'soap': {
  262. 'soap.wsdl_cache_enabled': 1,
  263. 'soap.wsdl_cache_dir': '"/tmp"',
  264. 'soap.wsdl_cache_ttl': 86400,
  265. 'soap.wsdl_cache_limit': 5
  266. },
  267. 'ldap': {
  268. 'ldap.max_links': -1
  269. },
  270. },
  271. },
  272. }, merge=True) %}