Manage Ubuntu 16.04/18.04
							parent
							
								
									5878040e84
								
							
						
					
					
						commit
						e87d158424
					
				| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
.vagrant*
 | 
			
		||||
*.swp
 | 
			
		||||
*.retry
 | 
			
		||||
*.log
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,14 @@ env:
 | 
			
		|||
  - PLATFORM='docker-debian-stretch-php71' ANSIBLE_VERSION='ansible>=2.2,<2.3'
 | 
			
		||||
  - PLATFORM='docker-debian-stretch-php70' ANSIBLE_VERSION='ansible>=2.3,<2.4'
 | 
			
		||||
  - PLATFORM='docker-debian-stretch-php71' ANSIBLE_VERSION='ansible>=2.3,<2.4'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.0,<2.1'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.1,<2.2'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.2,<2.3'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-xenial-php70' ANSIBLE_VERSION='ansible>=2.3,<2.4'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.0,<2.1'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.1,<2.2'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.2,<2.3'
 | 
			
		||||
  - PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='ansible>=2.3,<2.4'
 | 
			
		||||
 | 
			
		||||
sudo: required
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
								
									
									
										
											18
										
									
									README.md
									
									
									
									
								
								
							
							
										
											18
										
									
									README.md
									
									
									
									
								| 
						 | 
				
			
			@ -1,16 +1,18 @@
 | 
			
		|||
Ansible PHP (+FPM) role for Debian
 | 
			
		||||
==================================
 | 
			
		||||
Ansible PHP (+FPM) role for Debian / Ubuntu
 | 
			
		||||
===========================================
 | 
			
		||||
 | 
			
		||||
