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
box/provisioning/roles/geerlingguy.php-pgsql

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"
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)
# Ensure PHP PostgreSQL support is enabled.
- docker exec --tty "$(cat ${container_id})" env TERM=xterm php -i | grep 'PostgreSQL Support => enabled'
after_failure:
- docker exec --tty "$(cat ${container_id})" env TERM=xterm php -i
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -0,0 +1,42 @@
# Ansible Role: PHP-PostgreSQL
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-pgsql.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-pgsql)
Installs PHP [PostgreSQL](https://www.postgresql.org/) support on Linux.
## Requirements
None.
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
php_enablerepo: ""
(RedHat/CentOS only) If you have enabled any additional repositories (might I suggest geerlingguy.repo-epel or geerlingguy.repo-remi), those repositories can be listed under this variable (e.g. `remi,epel`). This can allow you to install later versions of PHP packages.
php_pgsql_package: php-pgsql # RedHat
php_pgsql_package: php7.0-pgsql # Debian
The PHP PostgreSQL package to install via apt/yum. This should only be overridden if you need to install a unique/special package for PostgreSQL support, as in the case of using software collections on Enterprise Linux.
## Dependencies
- geerlingguy.php
## Example Playbook
- hosts: webservers
roles:
- geerlingguy.postgresql
- geerlingguy.php
- geerlingguy.php-pgsql
## License
MIT / BSD
## Author Information
This role was created in 2016 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

View file

@ -0,0 +1,3 @@
---
# Pass in a comma-separated list of repos to use (e.g. "remi,epel").
php_enablerepo: ""

View file

@ -0,0 +1,26 @@
---
dependencies:
- geerlingguy.php
galaxy_info:
author: geerlingguy
description: PHP PostgreSQL support for Linux.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 1.8
platforms:
- name: EL
versions:
- all
- name: Debian
versions:
- all
- name: Ubuntu
versions:
- all
galaxy_tags:
- database
- web
- postgres
- php
- pgsql

View file

@ -0,0 +1,29 @@
---
# Variable setup.
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Define php_pgsql_package.
set_fact:
php_pgsql_package: "{{ __php_pgsql_package }}"
when: php_pgsql_package is not defined
# Installation.
- name: Install PHP PostgreSQL dependencies (RedHat).
yum:
name: "{{ php_pgsql_package }}"
state: present
enablerepo: "{{ php_enablerepo }}"
notify:
- restart webserver
- restart php-fpm
when: ansible_os_family == 'RedHat'
- name: Install PHP PostgreSQL dependencies (Debian).
apt:
name: "{{ php_pgsql_package }}"
state: present
notify:
- restart webserver
- restart php-fpm
when: ansible_os_family == 'Debian'

View file

@ -0,0 +1,5 @@
---
- src: geerlingguy.repo-remi
- src: geerlingguy.apache
- src: geerlingguy.postgresql
- src: geerlingguy.php

View file

@ -0,0 +1,18 @@
---
- hosts: all
vars:
php_enablerepo: "remi,remi-php70"
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- geerlingguy.apache
- geerlingguy.postgresql
- geerlingguy.php
- role_under_test

View file

@ -0,0 +1,2 @@
---
__php_pgsql_package: php7.0-pgsql

View file

@ -0,0 +1,2 @@
---
__php_pgsql_package: php-pgsql