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.

suhosin.sls 2.4KB

New structure for new Ubuntu PPA and other fixes (#113) * Initial commit for new branch * Quick change to base test files * Updated map.jinja, added `php` dependency for all subformulas * Fixing mongo module and map.jinja needed OpenSSL dev libraries * Should be final changes needed for Mongo module * Updating Suhosin package since many distros don't have package in their repos anymore * Generalizing suhosin module, and updating pillar.example for new PPA * Adding addtional logic for RedHat based families to Suhosin * Initial commit of NG refactored map.jinja file * Deleting FFMpeg state file since the module is quite old, and has been replaced by using a Composer library. See https://github.com/PHP-FFMpeg/PHP-FFMpeg for details * Updating NG formulas for new definitions * Removing 'twig' as a state since it can be installed via Composer * Changes to installed.jinja to set correct PHP path based on version * NG Composer and NG Suhosin changes * Version bump and deleting README for deleted states * Finished refactor of NG map.jinja file * Adding trailing commas (forgot them earler) * Adding changes list, and modifying map file for missing definitions when using Ubuntu 16.04 and NOT using a PPA * Changes needed after performing testing on RHEL 7 * Changes needed for Ubuntu Trusty without using PPA * Removing testing files; keep on local * Map changes needed after testing Debian Jessie * Changed needed for Debian Wheezy * Adding more pkgs for Arch Linux support * More ArchLinux support * Stupid tabs * Removing extra line breaks, and using the general "use_external_repo" in the future if DotDeb (Debian) or Webtactic (RedHat) * Accoutning for Precise `phpenmod` and others
8 years ago
New structure for new Ubuntu PPA and other fixes (#113) * Initial commit for new branch * Quick change to base test files * Updated map.jinja, added `php` dependency for all subformulas * Fixing mongo module and map.jinja needed OpenSSL dev libraries * Should be final changes needed for Mongo module * Updating Suhosin package since many distros don't have package in their repos anymore * Generalizing suhosin module, and updating pillar.example for new PPA * Adding addtional logic for RedHat based families to Suhosin * Initial commit of NG refactored map.jinja file * Deleting FFMpeg state file since the module is quite old, and has been replaced by using a Composer library. See https://github.com/PHP-FFMpeg/PHP-FFMpeg for details * Updating NG formulas for new definitions * Removing 'twig' as a state since it can be installed via Composer * Changes to installed.jinja to set correct PHP path based on version * NG Composer and NG Suhosin changes * Version bump and deleting README for deleted states * Finished refactor of NG map.jinja file * Adding trailing commas (forgot them earler) * Adding changes list, and modifying map file for missing definitions when using Ubuntu 16.04 and NOT using a PPA * Changes needed after performing testing on RHEL 7 * Changes needed for Ubuntu Trusty without using PPA * Removing testing files; keep on local * Map changes needed after testing Debian Jessie * Changed needed for Debian Wheezy * Adding more pkgs for Arch Linux support * More ArchLinux support * Stupid tabs * Removing extra line breaks, and using the general "use_external_repo" in the future if DotDeb (Debian) or Webtactic (RedHat) * Accoutning for Precise `phpenmod` and others
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {% from "php/ng/map.jinja" import php with context %}
  2. include:
  3. - php.ng.deprecated
  4. - php.ng
  5. - php.ng.dev
  6. {% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
  7. {% if salt['grains.get']('os') == "Ubuntu" %}
  8. {% if phpng_version >= '7.0' %}
  9. {% set suhosin_ext = php.lookup.pkgs.suhosin7_ext %}
  10. {% set suhosin_name = 'suhosin7' %}
  11. {% set suhosin_repo = php.lookup.pkgs.suhosin7_repo %}
  12. {% set tmppath = '/tmp/suhosin7' %}
  13. {% else %}
  14. {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %}
  15. {% set suhosin_name = 'suhosin' %}
  16. {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %}
  17. {% set tmppath = '/tmp/suhosin5' %}
  18. {% endif %}
  19. {% elif salt['grains.get']('os_family') == "RedHat" %}
  20. {% if grains['osmajorrelease'] == "7" %}
  21. {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %}
  22. {% set suhosin_name = 'suhosin' %}
  23. {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %}
  24. {% set tmppath = '/tmp/suhosin5' %}
  25. {% else %}
  26. {# RHEL version 6 contains PHP 5.3, which is not supported by Suhosin #}
  27. {% endif %}
  28. {% else %}
  29. {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %}
  30. {% set suhosin_name = 'suhosin' %}
  31. {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %}
  32. {% set tmppath = '/tmp/suhosin5' %}
  33. {% endif %}
  34. build-pkgs:
  35. pkg.installed:
  36. - pkgs: {{ php.lookup.pkgs.build_pkgs }}
  37. git:
  38. pkg.installed: []
  39. suhosin-source:
  40. git.latest:
  41. - name: {{ suhosin_repo }}
  42. - target: {{ tmppath }}
  43. - unless:
  44. - test -d {{ tmppath }}
  45. - require:
  46. - pkg: git
  47. install-suhosin:
  48. cmd.run:
  49. - name: |
  50. phpize
  51. ./configure
  52. make
  53. make install
  54. - cwd: {{ tmppath }}
  55. - shell: /bin/bash
  56. - runas: root
  57. - unless:
  58. - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini
  59. - require:
  60. - pkg: build-pkgs
  61. - git: suhosin-source
  62. php-suhosin-conf:
  63. file.managed:
  64. - name: {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini
  65. - contents: |
  66. extension={{ suhosin_ext }}
  67. suhosin.executor.include.whitelist=phar
  68. - require:
  69. - pkg: php
  70. - cmd: install-suhosin
  71. - unless:
  72. - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini
  73. {% if salt['grains.get']('os_family') == "Debian" %}
  74. php-suhosin-enable:
  75. cmd.run:
  76. - name: {{ php.lookup.pkgs.phpenmod_command }} {{ suhosin_name }}
  77. - require:
  78. - file: php-suhosin-conf
  79. {% endif %}