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.

337 lines
11KB

  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. 'adodb': {
  90. 'pkg_opts': {},
  91. },
  92. 'apc': {
  93. 'pkg_opts': {},
  94. },
  95. 'cgi': {
  96. 'pkg_opts': {},
  97. },
  98. 'cli': {
  99. 'pkg_opts': {},
  100. },
  101. 'curl': {
  102. 'pkg_opts': {},
  103. },
  104. 'fpm': {
  105. 'pkg_opts': {},
  106. 'service': {
  107. 'enabled': True,
  108. 'opts': {},
  109. },
  110. 'config': {
  111. 'ini': {
  112. 'opts': {},
  113. 'settings': {},
  114. },
  115. 'conf': {
  116. 'opts': {},
  117. 'settings': {},
  118. },
  119. },
  120. 'pools': {
  121. 'managed_opts': {},
  122. 'absent_opts': {},
  123. 'managed': {},
  124. },
  125. },
  126. 'gd': {
  127. 'pkg_opts': {},
  128. },
  129. 'imagick': {
  130. 'pkg_opts': {},
  131. },
  132. 'imap': {
  133. 'pkg_opts': {},
  134. },
  135. 'ini': {
  136. 'defaults': {
  137. 'PHP': {
  138. 'engine': 'On',
  139. 'short_open_tag': 'Off',
  140. 'asp_tags': 'Off',
  141. 'precision': 14,
  142. 'output_buffering': 4096,
  143. 'zlib.output_compression': 'Off',
  144. 'implicit_flush': 'Off',
  145. 'serialize_precision': 17,
  146. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  147. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  148. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  149. 'zend.enable_gc': 'On',
  150. 'expose_php': 'On',
  151. 'max_execution_time': 30,
  152. 'max_input_time': 60,
  153. 'max_input_nesting_level': 64,
  154. 'max_input_vars': 1000,
  155. 'memory_limit': '128M',
  156. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  157. 'display_errors': 'Off',
  158. 'display_startup_errors': 'Off',
  159. 'log_errors': 'On',
  160. 'log_errors_max_len': 1024,
  161. 'ignore_repeated_errors': 'Off',
  162. 'ignore_repeated_source': 'Off',
  163. 'report_memleaks': 'On',
  164. 'track_errors': 'Off',
  165. 'html_errors': 'On',
  166. 'variables_order': 'GPCS',
  167. 'request_order': 'GP',
  168. 'register_argc_argv': 'Off',
  169. 'auto_globals_jit': 'On',
  170. 'post_max_size': '8M',
  171. 'default_mimetype': '"text/html"',
  172. 'enable_dl': 'Off',
  173. 'file_uploads': 'On',
  174. 'upload_max_filesize': '2M',
  175. 'max_file_uploads': 20,
  176. 'allow_url_fopen': 'On',
  177. 'allow_url_include': 'Off',
  178. 'default_socket_timeout': 60
  179. },
  180. 'CLI Server': {
  181. 'cli_server.color': 'On'
  182. },
  183. 'Date': {
  184. 'date.timezone': 'America/New_York'
  185. },
  186. 'Pdo_mysql': {
  187. 'pdo_mysql.cache_size': 2000
  188. },
  189. 'mail function': {
  190. 'SMTP': 'localhost',
  191. 'mail.add_x_header': 'On'
  192. },
  193. 'SQL': {
  194. 'sql.safe_mode': 'Off'
  195. },
  196. 'ODBC': {
  197. 'odbc.allow_persistent': 'On',
  198. 'odbc.check_persistent': 'On',
  199. 'odbc.max_persistent': '-1',
  200. 'odbc.max_links': '-1',
  201. 'odbc.defaultlrl': 4096,
  202. 'odbc.defaultbinmode': 1
  203. },
  204. 'Interbase': {
  205. 'ibase.allow_persistent': 1,
  206. 'ibase.max_persistent': -1,
  207. 'ibase.max_links': -1,
  208. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  209. 'ibase.dateformat': '"%Y-%m-%d"',
  210. 'ibase.timeformat': '"%H:%M:%S"'
  211. },
  212. 'MySQL': {
  213. 'mysql.allow_local_infile': 'On',
  214. 'mysql.allow_persistent': 'On',
  215. 'mysql.cache_size': '2000',
  216. 'mysql.max_persistent': -1,
  217. 'mysql.max_links': -1,
  218. 'mysql.connect_timeout': 60,
  219. 'mysql.trace_mode': 'Off'
  220. },
  221. 'MySQLi': {
  222. 'mysqli.max_persistent': -1,
  223. 'mysqli.allow_persistent': 'On',
  224. 'mysqli.max_links': -1,
  225. 'mysqli.cache_size': 2000,
  226. 'mysqli.default_port': 3306,
  227. 'mysqli.reconnect': 'Off'
  228. },
  229. 'mysqlnd': {
  230. 'mysqlnd.collect_statistics': 'On',
  231. 'mysqlnd.collect_memory_statistics': 'Off'
  232. },
  233. 'PostgreSQL': {
  234. 'pgsql.allow_persistent': 'On',
  235. 'pgsql.auto_reset_persistent': 'Off',
  236. 'pgsql.max_persistent': -1,
  237. 'pgsql.max_links': -1,
  238. 'pgsql.ignore_notice': 0,
  239. 'pgsql.log_notice': 0
  240. },
  241. 'Sybase-CT': {
  242. 'sybct.allow_persistent': 'On',
  243. 'sybct.max_persistent': -1,
  244. 'sybct.max_links': -1,
  245. 'sybct.min_server_severity': 10,
  246. 'sybct.min_client_severity': 10
  247. },
  248. 'bcmath': {
  249. 'bcmath.scale': 0
  250. },
  251. 'Session': {
  252. 'session.save_handler': 'files',
  253. 'session.use_strict_mode': 0,
  254. 'session.use_cookies': 1,
  255. 'session.use_only_cookies': 1,
  256. 'session.name': 'PHPSESSID',
  257. 'session.auto_start': 0,
  258. 'session.cookie_lifetime': 0,
  259. 'session.cookie_path': '/',
  260. 'session.serialize_handler': 'php',
  261. 'session.gc_probability': 0,
  262. 'session.gc_divisor': 1000,
  263. 'session.gc_maxlifetime': 1440,
  264. 'session.bug_compat_42': 'Off',
  265. 'session.bug_compat_warn': 'Off',
  266. 'session.cache_limiter': 'nocache',
  267. 'session.cache_expire': '180',
  268. 'session.use_trans_sid': 0,
  269. 'session.hash_function': 0,
  270. 'session.hash_bits_per_character': 5,
  271. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  272. },
  273. 'MSSQL': {
  274. 'mssql.allow_persistent': 'On',
  275. 'mssql.max_persistent': -1,
  276. 'mssql.max_links': -1,
  277. 'mssql.min_error_severity': 10,
  278. 'mssql.min_message_severity': 10,
  279. 'mssql.compatibility_mode': 'Off',
  280. 'mssql.secure_connection': 'Off'
  281. },
  282. 'Tidy': {
  283. 'tidy.clean_output': 'Off'
  284. },
  285. 'soap': {
  286. 'soap.wsdl_cache_enabled': 1,
  287. 'soap.wsdl_cache_dir': '"/tmp"',
  288. 'soap.wsdl_cache_ttl': 86400,
  289. 'soap.wsdl_cache_limit': 5
  290. },
  291. 'ldap': {
  292. 'ldap.max_links': -1
  293. },
  294. },
  295. },
  296. 'init': {
  297. 'pkg_opts': {},
  298. },
  299. 'ldap': {
  300. 'pkg_opts': {},
  301. },
  302. 'mbstring': {
  303. 'pkg_opts': {},
  304. },
  305. 'mcrypt': {
  306. 'pkg_opts': {},
  307. },
  308. 'memcache': {
  309. 'pkg_opts': {},
  310. },
  311. 'memcached': {
  312. 'pkg_opts': {},
  313. },
  314. 'mysql': {
  315. 'pkg_opts': {},
  316. },
  317. 'mysqlnd': {
  318. 'pkg_opts': {},
  319. },
  320. 'pear': {
  321. 'pkg_opts': {},
  322. },
  323. 'pgsql': {
  324. 'pkg_opts': {},
  325. },
  326. 'soap': {
  327. 'pkg_opts': {},
  328. },
  329. 'suhosin': {
  330. 'pkg_opts': {},
  331. },
  332. 'xml': {
  333. 'pkg_opts': {},
  334. },
  335. }, merge=True) %}