mirror of
https://github.com/geerlingguy/ansible-role-php.git
synced 2024-11-28 12:45:16 +01:00
Merge branch 'master' into master
This commit is contained in:
commit
e71d49d319
4
.ansible-lint
Normal file
4
.ansible-lint
Normal file
@ -0,0 +1,4 @@
|
||||
skip_list:
|
||||
- '306'
|
||||
- '405'
|
||||
- '503'
|
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
---
|
||||
github: geerlingguy
|
||||
patreon: geerlingguy
|
56
.github/stale.yml
vendored
Normal file
56
.github/stale.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 90
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 30
|
||||
|
||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
||||
onlyLabels: []
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- planned
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Set to true to ignore issues with an assignee (defaults to false)
|
||||
exemptAssignees: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
pulls:
|
||||
markComment: |-
|
||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This pull request is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
||||
|
||||
issues:
|
||||
markComment: |-
|
||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This issue is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.retry
|
||||
tests/test.sh
|
||||
*/__pycache__
|
||||
*.pyc
|
||||
|
82
.travis.yml
82
.travis.yml
@ -1,71 +1,33 @@
|
||||
---
|
||||
language: python
|
||||
services: docker
|
||||
|
||||
env:
|
||||
# Test package install on all supported OSes.
|
||||
- distro: centos7
|
||||
playbook: test.yml
|
||||
php_version: 7.0
|
||||
- distro: fedora27
|
||||
playbook: test.yml
|
||||
php_version: 7.1
|
||||
- distro: debian9
|
||||
playbook: test.yml
|
||||
php_version: 7.0
|
||||
- distro: debian8
|
||||
playbook: test.yml
|
||||
php_version: 7.0
|
||||
- distro: ubuntu1604
|
||||
playbook: test.yml
|
||||
php_version: 7.0
|
||||
- distro: ubuntu1404
|
||||
playbook: test.yml
|
||||
php_version: 7.0
|
||||
global:
|
||||
- ROLE_NAME: php
|
||||
matrix:
|
||||
- MOLECULE_DISTRO: centos8
|
||||
- MOLECULE_DISTRO: centos7
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
- MOLECULE_DISTRO: debian9
|
||||
|
||||
# Only test source install on latest supported OSes.
|
||||
- distro: centos7
|
||||
playbook: test-source.yml
|
||||
php_version: 7.1.9
|
||||
- distro: ubuntu1604
|
||||
playbook: test-source.yml
|
||||
php_version: 7.1.9
|
||||
- MOLECULE_DISTRO: centos7
|
||||
MOLECULE_PLAYBOOK: playbook-source.yml
|
||||
|
||||
install:
|
||||
# Install test dependencies.
|
||||
- pip install molecule yamllint ansible-lint docker
|
||||
|
||||
before_script:
|
||||
# Use actual Ansible Galaxy role name for the project directory.
|
||||
- cd ../
|
||||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
|
||||
- cd geerlingguy.$ROLE_NAME
|
||||
|
||||
script:
|
||||
# Configure test script so we can run extra tests after playbook is run.
|
||||
- export container_id=$(date +%s)
|
||||
- export cleanup=false
|
||||
|
||||
# Download test shim.
|
||||
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
|
||||
- chmod +x ${PWD}/tests/test.sh
|
||||
|
||||
# Run tests.
|
||||
- ${PWD}/tests/test.sh
|
||||
|
||||
# Ensure PHP is installed and at the right version.
|
||||
- 'docker exec --tty ${container_id} env TERM=xterm which php'
|
||||
- 'docker exec --tty ${container_id} env TERM=xterm test -x /usr/bin/php'
|
||||
|
||||
- 'docker exec --tty ${container_id} env TERM=xterm php --version'
|
||||
- 'docker exec --tty ${container_id} env TERM=xterm /usr/bin/php --version | grep -qF "PHP ${php_version}"'
|
||||
|
||||
# Ensure PHP configurations have taken effect.
|
||||
- docker exec --tty ${container_id} env TERM=xterm php -i | grep 'memory_limit.*192'
|
||||
|
||||
# Check the status of PHP-FPM.
|
||||
- |
|
||||
if [ "${playbook}" == "test.yml" ]; then
|
||||
case "${distro}" in
|
||||
"centos7"|"fedora24")
|
||||
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status
|
||||
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status | grep -qF "fpm.service; enabled"
|
||||
;;
|
||||
"debian8"|"ubuntu1604")
|
||||
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status
|
||||
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status | grep -qF "fpm.service; enabled"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
- molecule test
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
|
6
.yamllint
Normal file
6
.yamllint
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
extends: default
|
||||
rules:
|
||||
line-length:
|
||||
max: 120
|
||||
level: warning
|
14
README.md
14
README.md
@ -34,13 +34,17 @@ The default values for the HTTP server deamon are `httpd` (used by Apache) for R
|
||||
|
||||
(RedHat/CentOS only) If you have enabled any additional repositories (might I suggest [geerlingguy.repo-epel](https://github.com/geerlingguy/ansible-role-repo-epel) or [geerlingguy.repo-remi](https://github.com/geerlingguy/ansible-role-repo-remi)), those repositories can be listed under this variable (e.g. `remi-php70,epel`). This can be handy, as an example, if you want to install the latest version of PHP 7.0, which is in the Remi repository.
|
||||
|
||||
php_default_version_debian: "7.0"
|
||||
|
||||
(Debian/Ubuntu only) The default version of PHP in the given OS version repositories. Defaults to the latest Ubuntu LTS release. Ubuntu 18.04 needs this to be set to `"7.2"` since PHP 7.0 is not available in the default bionic packages.
|
||||
|
||||
**If you'd like to be able to switch PHP versions easily, or use a version that's not available in system packages**: You can use the [`geerlingguy.php-versions`](https://galaxy.ansible.com/geerlingguy/php-versions/) role to more easily switch between major PHP versions (e.g. 5.6, 7.1, 7.2).
|
||||
|
||||
php_packages_state: "present"
|
||||
|
||||
If you have enabled any additional repositories such as [geerlingguy.repo-epel](https://github.com/geerlingguy/ansible-role-repo-epel) or [geerlingguy.repo-remi](https://github.com/geerlingguy/ansible-role-repo-remi), you may want an easy way to swap PHP versions on the fly. By default, this is set to `"present"`. You can override this variable to `"latest"` to upgrade to the latest available version. Combined with php_enablerepo`, a user now doesn't need to manually uninstall the existing PHP packages before installing them from a different repository.
|
||||
If you have enabled any additional repositories such as [geerlingguy.repo-epel](https://github.com/geerlingguy/ansible-role-repo-epel) or [geerlingguy.repo-remi](https://github.com/geerlingguy/ansible-role-repo-remi), you may want an easy way to swap PHP versions on the fly. By default, this is set to `"present"`. You can override this variable to `"latest"` to upgrade to the latest available version. Combined with `php_enablerepo`, a user now doesn't need to manually uninstall the existing PHP packages before installing them from a different repository.
|
||||
|
||||
You can also use the [`geerlingguy.php-versions`](https://galaxy.ansible.com/geerlingguy/php-versions/) role to more easily switch between major PHP versions (e.g. 5.6, 7.0, 7.1, 7.2).
|
||||
|
||||
php_install_recommends: yes
|
||||
php_install_recommends: true
|
||||
|
||||
(Debian/Ubuntu only) Whether to install recommended packages when installing `php_packages`; you might want to set this to `no` explicitly if you're installing a PPA that recommends certain packages you don't want (e.g. Ondrej's `php` PPA will install `php7.0-cli` if you install `php-pear` alongside `php5.6-cli`... which is often not desired!).
|
||||
|
||||
@ -73,6 +77,8 @@ Specific settings inside the default `www.conf` PHP-FPM pool. If you'd like to m
|
||||
|
||||
By default, all the extra defaults below are applied through the php.ini included with this role. You can self-manage your php.ini file (if you need more flexility in its configuration) by setting this to `false` (in which case all the below variables will be ignored).
|
||||
|
||||
php_fpm_pool_user: "[apache|nginx|other]" # default varies by OS
|
||||
php_fpm_pool_group: "[apache|nginx|other]" # default varies by OS
|
||||
php_memory_limit: "256M"
|
||||
php_max_execution_time: "60"
|
||||
php_max_input_time: "60"
|
||||
|
@ -3,12 +3,15 @@
|
||||
# for RHEL/CentOS.
|
||||
php_enablerepo: ""
|
||||
|
||||
# Default PHP version to install on Debian-based OSes.
|
||||
php_default_version_debian: "7.0"
|
||||
|
||||
# PHP package state; use 'present' to make sure it's installed, or 'latest' if
|
||||
# you want to upgrade or switch versions using a new repo.
|
||||
php_packages_state: present
|
||||
|
||||
# Whether to install recommended packages. Used only for Debian/Ubuntu.
|
||||
php_install_recommends: yes
|
||||
php_install_recommends: true
|
||||
|
||||
# Set this to false if you're not using PHP with Apache/Nginx/etc.
|
||||
php_enable_webserver: true
|
||||
|
@ -6,12 +6,13 @@ galaxy_info:
|
||||
description: PHP for RedHat/CentOS/Fedora/Debian/Ubuntu.
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "license (BSD, MIT)"
|
||||
min_ansible_version: 2.0
|
||||
min_ansible_version: 2.4
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
- name: Fedora
|
||||
versions:
|
||||
- all
|
||||
@ -22,6 +23,7 @@ galaxy_info:
|
||||
versions:
|
||||
- trusty
|
||||
- xenial
|
||||
- bionic
|
||||
galaxy_tags:
|
||||
- development
|
||||
- web
|
||||
|
@ -1,20 +1,33 @@
|
||||
---
|
||||
- hosts: all
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_enable_php_fpm: true
|
||||
php_memory_limit: "192M"
|
||||
php_enablerepo: "remi,remi-php70"
|
||||
php_install_recommends: no
|
||||
php_install_recommends: false
|
||||
|
||||
handlers:
|
||||
- name: update apt cache
|
||||
apt: update_cache=true
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
# Ubuntu-specific tasks.
|
||||
- name: Ensure dirmngr is installed (gnupg dependency).
|
||||
apt:
|
||||
name: dirmngr
|
||||
state: present
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Add repository for PHP 7.
|
||||
apt_repository: repo='ppa:ondrej/php'
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
@ -22,10 +35,10 @@
|
||||
# Debian-specific tasks.
|
||||
- name: Add dependencies for PHP versions (Debian).
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
state: present
|
||||
when: ansible_distribution == "Debian"
|
||||
|
||||
- name: Add Ondrej Sury's apt key (Debian).
|
||||
@ -38,14 +51,19 @@
|
||||
apt_repository:
|
||||
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
|
||||
state: present
|
||||
register: php_ondrej_debian_repo
|
||||
when: ansible_distribution == "Debian"
|
||||
notify: update apt cache
|
||||
|
||||
- name: Update apt caches after repo is added (Debian).
|
||||
apt: update_cache=yes
|
||||
when: php_ondrej_debian_repo.changed and (ansible_distribution == "Debian")
|
||||
- meta: flush_handlers
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.repo-remi
|
||||
when: ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora'
|
||||
- role_under_test
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_distribution != 'Fedora'
|
||||
- role: geerlingguy.php
|
||||
|
||||
post_tasks:
|
||||
- name: Confirm PHP configuration is correct.
|
||||
shell: php -i | grep 'memory_limit.*192'
|
||||
changed_when: false
|
21
molecule/default/molecule.yml
Normal file
21
molecule/default/molecule.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
set -e
|
||||
yamllint .
|
||||
ansible-lint
|
||||
platforms:
|
||||
- name: instance
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
32
molecule/default/playbook-source.yml
Normal file
32
molecule/default/playbook-source.yml
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_install_from_source: true
|
||||
php_source_clone_dir: /root/php-src
|
||||
php_source_make_command: "make --jobs=2"
|
||||
php_version: "7.1.17"
|
||||
php_source_version: "php-{{ php_version }}"
|
||||
php_memory_limit: "192M"
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.git
|
||||
- role: geerlingguy.php
|
||||
|
||||
post_tasks:
|
||||
- name: Confirm PHP configuration is correct.
|
||||
shell: php -i | grep 'memory_limit.*192'
|
||||
changed_when: false
|
||||
|
||||
- name: Check the installed PHP version.
|
||||
shell: '/usr/bin/php --version | grep -qF "PHP {{ php_version }}"'
|
||||
changed_when: false
|
@ -22,7 +22,7 @@
|
||||
dest: "{{ item }}/{{ php_apc_conf_filename }}"
|
||||
owner: root
|
||||
group: root
|
||||
force: yes
|
||||
force: true
|
||||
mode: 0644
|
||||
with_items: "{{ php_extension_conf_paths }}"
|
||||
when: php_enable_apc
|
||||
|
@ -40,7 +40,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
force: no
|
||||
force: false
|
||||
when: php_enable_php_fpm
|
||||
|
||||
- name: Configure php-fpm pool (if enabled).
|
||||
@ -73,7 +73,7 @@
|
||||
service:
|
||||
name: "{{ php_fpm_daemon }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
enabled: true
|
||||
when: php_enable_php_fpm and ansible_distribution != "Debian"
|
||||
|
||||
# See: https://github.com/ansible/ansible/issues/22303
|
||||
@ -81,6 +81,6 @@
|
||||
service:
|
||||
name: "{{ php_fpm_daemon }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
enabled: true
|
||||
use: service
|
||||
when: php_enable_php_fpm and ansible_distribution == "Debian"
|
||||
|
@ -22,10 +22,10 @@
|
||||
dest: "{{ item }}/{{ php_opcache_conf_filename }}"
|
||||
owner: root
|
||||
group: root
|
||||
force: yes
|
||||
force: true
|
||||
mode: 0644
|
||||
with_items: "{{ php_extension_conf_paths }}"
|
||||
when: php_opcache_enable
|
||||
when: php_opcache_enable | bool
|
||||
notify: restart webserver
|
||||
|
||||
- name: Remove OpCache config file if OpCache is disabled.
|
||||
@ -33,5 +33,5 @@
|
||||
path: "{{ item }}/{{ php_opcache_conf_filename }}"
|
||||
state: absent
|
||||
with_items: "{{ php_extension_conf_paths }}"
|
||||
when: not php_opcache_enable
|
||||
when: not php_opcache_enable | bool
|
||||
notify: restart webserver
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Ensure dependencies for building from source are installed (RedHat).
|
||||
package: "name={{ item }} state=present"
|
||||
with_items:
|
||||
package:
|
||||
name:
|
||||
- autoconf
|
||||
- automake
|
||||
- libtool
|
||||
@ -23,6 +23,7 @@
|
||||
- libicu-devel
|
||||
- mariadb-devel
|
||||
- gmp-devel
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Update apt cache (Debian).
|
||||
@ -30,8 +31,8 @@
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Ensure dependencies for building from source are installed (Debian).
|
||||
apt: "pkg={{ item }} state=present"
|
||||
with_items:
|
||||
apt:
|
||||
name:
|
||||
- build-essential
|
||||
- autoconf
|
||||
- automake
|
||||
@ -43,7 +44,7 @@
|
||||
- libcurl4-openssl-dev
|
||||
- libbz2-dev
|
||||
- libjpeg-dev
|
||||
- libpng12-dev
|
||||
- libpng-dev
|
||||
- libxpm-dev
|
||||
- libfreetype6-dev
|
||||
- libgmp3-dev
|
||||
@ -52,6 +53,7 @@
|
||||
- libpspell-dev
|
||||
- librecode-dev
|
||||
- libssl-dev
|
||||
state: present
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Define php_fpm_daemon (if not defined already).
|
||||
@ -68,7 +70,7 @@
|
||||
src: "{{ php_source_install_gmp_path }}"
|
||||
dest: /usr/include/gmp.h
|
||||
state: link
|
||||
when: gmp_file.stat.exists == false
|
||||
when: not gmp_file.stat.exists
|
||||
|
||||
- name: Check if PHP is installed.
|
||||
command: which php
|
||||
@ -81,7 +83,7 @@
|
||||
repo: "{{ php_source_repo }}"
|
||||
dest: "{{ php_source_clone_dir }}"
|
||||
version: "{{ php_source_version }}"
|
||||
accept_hostkey: yes
|
||||
accept_hostkey: true
|
||||
depth: "{{ php_source_clone_depth }}"
|
||||
when: php_installed.rc != 0
|
||||
|
||||
@ -93,19 +95,19 @@
|
||||
when: php_installed.rc != 0
|
||||
|
||||
- name: Build configure script.
|
||||
shell: >
|
||||
command: >
|
||||
./buildconf --force
|
||||
chdir={{ php_source_clone_dir }}
|
||||
when: php_installed.rc != 0
|
||||
|
||||
- name: Run configure script.
|
||||
shell: >
|
||||
command: >
|
||||
{{ php_source_configure_command }}
|
||||
chdir={{ php_source_clone_dir }}
|
||||
when: php_installed.rc != 0
|
||||
|
||||
- name: Make and install PHP.
|
||||
shell: >
|
||||
command: >
|
||||
{{ item }}
|
||||
chdir={{ php_source_clone_dir }}
|
||||
with_items:
|
||||
|
@ -49,25 +49,22 @@
|
||||
when: php_fpm_conf_path is not defined
|
||||
|
||||
# Setup/install tasks.
|
||||
- include: setup-RedHat.yml
|
||||
when: (php_install_from_source == false) and (ansible_os_family == 'RedHat')
|
||||
static: no
|
||||
- include_tasks: setup-RedHat.yml
|
||||
when:
|
||||
- not php_install_from_source
|
||||
- ansible_os_family == 'RedHat'
|
||||
|
||||
- include: setup-Debian.yml
|
||||
when: (php_install_from_source == false) and (ansible_os_family == 'Debian')
|
||||
static: no
|
||||
- include_tasks: setup-Debian.yml
|
||||
when:
|
||||
- not php_install_from_source
|
||||
- ansible_os_family == 'Debian'
|
||||
|
||||
# Install PHP from source when php_install_from_source is true.
|
||||
- include: install-from-source.yml
|
||||
when: php_install_from_source == true
|
||||
static: no
|
||||
- include_tasks: install-from-source.yml
|
||||
when: php_install_from_source
|
||||
|
||||
# Configure PHP.
|
||||
- include: configure.yml
|
||||
static: no
|
||||
- include: configure-apcu.yml
|
||||
static: no
|
||||
- include: configure-opcache.yml
|
||||
static: no
|
||||
- include: configure-fpm.yml
|
||||
static: no
|
||||
- include_tasks: configure.yml
|
||||
- include_tasks: configure-apcu.yml
|
||||
- include_tasks: configure-opcache.yml
|
||||
- include_tasks: configure-fpm.yml
|
||||
|
@ -4,10 +4,9 @@
|
||||
|
||||
- name: Ensure PHP packages are installed.
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
name: "{{ php_packages }}"
|
||||
state: "{{ php_packages_state }}"
|
||||
install_recommends: "{{ php_install_recommends }}"
|
||||
with_items: "{{ php_packages }}"
|
||||
register: php_package_install
|
||||
notify: restart webserver
|
||||
|
||||
@ -24,5 +23,5 @@
|
||||
path: "{{ item }}/{{ php_opcache_conf_filename }}"
|
||||
state: absent
|
||||
with_items: "{{ php_extension_conf_paths }}"
|
||||
when: php_opcache_enable and php_package_install.changed
|
||||
when: php_opcache_enable | bool and php_package_install.changed
|
||||
notify: restart webserver
|
||||
|
@ -1,8 +1,7 @@
|
||||
---
|
||||
- name: Ensure PHP packages are installed.
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: "{{ php_packages }}"
|
||||
state: "{{ php_packages_state }}"
|
||||
enablerepo: "{{ php_enablerepo }}"
|
||||
with_items: "{{ php_packages }}"
|
||||
enablerepo: "{{ php_enablerepo | default(omit, true) }}"
|
||||
notify: restart webserver
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
engine = On
|
||||
short_open_tag = {{ php_short_open_tag }}
|
||||
asp_tags = Off
|
||||
precision = {{ php_precision }}
|
||||
output_buffering = {{ php_output_buffering }}
|
||||
|
||||
@ -64,7 +63,6 @@ auto_prepend_file =
|
||||
auto_append_file =
|
||||
|
||||
default_mimetype = "text/html"
|
||||
always_populate_raw_post_data = -1
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; Paths and Directories ;
|
||||
@ -189,8 +187,6 @@ session.gc_probability = {{ php_session_gc_probability }}
|
||||
session.gc_divisor = {{ php_session_gc_divisor }}
|
||||
session.gc_maxlifetime = {{ php_session_gc_maxlifetime }}
|
||||
|
||||
session.bug_compat_42 = Off
|
||||
session.bug_compat_warn = Off
|
||||
session.referer_check =
|
||||
|
||||
session.cache_limiter = nocache
|
||||
|
@ -1,11 +0,0 @@
|
||||
# Ansible Role tests
|
||||
|
||||
To run the test playbook(s) in this directory:
|
||||
|
||||
1. Install and start Docker.
|
||||
1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`:
|
||||
- `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/`
|
||||
1. Make the test shim executable: `chmod +x tests/test.sh`.
|
||||
1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh`
|
||||
|
||||
If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
- hosts: all
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_install_from_source: true
|
||||
php_source_clone_dir: /root/php-src
|
||||
php_source_make_command: "make --jobs=2"
|
||||
php_source_version: "php-7.1.9"
|
||||
php_memory_limit: "192M"
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
roles:
|
||||
- geerlingguy.git
|
||||
- role_under_test
|
@ -1,36 +1,36 @@
|
||||
---
|
||||
__php_packages:
|
||||
- php7.0-common
|
||||
- php7.0-cli
|
||||
- php7.0-dev
|
||||
- php7.0-fpm
|
||||
- php{{ php_default_version_debian }}-common
|
||||
- php{{ php_default_version_debian }}-cli
|
||||
- php{{ php_default_version_debian }}-dev
|
||||
- php{{ php_default_version_debian }}-fpm
|
||||
- libpcre3-dev
|
||||
- php7.0-gd
|
||||
- php7.0-curl
|
||||
- php7.0-imap
|
||||
- php7.0-json
|
||||
- php7.0-opcache
|
||||
- php7.0-xml
|
||||
- php7.0-mbstring
|
||||
- php{{ php_default_version_debian }}-gd
|
||||
- php{{ php_default_version_debian }}-curl
|
||||
- php{{ php_default_version_debian }}-imap
|
||||
- php{{ php_default_version_debian }}-json
|
||||
- php{{ php_default_version_debian }}-opcache
|
||||
- php{{ php_default_version_debian }}-xml
|
||||
- php{{ php_default_version_debian }}-mbstring
|
||||
- php-sqlite3
|
||||
- php-apcu
|
||||
__php_webserver_daemon: "apache2"
|
||||
|
||||
# Vendor-specific configuration paths on Debian/Ubuntu make my brain asplode.
|
||||
__php_conf_paths:
|
||||
- /etc/php/7.0/fpm
|
||||
- /etc/php/7.0/apache2
|
||||
- /etc/php/7.0/cli
|
||||
- /etc/php/{{ php_default_version_debian }}/fpm
|
||||
- /etc/php/{{ php_default_version_debian }}/apache2
|
||||
- /etc/php/{{ php_default_version_debian }}/cli
|
||||
|
||||
__php_extension_conf_paths:
|
||||
- /etc/php/7.0/fpm/conf.d
|
||||
- /etc/php/7.0/apache2/conf.d
|
||||
- /etc/php/7.0/cli/conf.d
|
||||
- /etc/php/{{ php_default_version_debian }}/fpm/conf.d
|
||||
- /etc/php/{{ php_default_version_debian }}/apache2/conf.d
|
||||
- /etc/php/{{ php_default_version_debian }}/cli/conf.d
|
||||
|
||||
__php_apc_conf_filename: 20-apcu.ini
|
||||
__php_opcache_conf_filename: 10-opcache.ini
|
||||
__php_fpm_daemon: php7.0-fpm
|
||||
__php_fpm_conf_path: "/etc/php/7.0/fpm"
|
||||
__php_fpm_daemon: php{{ php_default_version_debian }}-fpm
|
||||
__php_fpm_conf_path: "/etc/php/{{ php_default_version_debian }}/fpm"
|
||||
__php_fpm_pool_conf_path: "{{ __php_fpm_conf_path }}/pool.d/www.conf"
|
||||
|
||||
__php_fpm_pool_user: www-data
|
||||
|
@ -6,7 +6,6 @@ __php_packages:
|
||||
- php-devel
|
||||
- php-fpm
|
||||
- php-gd
|
||||
- php-imap
|
||||
- php-ldap
|
||||
- php-mbstring
|
||||
- php-opcache
|
||||
|
Loading…
Reference in New Issue
Block a user