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,27 @@
---
services: docker
env:
- distro: centos7
playbook: test-apache.yml
- distro: centos6
playbook: test-apache.yml
- distro: ubuntu1604
playbook: test-apache.yml
- distro: ubuntu1404
playbook: test-apache.yml
- distro: debian8
playbook: test-apache.yml
- distro: ubuntu1604
playbook: test-standalone.yml
script:
# 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
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,47 @@
# Ansible Role: Adminer
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-adminer.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-adminer)
An Ansible Role that installs [Adminer](http://www.adminer.org/) on almost any computer.
## Requirements
You need to have PHP and MySQL for Adminer to do anything useful. If you have Apache installed, Adminer will add in configuration to make Adminer accessible on any virtualhost at `/adminer`; set `adminer_add_apache_config` to `false` to disable this behavior.
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
adminer_install_dir: /opt/adminer
The directory in which Adminer will be downloaded/installed.
adminer_install_filename: adminer.php
The filename for the downloaded Adminer application. If you're managing virtualhosts or server directives manually, it might be simpler to set the document root to your configured `adminer_install_dir`, and the filename to `index.php`, so you don't have to enter `/adminer.php` in the URL to access Adminer.
adminer_symlink_dirs: []
Directories inside which you would like `adminer.php` symlinked. Can be useful if you just want to toss the script into a docroot and access it at `sitename/adminer.php`.
adminer_add_apache_config: false
Set this to `true` to tell Adminer to add a config file to Apache so you can access it at `hostname/adminer` on any configured virtualhost, using an Apache `Alias` directive. The role will also restart Apache so this configuration takes effect immediately.
## Dependencies
None. If `adminer_add_apache_config` is set to `true`, it will use some variables and handlers defined by the `geerlingguy.apache` role, so there's a soft dependency on that role.
## Example Playbook
- hosts: servers
roles:
- { role: geerlingguy.adminer }
## License
MIT / BSD
## Author Information
This role was created in 2015 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). It is originally a fork of [Oefenweb/ansible-adminer](https://github.com/Oefenweb/ansible-adminer).

View file

@ -0,0 +1,5 @@
---
adminer_install_dir: /opt/adminer
adminer_install_filename: adminer.php
adminer_symlink_dirs: []
adminer_add_apache_config: false

View file

@ -0,0 +1,44 @@
---
dependencies: []
galaxy_info:
author: geerlingguy
description: Installs Adminer for Database management.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 1.9
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:
- system
- database
- development

View file

@ -0,0 +1,41 @@
---
# Install Adminer.
- name: Ensure Adminer directory exists.
file:
path: "{{ adminer_install_dir }}"
state: directory
recurse: yes
- name: Download Adminer to configured directory.
get_url:
url: https://www.adminer.org/latest.php
dest: "{{ adminer_install_dir }}/{{ adminer_install_filename }}"
mode: 0644
timeout: 60
- name: Symlink Adminer into configured directories.
file:
src: "{{ adminer_install_dir }}/adminer.php"
dest: "{{ item }}/adminer.php"
state: link
with_items: "{{ adminer_symlink_dirs }}"
# Add Apache configuration (if configured).
- name: Set the proper Apache configuration directory (Debian).
set_fact:
apache_extra_conf_dir: "{{ 'conf-enabled' if apache_vhosts_version == '2.4' else 'conf.d' }}"
when: adminer_add_apache_config and ansible_os_family == 'Debian'
- name: Add Apache configuration file for Adminer (Debian).
template:
src: adminer.conf.j2
dest: "{{ apache_conf_path }}/{{ apache_extra_conf_dir }}/adminer.conf"
when: adminer_add_apache_config and ansible_os_family == 'Debian'
notify: restart apache
- name: Add Apache configuration file for Adminer (RedHat).
template:
src: adminer.conf.j2
dest: "{{ apache_conf_path }}/adminer.conf"
when: adminer_add_apache_config and ansible_os_family == 'RedHat'
notify: restart apache

View file

@ -0,0 +1,9 @@
Alias /adminer "{{ adminer_install_dir }}/adminer.php"
<Directory "{{ adminer_install_dir }}">
{% if apache_vhosts_version == "2.2" %}
Order allow,deny
Allow from all
{% else %}
Require all granted
{% endif %}
</Directory>

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,2 @@
---
- src: geerlingguy.apache

View file

@ -0,0 +1,8 @@
- hosts: all
vars:
adminer_add_apache_config: true
roles:
- geerlingguy.apache
- role_under_test

View file

@ -0,0 +1,8 @@
- hosts: all
vars:
adminer_install_dir: /opt/adminer
adminer_add_apache_config: false
roles:
- role_under_test