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
box/provisioning/roles/geerlingguy.java
55
box/provisioning/roles/geerlingguy.java/.travis.yml
Normal file
55
box/provisioning/roles/geerlingguy.java/.travis.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
services: docker
|
||||
|
||||
env:
|
||||
- distro: centos7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
- distro: centos6
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
- 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: ubuntu1404
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
- distro: ubuntu1204
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
- 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}"'
|
||||
|
||||
# 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 Java is installed.
|
||||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm which java'
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
66
box/provisioning/roles/geerlingguy.java/README.md
Normal file
66
box/provisioning/roles/geerlingguy.java/README.md
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Ansible Role: Java
|
||||
|
||||
[](https://travis-ci.org/geerlingguy/ansible-role-java)
|
||||
|
||||
Installs Java for RedHat/CentOS and Debian/Ubuntu linux servers.
|
||||
|
||||
## Requirements
|
||||
|
||||
None.
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below, along with default values:
|
||||
|
||||
# The defaults provided by this role are specific to each distribution.
|
||||
java_packages:
|
||||
- java-1.7.0-openjdk
|
||||
|
||||
Set the version/development kit of Java to install, along with any other necessary Java packages. Some other options include are included in the distribution-specific files in this role's 'defaults' folder.
|
||||
|
||||
java_home: ""
|
||||
|
||||
If set, the role will set the global environment variable `JAVA_HOME` to this value.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
||||
|
||||
## Example Playbook (using default package, usually OpenJDK 7)
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- geerlingguy.java
|
||||
|
||||
## Example Playbook (install OpenJDK 8)
|
||||
|
||||
For RHEL / CentOS:
|
||||
|
||||
- hosts: server
|
||||
roles:
|
||||
- role: geerlingguy.java
|
||||
when: "ansible_os_family == 'RedHat'"
|
||||
java_packages:
|
||||
- java-1.8.0-openjdk
|
||||
|
||||
For Ubuntu < 16.04:
|
||||
|
||||
- hosts: server
|
||||
tasks:
|
||||
- name: installing repo for Java 8 in Ubuntu
|
||||
apt_repository: repo='ppa:openjdk-r/ppa'
|
||||
|
||||
- hosts: server
|
||||
roles:
|
||||
- role: geerlingguy.java
|
||||
when: "ansible_os_family == 'Debian'"
|
||||
java_packages:
|
||||
- openjdk-8-jdk
|
||||
|
||||
## 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,6 @@
|
|||
---
|
||||
# Set java_packages if you would like to use a different version than the
|
||||
# default (OpenJDK 1.7).
|
||||
# java_packages: []
|
||||
|
||||
java_home: ""
|
30
box/provisioning/roles/geerlingguy.java/meta/main.yml
Normal file
30
box/provisioning/roles/geerlingguy.java/meta/main.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
author: geerlingguy
|
||||
description: Java for Linux
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "license (BSD, MIT)"
|
||||
min_ansible_version: 2.0
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- name: Fedora
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
- name: FreeBSD
|
||||
versions:
|
||||
- 10.2
|
||||
galaxy_tags:
|
||||
- development
|
||||
- system
|
||||
- web
|
38
box/provisioning/roles/geerlingguy.java/tasks/main.yml
Normal file
38
box/provisioning/roles/geerlingguy.java/tasks/main.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
- name: Include OS-specific variables.
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
when: ansible_distribution != 'Ubuntu' or ansible_distribution != 'Fedora'
|
||||
|
||||
- name: Include OS-specific variables for Fedora.
|
||||
include_vars: "{{ ansible_distribution }}.yml"
|
||||
when: ansible_distribution == 'Fedora'
|
||||
|
||||
- name: Include version-specific variables for Ubuntu.
|
||||
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Define java_packages.
|
||||
set_fact:
|
||||
java_packages: "{{ __java_packages | list }}"
|
||||
when: java_packages is not defined
|
||||
|
||||
# Setup/install tasks.
|
||||
- include: setup-RedHat.yml
|
||||
when: ansible_os_family == 'RedHat'
|
||||
static: no
|
||||
|
||||
- include: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
static: no
|
||||
|
||||
- include: setup-FreeBSD.yml
|
||||
when: ansible_os_family == 'FreeBSD'
|
||||
static: no
|
||||
|
||||
# Environment setup.
|
||||
- name: Set JAVA_HOME if configured.
|
||||
template:
|
||||
src: java_home.sh.j2
|
||||
dest: /etc/profile.d/java_home.sh
|
||||
mode: 0644
|
||||
when: java_home is defined and java_home != ''
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: Ensure Java is installed.
|
||||
apt: "name={{ item }} state=present"
|
||||
with_items: "{{ java_packages }}"
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Ensure Java is installed.
|
||||
pkgng: "name={{ item }} state=present"
|
||||
with_items: "{{ java_packages }}"
|
||||
|
||||
- name: ensure proc is mounted
|
||||
mount: name=/proc fstype=procfs src=proc opts=rw state=mounted
|
||||
|
||||
- name: ensure fdesc is mounted
|
||||
mount: name=/dev/fd fstype=fdescfs src=fdesc opts=rw state=mounted
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: Ensure Java is installed.
|
||||
package: "name={{ item }} state=installed"
|
||||
with_items: "{{ java_packages }}"
|
|
@ -0,0 +1 @@
|
|||
export JAVA_HOME={{ java_home }}
|
11
box/provisioning/roles/geerlingguy.java/tests/test.yml
Normal file
11
box/provisioning/roles/geerlingguy.java/tests/test.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
roles:
|
||||
- role_under_test
|
7
box/provisioning/roles/geerlingguy.java/vars/Debian.yml
Normal file
7
box/provisioning/roles/geerlingguy.java/vars/Debian.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - openjdk-6-jdk
|
||||
# - openjdk-7-jdk
|
||||
__java_packages:
|
||||
- openjdk-7-jdk
|
6
box/provisioning/roles/geerlingguy.java/vars/Fedora.yml
Normal file
6
box/provisioning/roles/geerlingguy.java/vars/Fedora.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - java-1.8.0-openjdk
|
||||
__java_packages:
|
||||
- java-1.8.0-openjdk
|
7
box/provisioning/roles/geerlingguy.java/vars/FreeBSD.yml
Normal file
7
box/provisioning/roles/geerlingguy.java/vars/FreeBSD.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options for FreeBSD include:
|
||||
# - openjdk
|
||||
# - openjdk6
|
||||
# - openjdk8
|
||||
__java_packages:
|
||||
- openjdk
|
7
box/provisioning/roles/geerlingguy.java/vars/RedHat.yml
Normal file
7
box/provisioning/roles/geerlingguy.java/vars/RedHat.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - java-1.6.0-openjdk
|
||||
# - java-1.7.0-openjdk
|
||||
__java_packages:
|
||||
- java-1.7.0-openjdk
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - openjdk-6-jdk
|
||||
# - openjdk-7-jdk
|
||||
__java_packages:
|
||||
- openjdk-7-jdk
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - openjdk-6-jdk
|
||||
# - openjdk-7-jdk
|
||||
__java_packages:
|
||||
- openjdk-7-jdk
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# JDK version options include:
|
||||
# - java
|
||||
# - openjdk-8-jdk
|
||||
# - openjdk-9-jdk
|
||||
__java_packages:
|
||||
- openjdk-8-jdk
|
Loading…
Add table
Add a link
Reference in a new issue