Manages Debian 11 and prepares Travis

new_release
Emilien Mantel 2021-08-31 10:34:50 +02:00
parent 3209f6b010
commit 99f4da524b
6 changed files with 76 additions and 53 deletions

View File

@ -1,33 +1,37 @@
env: env:
- PLATFORM='docker-debian-stretch-php70' ANSIBLE_VERSION='ansible>=2.6,<2.7' global:
- PLATFORM='docker-debian-buster-php73' ANSIBLE_VERSION='ansible>=2.6,<2.7' - VAGRANT_VERSION='2.2.18'
- PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.6,<2.7' jobs:
- PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.6,<2.7' - PLATFORM='docker-debian-stretch-php70' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.6,<2.7' - PLATFORM='docker-debian-stretch-php74' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-debian-stretch-php70' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-debian-buster-php73' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-debian-stretch-php74' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-debian-bullseye-php74' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-debian-buster-php73' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-debian-bullseye-php80' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-debian-buster-php74' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-debian-buster-php74' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.7,<2.8' - PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.7,<2.8'
sudo: required os:
- linux
dist: trusty dist: focal
language: python language: python
python: 2.7 python:
- 3.8
services: services:
- docker - docker
before_install: before_install:
- wget https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb - sudo apt-get -q update
- sudo dpkg -i vagrant_2.0.1_x86_64.deb - sudo apt-get install -y yamllint
- sudo wget -nv https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
- sudo dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
install: install:
- pip install "$ANSIBLE_VERSION" - sudo pip install "ansible-core$ANSIBLE_VERSION"
- sudo pip install ansible-lint
- ansible-galaxy collection install ansible.posix community.general
script: script:
- VAGRANT_DEFAULT_PROVIDER=docker vagrant up $PLATFORM - VAGRANT_DEFAULT_PROVIDER=docker vagrant up $PLATFORM
@ -37,6 +41,14 @@ script:
&& (echo 'Idempotence test: pass' && exit 0) && (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1) || (echo 'Idempotence test: fail' && exit 1)
- VAGRANT_DEFAULT_PROVIDER=docker vagrant status - VAGRANT_DEFAULT_PROVIDER=docker vagrant status
- >
yamllint .
&& (echo 'YAML lint test: pass' && exit 0)
|| (echo 'YAML lint test: fail' && exit 1)
- >
ansible-lint -v tests/test.yml
&& (echo 'Ansible lint test: pass' && exit 0)
|| (echo 'Ansible lint test: fail' && exit 1)
notifications: notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/ webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -8,14 +8,16 @@ Install PHP on Debian / Ubuntu / FreeBSD. Manage PHP-FPM, APCu, Opcache and Xdeb
Managed OS / Versions Managed OS / Versions
--------------------- ---------------------
| OS | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | On all Debian versions, you can install all PHP versions (from PHP 5.6 to 8.1 beta) by using [Sury's APT repository](https://deb.sury.org/).
|:---------------------:|:-------------------:|:--------------------------:|:--------------------------:|:-------------------------:|:--------------------------:
| Debian Stretch (9) | :heavy_check_mark: | :heavy_check_mark: (Sury) | :heavy_check_mark: (Sury) | :heavy_check_mark: (Sury) | :heavy_check_mark: (Sury) | Other cases:
| Debian Buster (10) | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: (Sury) |
| Ubuntu Xenial (16.04) | :heavy_check_mark: | :x: | :x: | :x: | :x: | | OS | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP >= 7.4 |
| Ubuntu Bionic (18.04) | :x: | :x: | :heavy_check_mark: | :x: | :x: | |:---------------------:|:-------------------:|:--------------------:|:--------------------:|:--------------------:|:--------------------:
| FreeBSD 11 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Need tests... | | Ubuntu Xenial (16.04) | :heavy_check_mark: | :x: | :x: | :x: | :x: |
| FreeBSD 12 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Need tests... | | Ubuntu Bionic (18.04) | :x: | :x: | :heavy_check_mark: | :x: | :x: |
| FreeBSD 11 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Need tests... |
| FreeBSD 12 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Need tests... |
Links: Links:
- [Sury](https://deb.sury.org/) - [Sury](https://deb.sury.org/)
@ -160,12 +162,12 @@ Example Playbook
roles: roles:
- { role: HanXHX.php } - { role: HanXHX.php }
### Debian Stretch with PHP 7.2 CLI (no FPM) ### Debian Bullseye with PHP 8.0 CLI (no FPM)
- hosts: servers - hosts: servers
roles: roles:
- { role: HanXHX.sury } - { role: HanXHX.sury }
- { role: HanXHX.php, php_version: '7.2', php_install_fpm: false } - { role: HanXHX.php, php_version: '8.0', php_install_fpm: false }
License License
------- -------

46
Vagrantfile vendored
View File

@ -6,15 +6,14 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
vms_debian = [ vms_debian = [
{ :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { }}, { :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { }},
{ :name => "debian-stretch-php71", :box => "debian/stretch64", :vars => { "php_version": '7.1' }}, { :name => "debian-stretch-php74", :box => "debian/stretch64", :vars => { "php_version": '7.4' }},
{ :name => "debian-stretch-php72", :box => "debian/stretch64", :vars => { "php_version": '7.2' }}, { :name => "debian-buster-php73", :box => "debian/buster64", :vars => { }},
{ :name => "debian-stretch-php73", :box => "debian/stretch64", :vars => { "php_version": '7.3' }}, { :name => "debian-buster-php74", :box => "debian/buster64", :vars => { "php_version": '7.4' }},
{ :name => "debian-stretch-php74", :box => "debian/stretch64", :vars => { "php_version": '7.4' }}, { :name => "debian-bullseye-php74", :box => "debian/bullseye64", :vars => { }},
{ :name => "debian-buster-php73", :box => "debian/buster64", :vars => { }}, { :name => "debian-bullseye-php80", :box => "debian/bullseye64", :vars => { "php_version": '8.0' }},
{ :name => "debian-buster-php74", :box => "debian/buster64", :vars => { "php_version": '7.4' }}, { :name => "ubuntu-xenial-php70", :box => "ubuntu/xenial64", :vars => { }},
{ :name => "ubuntu-xenial-php70", :box => "ubuntu/xenial64", :vars => { }}, { :name => "ubuntu-bionic-php72", :box => "ubuntu/bionic64", :vars => { }},
{ :name => "ubuntu-bionic-php72", :box => "ubuntu/bionic64", :vars => { }},
] ]
vms_freebsd = [ vms_freebsd = [
@ -23,15 +22,14 @@ Vagrant.configure("2") do |config|
] ]
conts = [ conts = [
{ :name => "docker-debian-stretch-php70", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { }}, { :name => "docker-debian-stretch-php70", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { }},
{ :name => "docker-debian-stretch-php71", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.1' }}, { :name => "docker-debian-stretch-php74", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.4' }},
{ :name => "docker-debian-stretch-php72", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.2' }}, { :name => "docker-debian-buster-php73", :docker => "hanxhx/vagrant-ansible:debian10", :vars => { }},
{ :name => "docker-debian-stretch-php73", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.3' }}, { :name => "docker-debian-buster-php74", :docker => "hanxhx/vagrant-ansible:debian10", :vars => { "php_version": '7.4' }},
{ :name => "docker-debian-stretch-php74", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.4' }}, { :name => "docker-debian-bullseye-php74", :docker => "hanxhx/vagrant-ansible:debian11", :vars => { }},
{ :name => "docker-debian-buster-php73", :docker => "hanxhx/vagrant-ansible:debian10", :vars => { }}, { :name => "docker-debian-bullseye-php80", :docker => "hanxhx/vagrant-ansible:debian11", :vars => { "php_version": '8.0' }},
{ :name => "docker-debian-buster-php74", :docker => "hanxhx/vagrant-ansible:debian10", :vars => { "php_version": '7.4' }}, { :name => "docker-ubuntu-xenial-php70", :docker => "hanxhx/vagrant-ansible:ubuntu16.04", :vars => { }},
{ :name => "docker-ubuntu-xenial-php70", :docker => "hanxhx/vagrant-ansible:ubuntu16.04", :vars => { }}, { :name => "docker-ubuntu-bionic-php72", :docker => "hanxhx/vagrant-ansible:ubuntu18.04", :vars => { }},
{ :name => "docker-ubuntu-bionic-php72", :docker => "hanxhx/vagrant-ansible:ubuntu18.04", :vars => { }},
] ]
config.vm.network "private_network", type: "dhcp" config.vm.network "private_network", type: "dhcp"
@ -43,7 +41,12 @@ Vagrant.configure("2") do |config|
d.remains_running = true d.remains_running = true
d.has_ssh = true d.has_ssh = true
end end
m.vm.provision "shell", inline: "apt-get update && apt-get install -y python python-apt"
if opts[:name].include? "bullseye"
m.vm.provision "shell", inline: "[ -f '/root/first_provision' ] || (apt-get update -qq && apt-get -y dist-upgrade && touch /root/first_provision)"
end
#m.vm.provision "shell", inline: "apt-get update && apt-get install -y python python-apt"
m.vm.provision "ansible" do |ansible| m.vm.provision "ansible" do |ansible|
ansible.playbook = "tests/test.yml" ansible.playbook = "tests/test.yml"
ansible.verbose = 'vv' ansible.verbose = 'vv'
@ -61,6 +64,11 @@ Vagrant.configure("2") do |config|
v.memory = 256 v.memory = 256
end end
m.vm.provision "shell", inline: "apt-get update && apt-get install -y ifupdown python" m.vm.provision "shell", inline: "apt-get update && apt-get install -y ifupdown python"
if opts[:name].include? "bullseye"
m.vm.provision "shell", inline: "[ -f '/root/first_provision' ] || (apt-get update -qq && apt-get -y dist-upgrade && touch /root/first_provision)"
end
m.vm.provision "ansible" do |ansible| m.vm.provision "ansible" do |ansible|
ansible.playbook = "tests/test.yml" ansible.playbook = "tests/test.yml"
ansible.verbose = 'vv' ansible.verbose = 'vv'

View File

@ -1,15 +1,16 @@
--- ---
galaxy_info: galaxy_info:
author: Emilien Mantel author: Emilien Mantel
description: Install and configure PHP 7.0/7.1/7.2/7.3 description: Install and configure PHP 7.0/7.1/7.2/7.3/7.4/8.0
company: company:
license: GPLv2 license: GPLv2
min_ansible_version: 2.6 min_ansible_version: 2.11
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- stretch - stretch
- buster - buster
- bullseye
- name: Ubuntu - name: Ubuntu
versions: versions:
- xenial - xenial

View File

@ -14,12 +14,11 @@
- apt-transport-https - apt-transport-https
- ca-certificates - ca-certificates
- curl - curl
- gpg
- lsb-release - lsb-release
- nginx - nginx
- vim - vim
- name: INCLUDE_TASKS | Sury - name: INCLUDE_TASKS | Sury
include_tasks: Debian/sury.yml include_tasks: Debian/sury.yml
when: when: php_version != php_default_version
((ansible_distribution_major_version is version('9', 'eq')) and (php_version is version('7.1', 'ge'))) or
((ansible_distribution_major_version is version('10', 'eq')) and (php_version is version('7.4', 'ge')))

View File

@ -0,0 +1 @@
php_default_version: '7.4'