Skip to content

Commit ef71565

Browse files
committed
Add Binder playbook
With stable/0.8.x and qa/0.9.x options. Add default ES config versions in AtoM playbooks.
1 parent 246a740 commit ef71565

12 files changed

+521
-0
lines changed

playbooks/atom-trusty/vars-singlenode.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ atom_config_db_password: "ATOMPASSWORD"
1616
atom_config_db_port: "3306"
1717
atom_es_host: "127.0.0.1"
1818
atom_es_port: "9200"
19+
atom_es_config_version: "2.4"
1920
atom_mysql_user_name: "atom-user"
2021
atom_mysql_user_pass: "ATOMPASSWORD"
2122
atom_mysql_user_priv: "atom.*:ALL,GRANT"

playbooks/atom-xenial/vars-singlenode.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ atom_config_db_password: "ATOMPASSWORD"
1616
atom_config_db_port: "3306"
1717
atom_es_host: "127.0.0.1"
1818
atom_es_port: "9200"
19+
atom_es_config_version: "2.5"
1920
atom_mysql_user_name: "atom-user"
2021
atom_mysql_user_pass: "ATOMPASSWORD"
2122
atom_mysql_user_priv: "atom.*:ALL,GRANT"

playbooks/binder/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/roles
2+
/.vagrant
3+
/src

playbooks/binder/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# AtoM Playbook
2+
3+
The provided playbook installs AtoM on a local Vagrant virtual machine.
4+
5+
## Requirements
6+
7+
- Vagrant 1.8.0 or newer
8+
- Ansible 2.0.0 or newer
9+
10+
## How to use
11+
12+
Dowload the Ansible roles
13+
14+
$ ansible-galaxy install -f -p roles/ -r requirements.yml
15+
16+
Create the virtual machine and provision it:
17+
18+
$ vagrant up
19+
20+
To ssh to the VM, run:
21+
22+
$ vagrant ssh
23+
24+
If you want to forward your SSH agent too, run:
25+
26+
$ vagrant ssh -- -A
27+
28+
To (re-)provision the VM, using Vagrant:
29+
30+
$ vagrant provision
31+
32+
To (re-)provision the VM, using Ansible commands directly:
33+
34+
$ ansible-playbook singlenode.yml
35+
--inventory-file=".vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory" \
36+
--user="vagrant" \
37+
--private-key=".vagrant/machines/atom-local/virtualbox/private_key" \
38+
--extra-vars="atom_dir=/vagrant/src atom_environment_type=development" \
39+
--verbose
40+
41+
To (re-)provision the VM, passing your own arguments to `Ansible`:
42+
43+
$ ANSIBLE_ARGS="--tags=elasticsearch,percona,percona-client,memcached,gearman,nginx" vagrant provision

playbooks/binder/Vagrantfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8+
9+
config.vm.box = ENV.fetch("VAGRANT_BOX", "ubuntu/trusty64")
10+
11+
{
12+
"binder-local" => {
13+
"ip" => "192.168.168.195",
14+
"memory" => "2048",
15+
"cpus" => "2",
16+
},
17+
}.each do |short_name, properties|
18+
19+
# Define guest
20+
config.vm.define short_name do |host|
21+
host.vm.network "private_network", ip: properties.fetch("ip")
22+
host.vm.hostname = "#{short_name}.myapp.dev"
23+
end
24+
25+
# Set the amount of RAM and virtual CPUs for the virtual machine
26+
config.vm.provider :virtualbox do |vb|
27+
vb.customize ["modifyvm", :id, "--memory", properties.fetch("memory")]
28+
vb.customize ["modifyvm", :id, "--cpus", properties.fetch("cpus")]
29+
end
30+
31+
end
32+
33+
config.vm.synced_folder "src/atom", "/usr/share/nginx/atom", create: true
34+
35+
# Ansible provisioning
36+
config.vm.provision :ansible do |ansible|
37+
ansible.playbook = "./singlenode-qa.yml"
38+
ansible.host_key_checking = false
39+
ansible.extra_vars = {
40+
"atom_user" => "vagrant",
41+
"atom_group" => "vagrant",
42+
"atom_environment_type" => "development",
43+
"atom_flush_data" => "yes",
44+
"elasticsearch_network_bind_host" => "0.0.0.0"
45+
}
46+
ansible.verbose = 'v'
47+
ansible.raw_arguments = ENV['ANSIBLE_ARGS']
48+
end
49+
50+
end

playbooks/binder/ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
nocows=1

