Add all files needed to bring up VM and run agaric.com locally

This commit is contained in:
benjamin melançon 2018-08-20 10:45:20 -04:00
parent 52c8b60bac
commit 4d2bc0ee24
742 changed files with 24037 additions and 0 deletions

View file

@ -0,0 +1,2 @@
*.retry
tests/test.sh

View file

@ -0,0 +1,49 @@
---
services: docker
env:
global:
php_version: "7.1"
matrix:
# Default - PHP 7.1
- distro: centos7
- distro: centos6
- distro: debian8
- distro: ubuntu1604
- distro: ubuntu1404
# PHP 7.2
- distro: centos7
playbook: test-7.2.yml
php_version: "7.2"
- distro: centos6
playbook: test-7.2.yml
php_version: "7.2"
- distro: debian8
playbook: test-7.2.yml
php_version: "7.2"
- distro: ubuntu1604
playbook: test-7.2.yml
php_version: "7.2"
- distro: ubuntu1404
playbook: test-7.2.yml
php_version: "7.2"
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
# Run script to test PHP version.
- 'docker exec ${container_id} env TERM=xterm php -v | grep -F "${php_version}."'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 Jeff Geerling
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,43 @@
# Ansible Role: PHP Versions
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-versions.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-versions)
Allows different PHP versions to be installed when using the `geerlingguy.php` role (or a similar role). This role was originally built for [Drupal VM](https://www.drupalvm.com) but was released more generically so others could use an easier mechanism for switching PHP versions.
## Requirements
N/A
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
php_version: '7.1'
The PHP version to be installed. Any [currently-supported PHP major version](http://php.net/supported-versions.php) is a valid option (e.g. `5.6`, `7.0`, `7.1`, etc.
## Dependencies
- geerlingguy.php is a soft dependency as the `php_version` variable is required to be set.
- geerlingguy.repo-remi, if you're using CentOS or a Red Hat derivative.
## Example Playbook
- hosts: webservers
vars:
php_version: '7.1'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- geerlingguy.php-versions
- geerlingguy.php
## License
MIT / BSD
## Author Information
This role was created in 2017 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

View file

@ -0,0 +1,3 @@
---
# The PHP version to be installed.
php_version: '7.1'

View file

@ -0,0 +1,31 @@
---
dependencies: []
galaxy_info:
author: geerlingguy
description: Allows different PHP versions to be installed.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
issue_tracker_url: https://github.com/geerlingguy/drupal-vm/issues
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- all
- name: Debian
versions:
- all
- name: Ubuntu
versions:
- precise
- raring
- saucy
- trusty
- xenial
galaxy_tags:
- php
- web
- drupal
- vm
- magento
- wordpress

View file

@ -0,0 +1,37 @@
---
- name: Include OS-specific variables.
include_vars: "{{ item }}"
with_fileglob:
- "../vars/{{ ansible_os_family }}.yml"
- "../vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
- name: Define PHP variables.
set_fact: "{{ item.key }}={{ hostvars[inventory_hostname][item.value] }}"
when:
- hostvars[inventory_hostname][item.key] is undefined
- hostvars[inventory_hostname][item.value] is defined
with_dict:
php_conf_paths: __php_conf_paths
php_extension_conf_paths: __php_extension_conf_paths
php_fpm_daemon: __php_fpm_daemon
php_fpm_conf_path: __php_fpm_conf_path
php_fpm_pool_conf_path: __php_fpm_pool_conf_path
php_mysql_package: __php_mysql_package
php_redis_package: __php_redis_package
php_memcached_package: __php_memcached_package
php_pgsql_package: __php_pgsql_package
php_tideways_module_path: __php_tideways_module_path
php_uploadprogress_module_path: __php_uploadprogress_module_path
php_xdebug_module_path: __php_xdebug_module_path
php_xhprof_module_path: __php_xhprof_module_path
php_packages: __php_packages
# Setup tasks.
- include: "setup-{{ ansible_os_family }}.yml"
static: no
- name: Set the correct XHProf package when PHP 5.6 is used.
set_fact:
xhprof_download_url: https://github.com/phacility/xhprof/archive/master.tar.gz
xhprof_download_folder_name: xhprof-master
when: php_version == '5.6'

View file

@ -0,0 +1,52 @@
---
- name: Set the correct opcache filename (Ubuntu/Debian).
set_fact:
php_opcache_conf_filename: "10-opcache.ini"
- name: Add repository for PHP versions (Ubuntu).
apt_repository: repo='ppa:ondrej/php'
when: ansible_distribution == "Ubuntu"
- name: Add repository for PHP 5 compatibility packages (Ubuntu).
apt_repository: repo='ppa:ondrej/php5-compat'
when: php_version == "5.6" and ansible_distribution == "Ubuntu"
# Debian-specific tasks.
- name: Add dependencies for PHP versions (Debian).
apt:
name: "{{ item }}"
with_items:
- apt-transport-https
- ca-certificates
when: ansible_distribution == "Debian"
- name: Add Ondrej Sury's apt key (Debian).
apt_key:
url: https://packages.sury.org/php/apt.gpg
state: present
when: ansible_distribution == "Debian"
- name: Add Ondrej Sury's repo (Debian).
apt_repository:
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
state: present
register: php_ondrej_debian_repo
when: ansible_distribution == "Debian"
- name: Update apt caches after repo is added (Debian).
apt: update_cache=yes
when: php_ondrej_debian_repo.changed and (ansible_distribution == "Debian")
# PHP package purges.
- name: Purge PHP version packages.
apt:
name: "{{ item }}"
state: absent
purge: yes
force: yes
when: "'php' + php_version not in item"
with_items:
- php5.6-common
- php7.0-common
- php7.1-common
- php7.2-common

View file

@ -0,0 +1,16 @@
---
- name: Enable remi repo for PHP 5.6.
set_fact: php_enablerepo="remi,remi-php56"
when: php_version == "5.6"
- name: Enable remi repo for PHP 7.0.
set_fact: php_enablerepo="remi,remi-php70"
when: php_version == "7.0"
- name: Enable remi repo for PHP 7.1.
set_fact: php_enablerepo="remi,remi-php71"
when: php_version == "7.1"
- name: Enable remi repo for PHP 7.2.
set_fact: php_enablerepo="remi,remi-php72"
when: php_version == "7.2"

View file

@ -0,0 +1,11 @@
# 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)`

View file

@ -0,0 +1,3 @@
---
- src: geerlingguy.repo-remi
- src: geerlingguy.php

View file

@ -0,0 +1,17 @@
---
- hosts: all
vars:
php_enable_webserver: false
php_version: "7.2"
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- role_under_test
- geerlingguy.php

View file

@ -0,0 +1,16 @@
---
- hosts: all
vars:
php_enable_webserver: false
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- role_under_test
- geerlingguy.php

View file

@ -0,0 +1,16 @@
__php_packages:
- "php{{ php_version }}"
- "php{{ php_version }}-apcu"
- "php{{ php_version }}-cli"
- "php{{ php_version }}-common"
- "php{{ php_version }}-curl"
- "php{{ php_version }}-dev"
- "php{{ php_version }}-fpm"
- "php{{ php_version }}-gd"
- "php{{ php_version }}-imap"
- "php{{ php_version }}-json"
- "php{{ php_version }}-mbstring"
- "php{{ php_version }}-opcache"
- "php{{ php_version }}-sqlite3"
- "php{{ php_version }}-xml"
- "php{{ php_version }}-yaml"

View file

@ -0,0 +1,40 @@
---
# Configure PHP paths and packages for PHP 5.6 and PHP 7.0.
__php_conf_paths:
- "/etc/php/{{ php_version }}/fpm"
- "/etc/php/{{ php_version }}/apache2"
- "/etc/php/{{ php_version }}/cli"
__php_extension_conf_paths:
- "/etc/php/{{ php_version }}/fpm/conf.d"
- "/etc/php/{{ php_version }}/apache2/conf.d"
- "/etc/php/{{ php_version }}/cli/conf.d"
__php_fpm_daemon: "php{{ php_version }}-fpm"
__php_fpm_conf_path: "/etc/php/{{ php_version }}/fpm"
__php_fpm_pool_conf_path: "{{ php_fpm_conf_path }}/pool.d/www.conf"
__php_mysql_package: "php{{ php_version }}-mysql"
__php_redis_package: "php{{ php_version }}-redis"
__php_memcached_package: "php{{ php_version }}-memcached"
__php_pgsql_package: "php{{ php_version }}-pgsql"
__php_tideways_module_path: "/usr/lib/php/{{ php_version }}/modules"
__php_uploadprogress_module_path: "/usr/lib/php/{{ php_version }}/modules"
__php_xdebug_module_path: "/usr/lib/php/{{ php_version }}/modules"
__php_xhprof_module_path: "/usr/lib/php/{{ php_version }}/modules"
__php_packages:
- "php{{ php_version }}"
- "php{{ php_version }}-apcu"
- "php{{ php_version }}-cli"
- "php{{ php_version }}-common"
- "php{{ php_version }}-curl"
- "php{{ php_version }}-dev"
- "php{{ php_version }}-fpm"
- "php{{ php_version }}-gd"
- "php{{ php_version }}-imap"
- "php{{ php_version }}-json"
- "php{{ php_version }}-mbstring"
- "php{{ php_version }}-mcrypt"
- "php{{ php_version }}-opcache"
- "php{{ php_version }}-sqlite3"
- "php{{ php_version }}-xml"
- "php{{ php_version }}-yaml"

View file

@ -0,0 +1,5 @@
---
__php_tideways_module_path: "/usr/lib64/php{{ php_version }}/modules"
__php_uploadprogress_module_path: "/usr/lib64/php{{ php_version }}/modules"
__php_xdebug_module_path: "/usr/lib64/php{{ php_version }}/modules"
__php_xhprof_module_path: "/usr/lib64/php{{ php_version }}/modules"