Skip to content

Commit

Permalink
Merge branch 'release/1.3.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
chusiang committed Jun 22, 2017
2 parents f167525 + 7a00d5f commit dbe6179
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ debian_php7_apt_repo: "http://packages.dotdeb.org"
debian_php7_apt_key: "https://www.dotdeb.org/dotdeb.gpg"
ubuntu_php7_ppa_repo: "ppa:ondrej/php"
# A switch for use official apt repository.
#
# true: use the official repository.
# false: use the third-party repository.
apt_php_official_repo: false
apt_php_version: "7.0"
#apt_php_version: "7.1"
Expand Down Expand Up @@ -130,6 +136,8 @@ centos_nginx_fastcgi_server: "unix:{{ centos_php_fastcgi_listen }}"
* `/etc/php.ini`
* Socket: `/run/php-fpm/www.sock`

1. We add `apt_php_official_repo `variable for enable or disable the third-party repository (after v1.3.6).

## Dependencies

None.
Expand All @@ -142,7 +150,7 @@ None.
roles:
- { role: chusiang.php7 }

## Docker Container
## Docker Containers

This repository contains Dockerized [Ansible](https://github.com/ansible/ansible), published to the public [Docker Hub](https://hub.docker.com/) via **automated build** mechanism.

Expand Down Expand Up @@ -170,3 +178,4 @@ MIT License (2015 - 2017). See the [LICENSE file](LICENSE) for details.

1. [itcraftsmanpl (Arkadiusz Kondas)](http://itcraftsman.pl/)
1. [chusiang (Chu-Siang Lai)](http://note.drx.tw)

6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ debian_php7_apt_repo: "http://packages.dotdeb.org"
debian_php7_apt_key: "https://www.dotdeb.org/dotdeb.gpg"
ubuntu_php7_ppa_repo: "ppa:ondrej/php"

# A switch for enable or disable the third-party repository.
#
# true: use the official repository.
# false: use the third-party repository.
apt_php_official_repo: false

apt_php_version: "7.0"
#apt_php_version: "7.1"

Expand Down
45 changes: 25 additions & 20 deletions tasks/use-apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,43 @@
---

# before install.
- name: install requires package for use apt module
- name: Install requires package for apt module
become: true
apt: name=python-apt state=present

- name: Add third-party repository for Debian
become: true
apt_repository: >
repo="deb {{ debian_php7_apt_repo }} {{ ansible_distribution_release }} all"
state=present
when:
- ansible_distribution|lower == "debian"
- ansible_distribution_major_version < "9"
- block:

- 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"
- name: Add third-party repository on Debian
become: true
apt_repository: >
repo="deb {{ debian_php7_apt_repo }} {{ ansible_distribution_release }} all"
state=present
when:
- ansible_distribution|lower == "debian"
- ansible_distribution_major_version < "9"

- name: Add apt key on Debian
become: true
apt_key: url={{ debian_php7_apt_key }} state=present
when:
- ansible_distribution|lower == "debian"
- ansible_distribution_major_version < "9"

- name: Add third-party repository on Ubuntu
become: true
apt_repository: repo={{ ubuntu_php7_ppa_repo }}
when:
- ansible_distribution|lower == "ubuntu"

- name: Add third-party repository for Ubuntu
become: true
apt_repository: repo={{ ubuntu_php7_ppa_repo }}
when: ansible_distribution|lower == "ubuntu"
when: apt_php_official_repo == false

# Update apt cache.
- name: Update apt cache
become: true
apt: update_cache=true

# Install PHP7 packages.
- name: Install PHP Packages
- name: Install php packages
become: true
apt: name={{ item }} state=present
with_nested: "{{ apt_php_packages }}"
Expand Down

0 comments on commit dbe6179

Please sign in to comment.