25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2KB

  1. ---
  2. - when: php_sury_repo
  3. block:
  4. - name: sury.org repo requirements
  5. apt:
  6. pkg:
  7. - apt-transport-https
  8. - ca-certificates
  9. - name: sury.org repo key
  10. get_url:
  11. url: https://packages.sury.org/php/apt.gpg
  12. dest: /etc/apt/trusted.gpg.d/php.gpg
  13. checksum: sha256:ace18406ecfe44292566bba8fc2d922370bc9531808a6319019bada3f7b3eab0
  14. - name: sury.org repo
  15. apt_repository:
  16. repo: deb https://packages.sury.org/php/ {{ansible_distribution_release}} main
  17. filename: php
  18. - name: ensure sury.org repo is not present
  19. file:
  20. path: /etc/apt/sources.list.d/php.list
  21. state: absent
  22. - when: not php_version is defined
  23. block:
  24. - name: debian php-cli package
  25. apt:
  26. pkg: php-cli
  27. - name: get installed php version
  28. command: php
  29. args:
  30. stdin: '<?php echo phpversion(); ?>'
  31. register: _get_installed_php_version
  32. changed_when: false
  33. - set_fact:
  34. php_version: "{{ _get_installed_php_version.stdout.split('.')[0:2]|join('.') }}"
  35. - name: debian packages
  36. apt:
  37. pkg:
  38. - php{{php_version}}-cli
  39. - libapache2-mod-php{{php_version}}
  40. - php{{php_version}}-xml
  41. - php{{php_version}}-json
  42. - php{{php_version}}-mbstring