[](https://galaxy.ansible.com/HanXHX/php) [](https://travis-ci.org/HanXHX/ansible-php)
 | 
			
		||||
 | 
			
		||||
Install PHP (php-fpm optional) on Debian. Manage APCu, Opcache, Xdebug.
 | 
			
		||||
Install PHP (php-fpm optional) on Debian / Ubuntu. Manage APCu, Opcache, Xdebug.
 | 
			
		||||
 | 
			
		||||
Managed OS / Versions
 | 
			
		||||
---------------------
 | 
			
		||||
 | 
			
		||||
|       OS      |   PHP 7.0    |    PHP 7.1    |    PHP 7.2   |
 | 
			
		||||
|:-------------:|:------------:|:-------------:|:------------:|
 | 
			
		||||
| Debian Strech | Yes          | Yes (Sury)    | Yes (Sury)   |
 | 
			
		||||
|         OS            |   PHP 7.0    |    PHP 7.1    |    PHP 7.2   |
 | 
			
		||||
|:---------------------:|:------------:|:-------------:|:------------:|
 | 
			
		||||
| Debian Strech (9)     | Yes          | Yes (Sury)    | Yes (Sury)   |
 | 
			
		||||
| Ubuntu Xenial (16.04) | Yes          | No            | No           |
 | 
			
		||||
| Ubuntu Bionic (18.04) | No           | No            | Yes          |
 | 
			
		||||
 | 
			
		||||
Links:
 | 
			
		||||
- [Dotdeb](https://www.dotdeb.org)
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +30,7 @@ You should look at [default vars](defaults/main.yml).
 | 
			
		|||
 | 
			
		||||
### Writable vars
 | 
			
		||||
 | 
			
		||||
- `php_version`: 7.0 (default on Stretch), 7.1, 7.2
 | 
			
		||||
- `php_version`: 7.0, 7.1, 7.2
 | 
			
		||||
- `php_install_fpm`: boolean, install and manage php-fpm (default is true)
 | 
			
		||||
- `php_install_xdebug`: boolean, install [Xdebug](http://xdebug.org)
 | 
			
		||||
- `php_extra_packages`: additional php packages to install (default is an empty list).
 | 
			
		||||
| 
						 | 
				
			
			@ -150,7 +152,7 @@ Example Playbook
 | 
			
		|||
      roles:
 | 
			
		||||
         - { role: HanXHX.php }
 | 
			
		||||
 | 
			
		||||
### Debian Jessie with PHP 7.2 CLI (no FPM)
 | 
			
		||||
### Debian Stretch with PHP 7.2 CLI (no FPM)
 | 
			
		||||
 | 
			
		||||
    - hosts: servers
 | 
			
		||||
      roles:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,13 +8,17 @@ Vagrant.configure("2") do |config|
 | 
			
		|||
  vms_debian = [
 | 
			
		||||
    { :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { }},
 | 
			
		||||
    { :name => "debian-stretch-php71", :box => "debian/stretch64", :vars => { "php_version": '7.1' }},
 | 
			
		||||
    { :name => "debian-stretch-php72", :box => "debian/stretch64", :vars => { "php_version": '7.2' }}
 | 
			
		||||
    { :name => "debian-stretch-php72", :box => "debian/stretch64", :vars => { "php_version": '7.2' }},
 | 
			
		||||
    { :name => "ubuntu-xenial-php70",  :box => "ubuntu/xenial64",  :vars => { }},
 | 
			
		||||
    { :name => "ubuntu-bionic-php72",  :box => "ubuntu/bionic64",  :vars => { }},
 | 
			
		||||
  ]
 | 
			
		||||
 | 
			
		||||
  conts = [
 | 
			
		||||
    { :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-php72", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.2' }}
 | 
			
		||||
    { :name => "docker-debian-stretch-php72", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.2' }},
 | 
			
		||||
    { :name => "docker-ubuntu-xenial-php70",  :docker => "hanxhx/vagrant-ansible:16.04",   :vars => { }},
 | 
			
		||||
    { :name => "docker-ubuntu-bionic-php72",  :docker => "hanxhx/vagrant-ansible:18.04",   :vars => { }},
 | 
			
		||||
  ]
 | 
			
		||||
 | 
			
		||||
  config.vm.network "private_network", type: "dhcp"
 | 
			
		||||
| 
						 | 
				
			
			@ -42,12 +46,13 @@ Vagrant.configure("2") do |config|
 | 
			
		|||
        v.cpus = 1
 | 
			
		||||
        v.memory = 256
 | 
			
		||||
      end
 | 
			
		||||
       m.vm.provision "ansible" do |ansible|
 | 
			
		||||
         ansible.playbook = "tests/test.yml"
 | 
			
		||||
         ansible.verbose = 'vv'
 | 
			
		||||
         ansible.become = true
 | 
			
		||||
          ansible.extra_vars = opts[:vars]
 | 
			
		||||
       end
 | 
			
		||||
      m.vm.provision "shell", inline: "apt-get update && apt-get install -y ifupdown python"
 | 
			
		||||
      m.vm.provision "ansible" do |ansible|
 | 
			
		||||
        ansible.playbook = "tests/test.yml"
 | 
			
		||||
        ansible.verbose = 'vv'
 | 
			
		||||
        ansible.become = true
 | 
			
		||||
        ansible.extra_vars = opts[:vars]
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,10 @@ galaxy_info:
 | 
			
		|||
  - name: Debian
 | 
			
		||||
    versions:
 | 
			
		||||
    - stretch
 | 
			
		||||
  - name: Ubuntu
 | 
			
		||||
    versions:
 | 
			
		||||
    - xenial
 | 
			
		||||
    - bionic
 | 
			
		||||
  galaxy_tags:
 | 
			
		||||
  - development
 | 
			
		||||
  - web
 | 
			
		||||
| 
						 | 
				
			
			@ -16,5 +20,6 @@ galaxy_info:
 | 
			
		|||
  - php-fpm
 | 
			
		||||
  - php7
 | 
			
		||||
  - debian
 | 
			
		||||
  - ubuntu
 | 
			
		||||
dependencies: []
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@
 | 
			
		|||
  include_vars: "OS_Family_{{ ansible_os_family }}.yml"
 | 
			
		||||
 | 
			
		||||
- name: INCLUDE_VARS | Related to OS version
 | 
			
		||||
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
 | 
			
		||||
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
 | 
			
		||||
 | 
			
		||||
- name: APT | Install PHP packages
 | 
			
		||||
  apt:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
php_default_version: '7.2'
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
php_default_version: '7.0'
 | 
			
		||||
		Loading…
	
		Reference in New Issue