Add all files needed to bring up VM and run agaric.com locally
This commit is contained in:
parent
52c8b60bac
commit
4d2bc0ee24
742 changed files with 24037 additions and 0 deletions
49
box/provisioning/roles/geerlingguy.composer/.travis.yml
Normal file
49
box/provisioning/roles/geerlingguy.composer/.travis.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
services: docker
|
||||
|
||||
env:
|
||||
- distro: centos7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
- distro: fedora24
|
||||
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)
|
||||
|
||||
# Ensure Composer is installed and working.
|
||||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm composer || true'
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
76
box/provisioning/roles/geerlingguy.composer/README.md
Normal file
76
box/provisioning/roles/geerlingguy.composer/README.md
Normal file
|
@ -0,0 +1,76 @@
|
|||
# Ansible Role: Composer
|
||||
|
||||
[](https://travis-ci.org/geerlingguy/ansible-role-composer)
|
||||
|
||||
Installs Composer, the PHP Dependency Manager, on any Linux or UNIX system.
|
||||
|
||||
## Requirements
|
||||
|
||||
- `php` (version 5.4+) should be installed and working (you can use the `geerlingguy.php` role to install).
|
||||
- `git` should be installed and working (you can use the `geerlingguy.git` role to install).
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||
|
||||
composer_path: /usr/local/bin/composer
|
||||
|
||||
The path where composer will be installed and available to your system. Should be in your user's `$PATH` so you can run commands simply with `composer` instead of the full path.
|
||||
|
||||
composer_keep_updated: false
|
||||
|
||||
Set this to `true` to update Composer to the latest release every time the playbook is run.
|
||||
|
||||
composer_home_path: '~/.composer'
|
||||
composer_home_owner: root
|
||||
composer_home_group: root
|
||||
|
||||
The `COMPOSER_HOME` path and directory ownership; this is the directory where global packages will be installed.
|
||||
|
||||
composer_version: ''
|
||||
|
||||
You can install a specific release of Composer, e.g. `composer_version: '1.0.0-alpha11'`. If left empty the latest development version will be installed. Note that `composer_keep_updated` will override this variable, as it will always install the latest development version.
|
||||
|
||||
composer_global_packages: {}
|
||||
|
||||
A list of packages to install globally (using `composer global require`). If you want to install any packages globally, add a list item with a dictionary with the `name` of the package and a `release`, e.g. `- { name: phpunit/phpunit, release: "4.7.*" }`. The 'release' is optional, and defaults to `@stable`.
|
||||
|
||||
composer_add_to_path: true
|
||||
|
||||
If `true`, and if there are any configured `composer_global_packages`, the `vendor/bin` directory inside `composer_home_path` will be added to the system's default `$PATH` (for all users).
|
||||
|
||||
composer_project_path: /path/to/project
|
||||
|
||||
Path to a composer project.
|
||||
|
||||
composer_add_project_to_path: false
|
||||
|
||||
If `true`, and if you have configured a `composer_project_path`, the `vendor/bin` directory inside `composer_project_path` will be added to the system's default `$PATH` (for all users).
|
||||
|
||||
composer_github_oauth_token: ''
|
||||
|
||||
GitHub OAuth token, used to avoid GitHub API rate limiting errors when building and rebuilding applications using Composer. Follow GitHub's directions to [Create a personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) if you run into these rate limit errors.
|
||||
|
||||
php_executable: php
|
||||
|
||||
The executable name or full path to the PHP executable. This is defaulted to `php` if you don't override the variable.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None (but make sure you've installed PHP; the `geerlingguy.php` role is recommended).
|
||||
|
||||
## Example Playbook
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- geerlingguy.composer
|
||||
|
||||
After the playbook runs, `composer` will be placed in `/usr/local/bin/composer` (this location is configurable), and will be accessible via normal system accounts.
|
||||
|
||||
## License
|
||||
|
||||
MIT / BSD
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
composer_path: /usr/local/bin/composer
|
||||
composer_keep_updated: false
|
||||
composer_version: ''
|
||||
|
||||
# The directory where global packages will be installed.
|
||||
composer_home_path: '~/.composer'
|
||||
composer_home_owner: root
|
||||
composer_home_group: root
|
||||
|
||||
# A list of packages to install globally. See commented examples below for
|
||||
# usage; the 'release' is optional, and defaults to '@stable'.
|
||||
composer_global_packages: []
|
||||
# - { name: phpunit/phpunit, release: "4.7.x" }
|
||||
# - { name: phpunit/phpunit, release: "@stable" }
|
||||
|
||||
composer_add_to_path: true
|
||||
|
||||
# Add a project vendor/bin directory to the PATH
|
||||
composer_add_project_to_path: false
|
||||
#composer_project_path: /path/to/project/vendor/bin
|
||||
|
||||
# GitHub OAuth token (used to help overcome API rate limits).
|
||||
composer_github_oauth_token: ''
|
43
box/provisioning/roles/geerlingguy.composer/meta/main.yml
Normal file
43
box/provisioning/roles/geerlingguy.composer/meta/main.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
author: geerlingguy
|
||||
description: Composer PHP Dependency Manager
|
||||
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:
|
||||
- packaging
|
||||
- web
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: Install configured globally-required packages.
|
||||
command: >
|
||||
{{ composer_path }} global require {{ item.name }}:{{ item.release | default('@stable') }} --no-progress
|
||||
creates={{ composer_home_path }}/vendor/{{ item.name }}
|
||||
environment:
|
||||
COMPOSER_HOME: "{{ composer_home_path }}"
|
||||
become: yes
|
||||
become_user: "{{ composer_home_owner }}"
|
||||
register: composer_global_require_result
|
||||
with_items: "{{ composer_global_packages }}"
|
||||
|
||||
- name: Add composer_home_path bin directory to global $PATH.
|
||||
template:
|
||||
src: composer.sh.j2
|
||||
dest: /etc/profile.d/composer.sh
|
||||
mode: 0644
|
||||
when: composer_add_to_path
|
58
box/provisioning/roles/geerlingguy.composer/tasks/main.yml
Normal file
58
box/provisioning/roles/geerlingguy.composer/tasks/main.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
---
|
||||
- name: Set php_executable variable to a default if not defined.
|
||||
set_fact:
|
||||
php_executable: php
|
||||
when: php_executable is not defined
|
||||
|
||||
- name: Check if Composer is installed.
|
||||
stat: "path={{ composer_path }}"
|
||||
register: composer_bin
|
||||
|
||||
- name: Download Composer installer.
|
||||
get_url:
|
||||
url: https://getcomposer.org/installer
|
||||
dest: /tmp/composer-installer.php
|
||||
mode: 0755
|
||||
when: not composer_bin.stat.exists
|
||||
|
||||
- name: Run Composer installer.
|
||||
command: >
|
||||
{{ php_executable }} composer-installer.php {% if composer_version != '' %} --version={{ composer_version }}{% endif %}
|
||||
chdir=/tmp
|
||||
when: not composer_bin.stat.exists
|
||||
|
||||
- name: Move Composer into globally-accessible location.
|
||||
shell: >
|
||||
mv /tmp/composer.phar {{ composer_path }}
|
||||
creates={{ composer_path }}
|
||||
when: not composer_bin.stat.exists
|
||||
|
||||
- name: Update Composer to latest version (if configured).
|
||||
shell: >
|
||||
{{ php_executable }} {{ composer_path }} self-update
|
||||
register: composer_update
|
||||
changed_when: "'Updating to version' in composer_update.stdout"
|
||||
when: composer_keep_updated
|
||||
|
||||
- name: Ensure composer directory exists.
|
||||
file:
|
||||
path: "{{ composer_home_path }}"
|
||||
owner: "{{ composer_home_owner }}"
|
||||
group: "{{ composer_home_group }}"
|
||||
state: directory
|
||||
|
||||
- name: Add GitHub OAuth token for Composer (if configured).
|
||||
become: yes
|
||||
become_user: "{{ composer_home_owner }}"
|
||||
template:
|
||||
src: "auth.json.j2"
|
||||
dest: "{{ composer_home_path }}/auth.json"
|
||||
owner: "{{ composer_home_owner }}"
|
||||
group: "{{ composer_home_group }}"
|
||||
when: composer_github_oauth_token != ''
|
||||
|
||||
- include: global-require.yml
|
||||
when: composer_global_packages|length > 0
|
||||
|
||||
- include: project-bin.yml
|
||||
when: composer_add_project_to_path
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Add composer_project_path bin directory to global $PATH.
|
||||
template:
|
||||
src: composer-project.sh.j2
|
||||
dest: /etc/profile.d/composer-project.sh
|
||||
mode: 0644
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"github-oauth": {
|
||||
"github.com": "{{ composer_github_oauth_token }}"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export PATH={{ composer_project_path }}:$PATH
|
|
@ -0,0 +1 @@
|
|||
export PATH=$PATH:{{ composer_home_path }}/vendor/bin
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- src: geerlingguy.repo-remi
|
||||
- src: geerlingguy.repo-dotdeb
|
||||
- src: geerlingguy.git
|
||||
- src: geerlingguy.php
|
39
box/provisioning/roles/geerlingguy.composer/tests/test.yml
Normal file
39
box/provisioning/roles/geerlingguy.composer/tests/test.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
|
||||
vars:
|
||||
php_enablerepo: "remi,remi-php70"
|
||||
php_enable_webserver: false
|
||||
|
||||
# Test a global requirement.
|
||||
composer_global_packages:
|
||||
- name: phpunit/phpunit
|
||||
release: "@stable"
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- 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
|
||||
- php7.0-xml
|
||||
when: ansible_distribution == 'Debian'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.repo-remi
|
||||
when: ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora'
|
||||
- role: geerlingguy.repo-dotdeb
|
||||
when: ansible_distribution == 'Debian'
|
||||
- geerlingguy.git
|
||||
- geerlingguy.php
|
||||
- role_under_test
|
Loading…
Add table
Add a link
Reference in a new issue