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 @@
.DS_Store

View file

@ -0,0 +1,46 @@
---
services: docker
env:
- distro: centos7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: debian8
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
before_install:
# Pull container.
- 'docker pull geerlingguy/docker-${distro}-ansible:latest'
script:
- container_id=$(mktemp)
# Run container in detached state.
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'
# Install dependencies.
- 'docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml'
# Ansible syntax check.
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
# Test role.
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
# Test role idempotence.
- idempotence=$(mktemp)
- docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence}
- >
tail ${idempotence}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Run script to test if Xdebug is available and working.
- 'docker exec "$(cat ${container_id})" env TERM=xterm php /etc/ansible/roles/role_under_test/tests/xdebug-test.php'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -0,0 +1,77 @@
# Ansible Role: PHP-XDebug
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-xdebug.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-xdebug)
Installs PHP [XDebug](http://xdebug.org/) on Linux servers.
## Requirements
Prior to running this role, make sure the `php-devel` and `@Development Tools` (for RHEL/CentOS) or `php5-dev` + `build-essential` packages (for Debian/Ubuntu) are present on the system, as they are required for the build of Xdebug.
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
workspace: /root
Where Xdebug setup files will be downloaded and built.
php_xdebug_version: 2.4.1
The version of Xdebug to be installed (see [Updates](https://xdebug.org/updates.php) for a current listing).
php_xdebug_default_enable: 1
php_xdebug_coverage_enable: 1
Whether to enable XDebug coverage and default exception handling or not. Disable these for slightly improved PHP performance, enable these to use XDebug to the fullest extent.
php_xdebug_cli_enable: 1
Whether xdebug is enabled for the CLI.
php_xdebug_module_path: /usr/lib64/php/modules
The path where `xdebug.so` will be installed.
php_xdebug_remote_enable: "false"
Whether remote debugging is enabled.
php_xdebug_remote_connect_back: "false"
If this is set to true, Xdebug will respond to any request from any IP address; use only for local development on non-public installations!
php_xdebug_remote_host: localhost
php_xdebug_remote_port: "9000"
The host and port on which Xdebug will listen.
php_xdebug_remote_log: /tmp/xdebug.log
The location of the xdebug log (useful if you're having trouble connecting).
php_xdebug_idekey: sublime.xdebug
The IDE key to use in the URL when making Xdebug requests (e.g. `http://example.local/?XDEBUG_SESSION_START=sublime.xdebug`).
php_xdebug_max_nesting_level: 100
The maximimum function nesting level before Xdebug bails and throws a fatal exception.
## Dependencies
- geerlingguy.php
## Example Playbook
- hosts: webservers
roles:
- { role: geerlingguy.php-xdebug }
## License
MIT / BSD
## Author Information
This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

View file

@ -0,0 +1,20 @@
---
workspace: /root
php_xdebug_version: 2.5.0
php_xdebug_coverage_enable: 1
php_xdebug_default_enable: 1
php_xdebug_cli_enable: 1
php_xdebug_remote_enable: "false"
php_xdebug_remote_connect_back: "false"
php_xdebug_remote_host: localhost
php_xdebug_remote_port: "9000"
php_xdebug_remote_log: /tmp/xdebug.log
php_xdebug_remote_autostart: "false"
php_xdebug_idekey: sublime.xdebug
php_xdebug_max_nesting_level: 256

View file

@ -0,0 +1,43 @@
---
dependencies: []
galaxy_info:
author: geerlingguy
description: PHP XDebug for Linux
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.0
platforms:
- name: EL
versions:
- all
- name: GenericUNIX
versions:
- all
- name: Fedora
versions:
- all
- name: opensuse
versions:
- all
- name: GenericBSD
versions:
- all
- name: FreeBSD
versions:
- all
- name: Ubuntu
versions:
- all
- name: SLES
versions:
- all
- name: GenericLinux
versions:
- all
- name: Debian
versions:
- all
galaxy_tags:
- development
- web

View file

@ -0,0 +1,12 @@
---
- name: Copy xdebug ini into main extension config folder.
template:
src: xdebug.ini.j2
dest: "{{ item }}/{{ php_xdebug_config_filename }}"
owner: root
group: root
mode: 0644
with_items: "{{ php_extension_conf_paths }}"
notify:
- restart webserver
- restart php-fpm

View file

@ -0,0 +1,59 @@
---
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Define php_xdebug_module_path.
set_fact:
php_xdebug_module_path: "{{ __php_xdebug_module_path }}"
when: php_xdebug_module_path is not defined
- name: Define php_xdebug_config_filename.
set_fact:
php_xdebug_config_filename: "{{ __php_xdebug_config_filename }}"
when: php_xdebug_config_filename is not defined
- name: Ensure dependencies for building from source are installed (RedHat).
yum: "name={{ item }} state=installed"
with_items:
- '@development'
when: ansible_os_family == 'RedHat'
- name: Ensure dependencies for building from source are installed (Debian).
apt: "name={{ item }} state=installed"
with_items:
- build-essential
when: ansible_os_family == 'Debian'
- name: Untar Xdebug.
unarchive:
src: "https://xdebug.org/files/xdebug-{{ php_xdebug_version }}.tgz"
dest: "{{ workspace }}"
creates: "{{ workspace }}/xdebug-{{ php_xdebug_version }}"
copy: no
- name: Build Xdebug.
shell: >
{{ item }}
chdir={{ workspace }}/xdebug-{{ php_xdebug_version }}
creates={{ workspace }}/xdebug-{{ php_xdebug_version }}/modules/xdebug.so
with_items:
- phpize
- ./configure
- make
- name: Ensure Xdebug module path exists.
file:
path: "{{ php_xdebug_module_path }}"
state: directory
owner: root
group: root
mode: 0755
- name: Move Xdebug module into place.
copy:
src: "{{ workspace }}/xdebug-{{ php_xdebug_version }}/modules/xdebug.so"
dest: "{{ php_xdebug_module_path }}/xdebug-{{ php_xdebug_version }}.so"
remote_src: True
notify: restart webserver
- include: configure.yml

View file

@ -0,0 +1,17 @@
[XDebug]
zend_extension="{{ php_xdebug_module_path }}/xdebug-{{ php_xdebug_version }}.so"
xdebug.coverage_enable={{ php_xdebug_coverage_enable }}
xdebug.default_enable={{ php_xdebug_default_enable }}
xdebug.remote_enable={{ php_xdebug_remote_enable }}
xdebug.remote_connect_back={{ php_xdebug_remote_connect_back }}
xdebug.remote_host={{ php_xdebug_remote_host }}
xdebug.remote_port={{ php_xdebug_remote_port }}
xdebug.remote_handler=dbgp
xdebug.remote_log={{ php_xdebug_remote_log }}
xdebug.remote_autostart={{ php_xdebug_remote_autostart }}
xdebug.idekey="{{ php_xdebug_idekey }}"
xdebug.max_nesting_level={{ php_xdebug_max_nesting_level }}

View file

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

View file

@ -0,0 +1,31 @@
---
- hosts: all
vars:
php_enable_webserver: false
php_enablerepo: "remi,remi-php70"
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Set php_packages for PHP 7.0 Debian 8 install.
set_fact:
php_packages:
- php7.0-common
- php7.0-cli
- php7.0-dev
- php7.0-fpm
- libpcre3-dev
- php7.0-opcache
- php7.0-apcu
when: ansible_distribution == 'Debian'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- role: geerlingguy.repo-dotdeb
when: ansible_distribution == 'Debian'
- geerlingguy.php
- role_under_test

View file

@ -0,0 +1,21 @@
<?php
/**
* @file
* Test if Xdebug is available and working.
*/
$success = FALSE;
// Simple check; this function should return an empty array.
$test = xdebug_get_code_coverage();
if ($test === array()) {
$success = TRUE;
print "Xdebug working properly.\r\n";
exit(0);
}
if (!$success) {
print "Xdebug not working properly.\r\n";
exit(1);
}

View file

@ -0,0 +1,3 @@
---
__php_xdebug_module_path: /usr/lib/php5/modules
__php_xdebug_config_filename: 20-xdebug.ini

View file

@ -0,0 +1,3 @@
---
__php_xdebug_module_path: /usr/lib64/php/modules
__php_xdebug_config_filename: xdebug.ini