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 3.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
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. {% endif %}
  16. {% endfor %}
  17. {% else %}
  18. {% do pkgs.append(pkginfo) %}
  19. {% endif %}
  20. {% if grains['os_family'] == "Debian" and (state == 'cli' or state == 'fpm' or state == 'php') %}
  21. {% set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %}
  22. {% if use_external_repo %}
  23. {% if grains['os'] == 'Ubuntu' %}
  24. {% set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %}
  25. php_ppa_{{ state }}:
  26. pkgrepo.managed:
  27. - ppa: {{ external_repo_name }}
  28. - __env__:
  29. - LC_ALL: C.UTF-8
  30. - onlyif:
  31. - test ! -e /etc/apt/sources.list.d/ondrej-ubuntu-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #}
  32. - test ! -e /etc/apt/sources.list.d/ondrej-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #}
  33. - require_in:
  34. - pkg: php_install_{{ state }}
  35. pkg.latest:
  36. - name: {{ state }}
  37. - pkgs: {{ pkgs|json() }}
  38. - refresh: True
  39. - onchanges:
  40. - pkgrepo: php_ppa_{{ state }}
  41. {% else %}
  42. {% set external_repo_name = salt['pillar.get']('php:external_repo_name', 'packages.sury.org/php' ) %}
  43. php_repo_{{ state }}:
  44. pkg.installed:
  45. - name: apt-transport-https
  46. php_ppa_{{ state }}:
  47. pkgrepo.managed:
  48. - humanname: {{ external_repo_name }}
  49. - name: deb https://packages.sury.org/php/ {{ grains['oscodename'] }} main
  50. - file: /etc/apt/sources.list.d/ondrej-php.list
  51. - key_url: https://packages.sury.org/php/apt.gpg
  52. - __env__:
  53. - LC_ALL: C.UTF-8
  54. - onlyif:
  55. - test ! -e /etc/apt/sources.list.d/ondrej-php.list
  56. - require_in:
  57. - pkg: php_install_{{ state }}
  58. pkg.latest:
  59. - name: {{ state }}
  60. - pkgs: {{ pkgs|json() }}
  61. - refresh: True
  62. - onchanges:
  63. - pkgrepo: php_ppa_{{ state }}
  64. {% endif %}
  65. {% endif %}
  66. {% elif grains['os_family'] == "RedHat" and (state == 'cli' or state == 'fpm' or state == 'php') %}
  67. {% set use_scl_repo = salt['pillar.get']('php:use_scl_repo', False) %}
  68. {% set scl_php_version = salt['pillar.get']('php:scl_php_version', 71) %}
  69. {% if use_scl_repo and grains['os'] == 'CentOS' %}
  70. php_centos_scl_enable_{{ state }}:
  71. pkg.installed:
  72. - name: centos-release-scl
  73. {% elif use_scl_repo and grains['os'] == 'RedHat' %}
  74. php_redhat_scl_enable_{{ state }}:
  75. cmd.run:
  76. - name: yum-config-manager --enable rhel-server-rhscl-{{ grains['osmajorrelease'] }}-rpms
  77. {% endif %}
  78. {% endif %}
  79. php_install_{{ state }}:
  80. pkg.installed:
  81. - name: {{ state }}
  82. - pkgs: {{ pkgs|json() }}
  83. {% for pkg in specials %}
  84. php_install_{{ state }}_{{ pkg.get('name') | replace("/", "-") }}:
  85. pkg.installed:
  86. {{ sls_block(pkg) }}
  87. {% endfor %}