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.

installed.jinja 4.1KB

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 yıl önce
10 yıl önce
10 yıl önce
10 yıl önce
10 yıl önce
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 yıl önce
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 yıl önce
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 yıl önce
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 yıl önce
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 yıl önce
10 yıl önce
10 yıl önce
10 yıl önce
10 yıl önce
10 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # -*- coding: utf-8 -*-
  2. # vim: ft=jinja
  3. {# Template for installing packages #}
  4. {% from "php/ng/map.jinja" import php with context %}
  5. {% from "php/ng/macro.jinja" import sls_block %}
  6. {% set pkginfo = php.lookup.pkgs.get(state) %}
  7. {% set pkgs = [] %}
  8. {% set specials = [] %}
  9. {% if pkginfo is iterable and pkginfo is not string %}
  10. {% for pkg in pkginfo %}
  11. {% if pkg is mapping %}
  12. {% do specials.append(pkg) %}
  13. {% else %}
  14. {% do pkgs.append(pkg) %}
  15. {% if salt['pillar.get']('php:ng:version') is iterable %}
  16. {% set first_version = salt['pillar.get']('php:ng:version')[0]|string %}
  17. {% for other_version in salt['pillar.get']('php:ng:version') %}
  18. {% set other_version_str = other_version|string %}
  19. {% do pkgs.append(pkg.replace(first_version, other_version_str)) %}
  20. {% endfor %}
  21. {% endif %}
  22. {% endif %}
  23. {% endfor %}
  24. {% else %}
  25. {% do pkgs.append(pkginfo) %}
  26. {% if salt['pillar.get']('php:ng:version') is iterable %}
  27. {% set first_version = salt['pillar.get']('php:ng:version')[0]|string %}
  28. {% for other_version in salt['pillar.get']('php:ng:version') %}
  29. {% set other_version_str = other_version|string %}
  30. {% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %}
  31. {% endfor %}
  32. {% endif %}
  33. {% endif %}
  34. {% if grains['os_family'] == "Debian" and (state == 'cli' or state == 'fpm' or state == 'php') %}
  35. {% set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %}
  36. {% if use_external_repo %}
  37. {% if grains['os'] == 'Ubuntu' %}
  38. {% set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %}
  39. php_ppa_{{ state }}:
  40. pkgrepo.managed:
  41. - ppa: {{ external_repo_name }}
  42. - __env__:
  43. - LC_ALL: C.UTF-8
  44. - onlyif:
  45. - test ! -e /etc/apt/sources.list.d/ondrej-ubuntu-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #}
  46. - test ! -e /etc/apt/sources.list.d/ondrej-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #}
  47. - require_in:
  48. - pkg: php_install_{{ state }}
  49. pkg.latest:
  50. - name: {{ state }}
  51. - pkgs: {{ pkgs|json() }}
  52. - refresh: True
  53. - onchanges:
  54. - pkgrepo: php_ppa_{{ state }}
  55. {% else %}
  56. {% set external_repo_name = salt['pillar.get']('php:external_repo_name', 'packages.sury.org/php' ) %}
  57. php_repo_{{ state }}:
  58. pkg.installed:
  59. - name: apt-transport-https
  60. php_ppa_{{ state }}:
  61. pkgrepo.managed:
  62. - humanname: {{ external_repo_name }}
  63. - name: deb https://packages.sury.org/php/ {{ grains['oscodename'] }} main
  64. - file: /etc/apt/sources.list.d/ondrej-php.list
  65. - key_url: https://packages.sury.org/php/apt.gpg
  66. - __env__:
  67. - LC_ALL: C.UTF-8
  68. - onlyif:
  69. - test ! -e /etc/apt/sources.list.d/ondrej-php.list
  70. - require_in:
  71. - pkg: php_install_{{ state }}
  72. pkg.latest:
  73. - name: {{ state }}
  74. - pkgs: {{ pkgs|json() }}
  75. - refresh: True
  76. - onchanges:
  77. - pkgrepo: php_ppa_{{ state }}
  78. {% endif %}
  79. {% endif %}
  80. {% elif grains['os_family'] == "RedHat" and (state == 'cli' or state == 'fpm' or state == 'php') %}
  81. {% set use_scl_repo = salt['pillar.get']('php:use_scl_repo', False) %}
  82. {% set scl_php_version = salt['pillar.get']('php:scl_php_version', 71) %}
  83. {% set enable_php_repo = salt['pillar.get']('php:ng:lookup:enable_php_repo', False) %}
  84. {% if use_scl_repo and grains['os'] == 'CentOS' %}
  85. php_centos_scl_enable_{{ state }}:
  86. pkg.installed:
  87. - name: centos-release-scl
  88. {% elif use_scl_repo and grains['os'] == 'RedHat' %}
  89. php_redhat_scl_enable_{{ state }}:
  90. cmd.run:
  91. - name: yum-config-manager --enable rhel-server-rhscl-{{ grains['osmajorrelease'] }}-rpms
  92. {% endif %}
  93. {% endif %}
  94. php_install_{{ state }}:
  95. pkg.installed:
  96. - name: {{ state }}
  97. - pkgs: {{ pkgs|json() }}
  98. {% if enable_php_repo is defined and enable_php_repo %}
  99. - enablerepo: {{ enable_php_repo }}
  100. {% endif %}
  101. {% for pkg in specials %}
  102. php_install_{{ state }}_{{ pkg.get('name') | replace("/", "-") }}:
  103. pkg.installed:
  104. {{ sls_block(pkg) }}
  105. {% endfor %}