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
51
box/provisioning/roles/geerlingguy.drush/.travis.yml
Normal file
51
box/provisioning/roles/geerlingguy.drush/.travis.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
services: docker
|
||||
|
||||
env:
|
||||
# Normal installation.
|
||||
- distro: centos7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
playbook: test.yml
|
||||
- distro: ubuntu1604
|
||||
init: /lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
playbook: test.yml
|
||||
# Install from source.
|
||||
- distro: centos7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
playbook: test-source-install.yml
|
||||
|
||||
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/${playbook} --syntax-check'
|
||||
|
||||
# Test role.
|
||||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}'
|
||||
|
||||
# Test role idempotence.
|
||||
- idempotence=$(mktemp)
|
||||
- docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | tee -a ${idempotence}
|
||||
- >
|
||||
tail ${idempotence}
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
|
||||
# Test Drush.
|
||||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm drush --version || true'
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
74
box/provisioning/roles/geerlingguy.drush/README.md
Normal file
74
box/provisioning/roles/geerlingguy.drush/README.md
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Ansible Role: Drush
|
||||
|
||||
[](https://travis-ci.org/geerlingguy/ansible-role-drush)
|
||||
|
||||
Installs [Drush](http://www.drush.org/en/master/), a command line shell and scripting interface for Drupal, on any Linux or UNIX system.
|
||||
|
||||
## Requirements
|
||||
|
||||
PHP must be installed on the system prior to running this role (suggested role: `geerlingguy.php`).
|
||||
|
||||
Source installation additionally requires Git and Composer to also be installed on the system (suggested roles: `geerlingguy.git` and `geerlingguy.composer`).
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||
|
||||
drush_phar_url: https://github.com/drush-ops/drush/releases/download/8.1.10/drush.phar
|
||||
|
||||
The URL from which the Drush phar file will be downloaded.
|
||||
|
||||
drush_path: /usr/local/bin/drush
|
||||
|
||||
The path where drush will be installed and available to your system. Should be in your user's `$PATH` so you can run commands simply with `drush` instead of the full path.
|
||||
|
||||
drush_config: ~/.drush
|
||||
|
||||
Path to the directory where Drush will store its generated config.
|
||||
|
||||
### Variables used for source install (Git).
|
||||
|
||||
drush_install_path: /usr/local/share/drush
|
||||
|
||||
The location of the entire drush installation (includes all the supporting files, as well as the `drush` executable file.
|
||||
|
||||
drush_version: "master"
|
||||
|
||||
The version of Drush to install (examples: `"master"` for the bleeding edge, `"7.x"`, `"6.x"`, `"6.2.0"`). This should be a string as it refers to a git branch, tag, or commit hash.
|
||||
|
||||
drush_keep_updated: no
|
||||
drush_force_update: no
|
||||
|
||||
Whether to keep Drush up-to-date with the latest revision of the branch specified by `drush_version`, and whether to force the update (e.g. overwrite local modifications to the drush repository).
|
||||
|
||||
drush_force_composer_install: no
|
||||
|
||||
Use this if you get an error message when provisioning like `Unable to load autoload.php. Run composer install to fetch dependencies and write this file`. It will force a `composer install` inside the Drush directory.
|
||||
|
||||
drush_composer_cli_options: "--prefer-source --no-interaction"
|
||||
|
||||
These options are the safest for avoiding GitHub API rate limits when installing Drush, and can be very helpful when working on dependencies/installation, but builds can be sped up substantially by changing the first option to --prefer-dist.
|
||||
|
||||
drush_clone_depth: 1
|
||||
|
||||
Whether to clone the entire repo (by default), or specify the number of previous commits for a smaller and faster clone.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- geerlingguy.drush
|
||||
|
||||
After the playbook runs, the `drush` command will be accessible from 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/).
|
16
box/provisioning/roles/geerlingguy.drush/defaults/main.yml
Normal file
16
box/provisioning/roles/geerlingguy.drush/defaults/main.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
# Install from phar (faster, but less flexible).
|
||||
drush_version: "8.1.10"
|
||||
drush_phar_url: https://github.com/drush-ops/drush/releases/download/{{ drush_version }}/drush.phar
|
||||
drush_path: /usr/local/bin/drush
|
||||
|
||||
# Install from source (git clone + composer-based install).
|
||||
drush_install_from_source: no
|
||||
drush_install_path: /usr/local/share/drush
|
||||
# drush_version: "master"
|
||||
drush_keep_updated: no
|
||||
drush_force_update: no
|
||||
drush_force_composer_install: no
|
||||
|
||||
drush_composer_cli_options: "--prefer-dist --no-interaction"
|
||||
drush_clone_depth: 1
|
46
box/provisioning/roles/geerlingguy.drush/meta/main.yml
Normal file
46
box/provisioning/roles/geerlingguy.drush/meta/main.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
author: geerlingguy
|
||||
description: Drush - command line shell for Drupal
|
||||
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
|
||||
- drush
|
||||
- drupal
|
||||
- command
|
21
box/provisioning/roles/geerlingguy.drush/tasks/install.yml
Normal file
21
box/provisioning/roles/geerlingguy.drush/tasks/install.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- name: Check current state.
|
||||
stat:
|
||||
path: "{{ drush_path }}"
|
||||
register: drush_path_state
|
||||
|
||||
- name: Perform cleanup of old symlink.
|
||||
file:
|
||||
path: "{{ drush_path }}"
|
||||
state: absent
|
||||
when: drush_path_state.stat.islnk is defined and drush_path_state.stat.islnk
|
||||
|
||||
- name: Install Drush.
|
||||
get_url:
|
||||
url: "{{ drush_phar_url }}"
|
||||
dest: "{{ drush_path }}"
|
||||
|
||||
- name: Ensure Drush is executable.
|
||||
file:
|
||||
path: "{{ drush_path }}"
|
||||
mode: 0755
|
6
box/provisioning/roles/geerlingguy.drush/tasks/main.yml
Normal file
6
box/provisioning/roles/geerlingguy.drush/tasks/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- include: install.yml
|
||||
when: not drush_install_from_source
|
||||
|
||||
- include: source-install.yml
|
||||
when: drush_install_from_source
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
- name: Clone Drush from GitHub.
|
||||
git:
|
||||
repo: https://github.com/drush-ops/drush.git
|
||||
dest: "{{ drush_install_path }}"
|
||||
version: "{{ drush_version }}"
|
||||
update: "{{ drush_keep_updated }}"
|
||||
force: "{{ drush_force_update }}"
|
||||
depth: "{{ drush_clone_depth }}"
|
||||
register: drush_clone
|
||||
|
||||
- name: Check for composer.json
|
||||
stat: path={{ drush_install_path }}/composer.json
|
||||
register: drush_composer
|
||||
|
||||
# See: https://github.com/geerlingguy/ansible-role-drush/issues/6
|
||||
- name: Ensure Drush can be installed on Debian Wheezy.
|
||||
shell: >
|
||||
{{ composer_path }} update {{ drush_composer_cli_options }}
|
||||
chdir={{ drush_install_path }}
|
||||
when: drush_clone.changed and ansible_distribution == "Debian" and ansible_distribution_release == "wheezy" and drush_composer.stat.exists
|
||||
|
||||
- name: Install Drush dependencies with Composer.
|
||||
shell: >
|
||||
{{ composer_path }} install {{ drush_composer_cli_options }}
|
||||
chdir={{ drush_install_path }}
|
||||
when: (drush_clone.changed and drush_composer.stat.exists) or drush_force_composer_install
|
||||
|
||||
- name: Create drush symlink.
|
||||
file:
|
||||
src: "{{ drush_install_path }}/drush"
|
||||
dest: "{{ drush_path }}"
|
||||
state: link
|
||||
force: yes
|
||||
|
||||
- name: Run drush to finish setting it up.
|
||||
command: "{{ drush_path }}"
|
||||
register: drush_result
|
||||
changed_when: "'Execute a drush command' not in drush_result.stdout"
|
||||
become: no
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- src: geerlingguy.repo-remi
|
||||
- src: geerlingguy.php
|
||||
- src: geerlingguy.composer
|
||||
- src: geerlingguy.git
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_opcache_enable: "0"
|
||||
drush_install_from_source: yes
|
||||
|
||||
pre_tasks:
|
||||
- name: Enable remi repo for PHP 7.0 (RedHat).
|
||||
set_fact: php_enablerepo="remi,remi-php70"
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.repo-remi
|
||||
when: ansible_os_family == 'RedHat'
|
||||
- geerlingguy.php
|
||||
- geerlingguy.composer
|
||||
- geerlingguy.git
|
||||
- role_under_test
|
21
box/provisioning/roles/geerlingguy.drush/tests/test.yml
Normal file
21
box/provisioning/roles/geerlingguy.drush/tests/test.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_opcache_enable: "0"
|
||||
|
||||
pre_tasks:
|
||||
- name: Enable remi repo for PHP 7.0 (RedHat).
|
||||
set_fact: php_enablerepo="remi,remi-php70"
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.repo-remi
|
||||
when: ansible_os_family == 'RedHat'
|
||||
- geerlingguy.php
|
||||
- role_under_test
|
Loading…
Add table
Add a link
Reference in a new issue