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