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,43 @@
---
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 MySQL support is enabled.
- docker exec --tty "$(cat ${container_id})" env TERM=xterm php -i | grep 'mysqlnd => enabled'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -0,0 +1,40 @@
# Ansible Role: PHP-MySQL
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-mysql.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-mysql)
Installs PHP [MySQL](https://www.mysql.com/) 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_mysql_package: php-mysql # RedHat
php_mysql_package: php5-mysql # Debian
The PHP MySQL package to install via apt/yum. This should only be overridden if you need to install a unique/special package for MySQL support, as in the case of using software collections on Enterprise Linux.
## Dependencies
- geerlingguy.php
## Example Playbook
- hosts: webservers
roles:
- { role: geerlingguy.php-mysql }
## 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,3 @@
---
# Pass in a comma-separated list of repos to use (e.g. "remi,epel").
php_enablerepo: ""

View file

@ -0,0 +1,25 @@
---
dependencies:
- geerlingguy.php
galaxy_info:
author: geerlingguy
description: PHP MySQL 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
- mysql
- php

View file

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

View file

@ -0,0 +1,11 @@
---
mysql_packages:
- mariadb
- mariadb-server
- mariadb-libs
- MySQL-python
- perl-DBD-MySQL
mysql_daemon: mariadb
mysql_log_error: /var/log/mariadb/mariadb.log
mysql_syslog_tag: mariadb
mysql_pid_file: /var/run/mariadb/mariadb.pid

View file

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

View file

@ -0,0 +1,22 @@
---
- hosts: all
vars:
php_enablerepo: "remi,remi-php70"
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: Include CentOS 7-specific vars.
include_vars: centos7-vars.yml
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- geerlingguy.apache
- geerlingguy.mysql
- geerlingguy.php
- role_under_test

View file

@ -0,0 +1,2 @@
---
__php_mysql_package: php7.0-mysql

View file

@ -0,0 +1,2 @@
---
__php_mysql_package: php-mysql