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
40
box/provisioning/roles/geerlingguy.php-memcached/.travis.yml
Normal file
40
box/provisioning/roles/geerlingguy.php-memcached/.travis.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
sudo: required
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
env:
|
||||
- SITE=test.yml
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
|
||||
install:
|
||||
# Install Ansible.
|
||||
- pip install ansible
|
||||
|
||||
# Add ansible.cfg to pick up roles path.
|
||||
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
|
||||
|
||||
# Install dependencies.
|
||||
- ansible-galaxy install geerlingguy.memcached geerlingguy.php
|
||||
|
||||
script:
|
||||
# Check the role/playbook's syntax.
|
||||
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
|
||||
|
||||
# Run the role/playbook with ansible-playbook.
|
||||
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
|
||||
|
||||
# Run the role/playbook again, checking to make sure it's idempotent.
|
||||
- >
|
||||
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
|
||||
# Run script to test if Memcached is available and working.
|
||||
- php tests/memcached-test.php
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
39
box/provisioning/roles/geerlingguy.php-memcached/README.md
Normal file
39
box/provisioning/roles/geerlingguy.php-memcached/README.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Ansible Role: PHP-Memcached
|
||||
|
||||
[](https://travis-ci.org/geerlingguy/ansible-role-php-memcached)
|
||||
|
||||
Installs PHP Memcached support on RedHat/CentOS/Debian/Ubuntu.
|
||||
|
||||
## Requirements
|
||||
|
||||
This role doesn't *explicitly* require Memcached to be installed, but if you don't have the daemon running somewhere (either on the same server, or somewhere else), this role won't be all that helpful. Check out `geerlingguy.memcached` for a simple role to install and configure Memcached (either on the same server, or separate servers).
|
||||
|
||||
## 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 be handy, as an example, if you want to install the latest version of PHP from Remi's repository.
|
||||
|
||||
php_memcached_package: php-memcached
|
||||
|
||||
The package to install for PHP Memcached support. For Debian/Ubuntu and PHP 5.x, use `php5-memcached`.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- geerlingguy.php
|
||||
|
||||
## Example Playbook
|
||||
|
||||
- hosts: webservers
|
||||
roles:
|
||||
- { role: geerlingguy.php-memcached }
|
||||
|
||||
## License
|
||||
|
||||
MIT / BSD
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
# Pass in a comma-separated list of repos to use (e.g. "remi,epel").
|
||||
php_enablerepo: ""
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
dependencies:
|
||||
- geerlingguy.php
|
||||
|
||||
galaxy_info:
|
||||
author: geerlingguy
|
||||
description: PHP Memcached support for Linux
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "license (BSD, MIT)"
|
||||
min_ansible_version: 1.8
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- database
|
||||
- web
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
# Include variables and define needed variables.
|
||||
- name: Include OS-specific variables.
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Define php_memcached_package.
|
||||
set_fact:
|
||||
php_memcached_package: "{{ __php_memcached_package }}"
|
||||
when: php_memcached_package is not defined
|
||||
|
||||
- name: Install PHP Memcached extension (RedHat).
|
||||
yum:
|
||||
name: "{{ php_memcached_package }}"
|
||||
state: installed
|
||||
enablerepo: "{{ php_enablerepo }}"
|
||||
notify:
|
||||
- restart webserver
|
||||
- restart php-fpm
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Install PHP Memcached extension (Debian).
|
||||
apt:
|
||||
name: "{{ php_memcached_package }}"
|
||||
state: installed
|
||||
notify:
|
||||
- restart webserver
|
||||
- restart php-fpm
|
||||
when: ansible_os_family == 'Debian'
|
|
@ -0,0 +1 @@
|
|||
localhost
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Test if Memcached is available and working.
|
||||
*
|
||||
* Note that if you run this script more than once per second, the add() call
|
||||
* will fail. Why would you run this more than once per second?!
|
||||
*/
|
||||
|
||||
$success = FALSE;
|
||||
$key = 'test';
|
||||
$value = 'Success';
|
||||
|
||||
if (class_exists('Memcached')) {
|
||||
$memcached = new Memcached;
|
||||
$memcached->addServer('127.0.0.1', 11211);
|
||||
|
||||
// Test adding a value to memcached.
|
||||
if ($memcached->add($key, $value, 1)) {
|
||||
$result = $memcached->get($key);
|
||||
|
||||
// If we get the expected result, it was a success.
|
||||
if ($result == $value) {
|
||||
$success = TRUE;
|
||||
print "Memcached connection successful.\r\n";
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
print "Memcached not working properly.\r\n";
|
||||
exit(1);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_memcached_package: php5-memcached
|
||||
|
||||
roles:
|
||||
- geerlingguy.memcached
|
||||
- geerlingguy.php
|
||||
- ansible-role-php-memcached
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
__php_memcached_package: php-memcached
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
__php_memcached_package: php-pecl-memcached
|
Loading…
Add table
Add a link
Reference in a new issue