From 47423f5d72c893d46ec532faf3a3904789e6b5cf Mon Sep 17 00:00:00 2001 From: Chu-Siang Lai Date: Wed, 21 Jun 2017 23:29:03 +0800 Subject: [PATCH 1/2] support the debian 9 (stretch) #17 --- README.md | 4 ++-- Vagrantfile | 10 ++++++++++ meta/main.yml | 3 ++- tasks/use-apt.yml | 8 ++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 85abccd..c2c58d2 100644 --- a/README.md +++ b/README.md @@ -142,8 +142,8 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible ### Images -* chusiang/php7:ubuntu14.04 (lastest) -* chusiang/php7:centos6 +* `chusiang/php7:ubuntu14.04` (lastest) +* `chusiang/php7:centos6` ### Usage diff --git a/Vagrantfile b/Vagrantfile index 16ead03..d9adffe 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -31,6 +31,16 @@ Vagrant.configure("2") do |config| end end + # Debian 9 + config.vm.define "debian9" do |node| + node.vm.box = "debian/stretch64" + node.vm.hostname = "debian9.php7.local" + node.vm.provision "ansible" do |ansible| + ansible.playbook = "setup.yml" + ansible.sudo = true + end + end + # CentOS 6.7 config.vm.define "centos6" do |node| node.vm.box = "bento/centos-6.7" diff --git a/meta/main.yml b/meta/main.yml index 4471aa4..e2f4c39 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -2,7 +2,7 @@ galaxy_info: author: chusiang - description: Deploy PHP 7 (php-fpm) for nginx on Ubuntu and CentOS. (forked from itcraftsmanpl.php7) + description: Deploy PHP 7 (php-fpm) for nginx on Ubuntu, Debian and CentOS. (forked from itcraftsmanpl.php7) license: MIT min_ansible_version: 1.9 platforms: @@ -12,6 +12,7 @@ galaxy_info: - name: Debian versions: - jessie + - stretch - name: EL versions: - 6 diff --git a/tasks/use-apt.yml b/tasks/use-apt.yml index 5e155e7..9f84afa 100644 --- a/tasks/use-apt.yml +++ b/tasks/use-apt.yml @@ -11,12 +11,16 @@ apt_repository: > repo="deb {{ debian_php7_apt_repo }} {{ ansible_distribution_release }} all" state=present - when: ansible_distribution|lower == "debian" + when: + - ansible_distribution|lower == "debian" + - ansible_distribution_major_version < 9 - name: Add apt key for Debian become: true apt_key: url={{ debian_php7_apt_key }} state=present - when: ansible_distribution|lower == "debian" + when: + - ansible_distribution|lower == "debian" + - ansible_distribution_major_version < 9 - name: Add third-party repository for Ubuntu become: true From d7d73771e3534dda05854933618a7cdafe756ae7 Mon Sep 17 00:00:00 2001 From: Chu-Siang Lai Date: Wed, 21 Jun 2017 23:59:51 +0800 Subject: [PATCH 2/2] [debian 8] fix syntax error for --- tasks/use-apt.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/use-apt.yml b/tasks/use-apt.yml index 9f84afa..75ad2d4 100644 --- a/tasks/use-apt.yml +++ b/tasks/use-apt.yml @@ -13,14 +13,14 @@ state=present when: - ansible_distribution|lower == "debian" - - ansible_distribution_major_version < 9 + - ansible_distribution_major_version < "9" - name: Add apt key for Debian become: true apt_key: url={{ debian_php7_apt_key }} state=present when: - ansible_distribution|lower == "debian" - - ansible_distribution_major_version < 9 + - ansible_distribution_major_version < "9" - name: Add third-party repository for Ubuntu become: true