Skip to content

Commit

Permalink
Add Binder playbook
Browse files Browse the repository at this point in the history
With stable/0.8.x and qa/0.9.x options. Add default ES config versions
in AtoM playbooks.
  • Loading branch information
jraddaoui committed Apr 3, 2018
1 parent 246a740 commit ef71565
Show file tree
Hide file tree
Showing 12 changed files with 521 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/atom-trusty/vars-singlenode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ atom_config_db_password: "ATOMPASSWORD"
atom_config_db_port: "3306"
atom_es_host: "127.0.0.1"
atom_es_port: "9200"
atom_es_config_version: "2.4"
atom_mysql_user_name: "atom-user"
atom_mysql_user_pass: "ATOMPASSWORD"
atom_mysql_user_priv: "atom.*:ALL,GRANT"
Expand Down
1 change: 1 addition & 0 deletions playbooks/atom-xenial/vars-singlenode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ atom_config_db_password: "ATOMPASSWORD"
atom_config_db_port: "3306"
atom_es_host: "127.0.0.1"
atom_es_port: "9200"
atom_es_config_version: "2.5"
atom_mysql_user_name: "atom-user"
atom_mysql_user_pass: "ATOMPASSWORD"
atom_mysql_user_priv: "atom.*:ALL,GRANT"
Expand Down
3 changes: 3 additions & 0 deletions playbooks/binder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/roles
/.vagrant
/src
43 changes: 43 additions & 0 deletions playbooks/binder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AtoM Playbook

The provided playbook installs AtoM on a local Vagrant virtual machine.

## Requirements

- Vagrant 1.8.0 or newer
- Ansible 2.0.0 or newer

## How to use

Dowload the Ansible roles

$ ansible-galaxy install -f -p roles/ -r requirements.yml

Create the virtual machine and provision it:

$ vagrant up

To ssh to the VM, run:

$ vagrant ssh

If you want to forward your SSH agent too, run:

$ vagrant ssh -- -A

To (re-)provision the VM, using Vagrant:

$ vagrant provision

To (re-)provision the VM, using Ansible commands directly:

$ ansible-playbook singlenode.yml
--inventory-file=".vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory" \
--user="vagrant" \
--private-key=".vagrant/machines/atom-local/virtualbox/private_key" \
--extra-vars="atom_dir=/vagrant/src atom_environment_type=development" \
--verbose

To (re-)provision the VM, passing your own arguments to `Ansible`:

$ ANSIBLE_ARGS="--tags=elasticsearch,percona,percona-client,memcached,gearman,nginx" vagrant provision
50 changes: 50 additions & 0 deletions playbooks/binder/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.box = ENV.fetch("VAGRANT_BOX", "ubuntu/trusty64")

{
"binder-local" => {
"ip" => "192.168.168.195",
"memory" => "2048",
"cpus" => "2",
},
}.each do |short_name, properties|

# Define guest
config.vm.define short_name do |host|
host.vm.network "private_network", ip: properties.fetch("ip")
host.vm.hostname = "#{short_name}.myapp.dev"
end

# Set the amount of RAM and virtual CPUs for the virtual machine
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", properties.fetch("memory")]
vb.customize ["modifyvm", :id, "--cpus", properties.fetch("cpus")]
end

end

config.vm.synced_folder "src/atom", "/usr/share/nginx/atom", create: true

# Ansible provisioning
config.vm.provision :ansible do |ansible|
ansible.playbook = "./singlenode-qa.yml"
ansible.host_key_checking = false
ansible.extra_vars = {
"atom_user" => "vagrant",
"atom_group" => "vagrant",
"atom_environment_type" => "development",
"atom_flush_data" => "yes",
"elasticsearch_network_bind_host" => "0.0.0.0"
}
ansible.verbose = 'v'
ansible.raw_arguments = ENV['ANSIBLE_ARGS']
end

end
2 changes: 2 additions & 0 deletions playbooks/binder/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
nocows=1
36 changes: 36 additions & 0 deletions playbooks/binder/requirements-0.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---

- src: "https://github.com/artefactual-labs/ansible-elasticsearch"
version: "master"
name: "artefactual.elasticsearch"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-percona"
version: "master"
name: "artefactual.percona"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-percona-client"
version: "master"
name: "artefactual.percona-client"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-memcached"
version: "master"
name: "artefactual.memcached"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-gearman"
version: "master"
name: "artefactual.gearman"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-nginx"
version: "master"
name: "artefactual.nginx"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-atom"
version: "dev/binder-stable-qa"
name: "artefactual.atom"
path: "roles/"
40 changes: 40 additions & 0 deletions playbooks/binder/requirements-qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- src: "https://github.com/geerlingguy/ansible-role-java"
version: "master"
name: "geerlingguy.java"
path: "roles/"

- src: "https://github.com/elastic/ansible-elasticsearch"
version: "master"
name: "elastic.elasticsearch"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-percona"
version: "master"
name: "artefactual.percona"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-percona-client"
version: "master"
name: "artefactual.percona-client"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-memcached"
version: "master"
name: "artefactual.memcached"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-gearman"
version: "master"
name: "artefactual.gearman"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-nginx"
version: "master"
name: "artefactual.nginx"
path: "roles/"

- src: "https://github.com/artefactual-labs/ansible-atom"
version: "dev/binder-stable-qa"
name: "artefactual.atom"
path: "roles/"
45 changes: 45 additions & 0 deletions playbooks/binder/singlenode-0.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
- hosts: "binder-local"

pre_tasks:

- include_vars: "vars-singlenode-0.8.yml"
tags:
- "always"

roles:

- role: "artefactual.elasticsearch"
become: "yes"
tags:
- "elasticsearch"

- role: "artefactual.percona"
become: "yes"
tags:
- "percona"

- role: "artefactual.percona-client"
become: "yes"
tags:
- "percona-client"

- role: "artefactual.memcached"
become: "yes"
tags:
- "memcached"

- role: "artefactual.gearman"
become: "yes"
tags:
- "gearman"

- role: "artefactual.nginx"
become: "yes"
tags:
- "nginx"

- role: "artefactual.atom"
become: "yes"
tags:
- "atom"
56 changes: 56 additions & 0 deletions playbooks/binder/singlenode-qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
- hosts: "binder-local"

pre_tasks:

- include_vars: "vars-singlenode-qa.yml"
tags:
- "always"

- name: "Installing PPA for Java 8"
apt_repository: "repo='ppa:openjdk-r/ppa'"
become: "yes"
tags:
- "always"

roles:

- role: "geerlingguy.java"
become: "yes"
tags:
- "java"

- role: "elastic.elasticsearch"
become: "yes"
tags:
- "elasticsearch"

- role: "artefactual.percona"
become: "yes"
tags:
- "percona"

- role: "artefactual.percona-client"
become: "yes"
tags:
- "percona-client"

- role: "artefactual.memcached"
become: "yes"
tags:
- "memcached"

- role: "artefactual.gearman"
become: "yes"
tags:
- "gearman"

- role: "artefactual.nginx"
become: "yes"
tags:
- "nginx"

- role: "artefactual.atom"
become: "yes"
tags:
- "atom"
Loading

0 comments on commit ef71565

Please sign in to comment.