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 @@
.DS_Store

View file

@ -0,0 +1,53 @@
---
sudo: required
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"
- distro: ubuntu1404
init: /sbin/init
run_opts: ""
- distro: ubuntu1204
init: /sbin/init
run_opts: ""
services:
- docker
before_install:
# Pull container
- 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest'
script:
- container_id=$(mktemp)
# Run container in detached state.
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'
# Ansible syntax check.
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
# Test role.
- 'sudo docker exec "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
# Test role idempotence.
- idempotence=$(mktemp)
- sudo 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)
# Check if memcached is running.
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm memcached -h'
after_success:
# Clean up.
- 'sudo docker stop "$(cat ${container_id})"'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -0,0 +1,53 @@
# Ansible Role: Memcached
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-memcached.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-memcached)
An Ansible Role that installs Memcached on RedHat/CentOS or Debian/Ubuntu Linux.
## Requirements
None.
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
memcached_user: memcache
The user under which the Memcached daemon will run.
memcached_port: 11211
memcached_listen_ip: 127.0.0.1
The port and IP address (127.0.0.1 for localhost) on which Memcached will listen for requests.
memcached_memory_limit: 64
memcached_connections: 1024
Memcached limits. The maximum amount of RAM `memcached` will consume (64MB is the default), and the maximum number of simultaneous connections memcached will handle.
memcached_log_file: /var/log/memcached.log
The location of the memcached log file.
memcached_log_verbosity: ""
Normally memcached does not log anything. Change to "-v" to enable logging or to "-vv" for debug logging.
## Dependencies
None.
## Example Playbook
- hosts: cache
roles:
- { role: geerlingguy.memcached }
## 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,9 @@
---
memcached_port: 11211
memcached_listen_ip: 127.0.0.1
memcached_memory_limit: 64
memcached_connections: 1024
memcached_log_file: /var/log/memcached.log
memcached_log_verbosity: ""

View file

@ -0,0 +1,4 @@
---
- name: restart memcached
service: name=memcached state=restarted
when: not memcached_install.changed

View file

@ -0,0 +1,25 @@
---
dependencies: []
galaxy_info:
author: geerlingguy
description: Memcached for Linux
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.0
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- precise
- trusty
- xenial
- name: Debian
versions:
- all
galaxy_tags:
- web
- database

View file

@ -0,0 +1,31 @@
---
# Include variables and define needed variables.
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Define memcached_user.
set_fact:
memcached_user: "{{ __memcached_user }}"
when: memcached_user is not defined
# Setup/install tasks.
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=86400
when: ansible_os_family == 'Debian'
- name: Install Memcached.
package: name=memcached state=installed
register: memcached_install
# Configure Memcached.
- name: Copy Memcached configuration.
template:
src: memcached-{{ ansible_os_family }}.conf.j2
dest: "{{ memcached_config_file }}"
owner: root
group: root
mode: 0644
notify: restart memcached
- name: Ensure Memcached is started and set to run on startup.
service: name=memcached state=started enabled=yes

View file

@ -0,0 +1,43 @@
# {{ ansible_managed }}
# memcached default config file
# 2003 - Jay Bonci <jaybonci@debian.org>
# This configuration file is read by the start-memcached script provided as
# part of the Debian GNU/Linux distribution.
# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run. See the README.Debian that comes with this package for more
# information.
-d
# Log memcached's output to /var/log/memcached
logfile {{ memcached_log_file }}
{{ memcached_log_verbosity }}
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m {{ memcached_memory_limit }}
# Default connection port is 11211
-p {{ memcached_port }}
# Run the daemon as root. The start-memcached will default to running as root if no
# -u command is present in this config file
-u {{ memcached_user }}
# Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.
-l {{ memcached_listen_ip }}
# Limit the number of simultaneous incoming connections. The daemon default is 1024
-c {{ memcached_connections }}
# Lock down all paged memory. Consult with the README and homepage before you do this
# -k
# Return error when memory is exhausted (rather than removing items)
# -M
# Maximize core file limit
# -r

View file

@ -0,0 +1,20 @@
# {{ ansible_managed }}
# Default connection port is 11211
PORT="{{ memcached_port }}"
# The user to run memcached as.
USER="{{ memcached_user }}"
# Limit the number of simultaneous incoming connections. The daemon default is 1024.
MAXCONN="{{ memcached_connections }}"
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
CACHESIZE="{{ memcached_memory_limit }}"
# Extra options:
# -l Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.
OPTIONS="-l {{ memcached_listen_ip }} {{ memcached_log_verbosity }} >> {{ memcached_log_file }} 2>&1"

View file

@ -0,0 +1,5 @@
---
- hosts: all
roles:
- role_under_test

View file

@ -0,0 +1,3 @@
---
__memcached_user: memcache
memcached_config_file: /etc/memcached.conf

View file

@ -0,0 +1,3 @@
---
__memcached_user: memcached
memcached_config_file: /etc/sysconfig/memcached