playbooks/binder/requirements-0.8.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
3+
- src: "https://github.com/artefactual-labs/ansible-elasticsearch"
4+
version: "master"
5+
name: "artefactual.elasticsearch"
6+
path: "roles/"
7+
8+
- src: "https://github.com/artefactual-labs/ansible-percona"
9+
version: "master"
10+
name: "artefactual.percona"
11+
path: "roles/"
12+
13+
- src: "https://github.com/artefactual-labs/ansible-percona-client"
14+
version: "master"
15+
name: "artefactual.percona-client"
16+
path: "roles/"
17+
18+
- src: "https://github.com/artefactual-labs/ansible-memcached"
19+
version: "master"
20+
name: "artefactual.memcached"
21+
path: "roles/"
22+
23+
- src: "https://github.com/artefactual-labs/ansible-gearman"
24+
version: "master"
25+
name: "artefactual.gearman"
26+
path: "roles/"
27+
28+
- src: "https://github.com/artefactual-labs/ansible-nginx"
29+
version: "master"
30+
name: "artefactual.nginx"
31+
path: "roles/"
32+
33+
- src: "https://github.com/artefactual-labs/ansible-atom"
34+
version: "dev/binder-stable-qa"
35+
name: "artefactual.atom"
36+
path: "roles/"

playbooks/binder/requirements-qa.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
- src: "https://github.com/geerlingguy/ansible-role-java"
3+
version: "master"
4+
name: "geerlingguy.java"
5+
path: "roles/"
6+
7+
- src: "https://github.com/elastic/ansible-elasticsearch"
8+
version: "master"
9+
name: "elastic.elasticsearch"
10+
path: "roles/"
11+
12+
- src: "https://github.com/artefactual-labs/ansible-percona"
13+
version: "master"
14+
name: "artefactual.percona"
15+
path: "roles/"
16+
17+
- src: "https://github.com/artefactual-labs/ansible-percona-client"
18+
version: "master"
19+
name: "artefactual.percona-client"
20+
path: "roles/"
21+
22+
- src: "https://github.com/artefactual-labs/ansible-memcached"
23+
version: "master"
24+
name: "artefactual.memcached"
25+
path: "roles/"
26+
27+
- src: "https://github.com/artefactual-labs/ansible-gearman"
28+
version: "master"
29+
name: "artefactual.gearman"
30+
path: "roles/"
31+
32+
- src: "https://github.com/artefactual-labs/ansible-nginx"
33+
version: "master"
34+
name: "artefactual.nginx"
35+
path: "roles/"
36+
37+
- src: "https://github.com/artefactual-labs/ansible-atom"
38+
version: "dev/binder-stable-qa"
39+
name: "artefactual.atom"
40+
path: "roles/"

playbooks/binder/singlenode-0.8.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
- hosts: "binder-local"
3+
4+
pre_tasks:
5+
6+
- include_vars: "vars-singlenode-0.8.yml"
7+
tags:
8+
- "always"
9+
10+
roles:
11+
12+
- role: "artefactual.elasticsearch"
13+
become: "yes"
14+
tags:
15+
- "elasticsearch"
16+
17+
- role: "artefactual.percona"
18+
become: "yes"
19+
tags:
20+
- "percona"
21+
22+
- role: "artefactual.percona-client"
23+
become: "yes"
24+
tags:
25+
- "percona-client"
26+
27+
- role: "artefactual.memcached"
28+
become: "yes"
29+
tags:
30+
- "memcached"
31+
32+
- role: "artefactual.gearman"
33+
become: "yes"
34+
tags:
35+
- "gearman"
36+
37+
- role: "artefactual.nginx"
38+
become: "yes"
39+
tags:
40+
- "nginx"
41+
42+
- role: "artefactual.atom"
43+
become: "yes"
44+
tags:
45+
- "atom"

playbooks/binder/singlenode-qa.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
- hosts: "binder-local"
3+
4+
pre_tasks:
5+
6+
- include_vars: "vars-singlenode-qa.yml"
7+
tags:
8+
- "always"
9+
10+
- name: "Installing PPA for Java 8"
11+
apt_repository: "repo='ppa:openjdk-r/ppa'"
12+
become: "yes"
13+
tags:
14+
- "always"
15+
16+
roles:
17+
18+
- role: "geerlingguy.java"
19+
become: "yes"
20+
tags:
21+
- "java"
22+
23+
- role: "elastic.elasticsearch"
24+
become: "yes"
25+
tags:
26+
- "elasticsearch"
27+
28+
- role: "artefactual.percona"
29+
become: "yes"
30+
tags:
31+
- "percona"
32+
33+
- role: "artefactual.percona-client"
34+
become: "yes"
35+
tags:
36+
- "percona-client"
37+
38+
- role: "artefactual.memcached"
39+
become: "yes"
40+
tags:
41+
- "memcached"
42+
43+
- role: "artefactual.gearman"
44+
become: "yes"
45+
tags:
46+
- "gearman"
47+
48+
- role: "artefactual.nginx"
49+
become: "yes"
50+
tags:
51+
- "nginx"
52+
53+
- role: "artefactual.atom"
54+
become: "yes"
55+
tags:
56+
- "atom"

0 commit comments

Comments
 (0)