Skip to content

Commit

Permalink
Initial working version
Browse files Browse the repository at this point in the history
  • Loading branch information
memelet committed Mar 22, 2020
0 parents commit a9cb514
Show file tree
Hide file tree
Showing 22 changed files with 551 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VAGRANT_BOXNAME=generic/ubuntu1904
VAGRANT_HOSTNAME=eramba
VAGRANT_IP=192.168.16.42

ERAMBA_TGZ_URL=https://downloadseramba.s3-eu-west-1.amazonaws.com/CommunityTGZ/latest.tgz
ERAMBA_VERSION=c2.8.1 # needed to select the correct database schame file
ERAMBA_WWW_DIR=eramba_community # needed to know directory the tar will extract to

WKHTMLTOPDF_VERSION=0.12.5
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.vagrant/
.data/
.dist/

ansible/playbook.retry
ansible/roles/

# All other idea project files are safe to commit
.idea/workspace.xml
.idea/tasks.xml
.idea/mongoSettings.xml
.idea/watcherTasks.xml
.idea/deployment.xml
.idea/markdown-navigator/
.idea/markdown-exported-files.xml
.idea/markdown-navigator.xml
.idea/sonarlint/issue-store
.idea/sonarlint/
.idea/markdown-navigator*
/.dist/eramba_community/
7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/eramba-vagrant.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/sqldialects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Configure the Host Instance

## Install VirtualBox
As per https://www.virtualbox.org/wiki/Downloads

## Install Vagrant
As per https://www.vagrantup.com/docs/installation/

## Intall Vagrant plugins
```
vagrant plugin install vagrant-env
vagrant plugin install vagrant-hostmanager
```

## Install Python virtualenv
#### Mac OS
```
sudo easy_install pip
sudo pip install --upgrade pip
pip install virtualenv
```

#### Ubuntu/Debian
```
sudo apt install python-virtualenv
```

## Set up Python virtualenv for Ansible
```
mkdir .venvs
virtualenv .venvs/ansible-2.8
source .venvs/ansible-2.8/bin/activate
```

## Install Ansible

https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

*TODO There are probably other host packages that need to be installed*
```
pip install 'ansible==2.8'
```

# Provision Eramba

## Checkout the eramba-vagrant project
```
git clone [email protected]:memelet/eramba-vagrant.git
cd eramba-vagrant
ansible-galaxy install --ignore-errors -r requirements.yml
```

## Create myslq backup directory
This directory will be mounted in the VM to be used as the target for eramba db backups.
```
mkdir -p .data/backups
```

## Install ansible roles
```
ansible-galaxy install -r requirements.yml
```

## Configure variables

Adjust the variables in `.env` as needed.

## Create the eramba instance

```
vagrant up
```

## Open eramba
At http://eramba

(Replace "eramba" with `VAGRANT_HOSTNAME` in .env if changed)

## Setup eramba

As per https://docs.google.com/document/d/1agWTzlJ965N0f-F6dqGxCHsQMaLXa2m1GhCDX1pqXHs

47 changes: 47 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Vagrant.configure("2") do |config|
config.env.enable

config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true

config.vm.box = ENV['VAGRANT_BOXNAME']
config.vm.hostname = ENV['VAGRANT_HOSTNAME']
config.vm.network :private_network, ip: ENV['VAGRANT_IP']
#config.vm.synced_folder ".data/mysql", "#{mysql_datadir}", owner: mysql_group_id, group: mysql_user_id

config.vm.provider :virtualbox do |vb|
vb.name = ENV['VAGRANT_HOSTNAME']
vb.memory = 4096
vb.cpus = 4
vb.linked_clone = true
end

config.vm.provision "os", type: "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "ansible/playbooks/os.yml"
ansible.extra_vars = {}
end

config.vm.provision "mysql", type: "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "ansible/playbooks/mysql.yml"
ansible.extra_vars = {
mysql_vagrant_host_root_access: true
}
end

config.vm.provision "eramba", type: "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "ansible/playbooks/eramba.yml"
ansible.extra_vars = {
apache_servername: ENV['VAGRANT_HOSTNAME'],
eramba_tgz_url: ENV['ERAMBA_TGZ_URL'],
eramba_version: ENV['ERAMBA_VERSION'],
eramba_www_dir: ENV['ERAMBA_WWW_DIR'],
wkhtmltopdf_version: ENV['WKHTMLTOPDF_VERSION']
}
end
end
29 changes: 29 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[defaults]
deprecation_warnings=False

nocows = 1
ansible_managed = This file is managed by ansible, don't make changes here - they will be overwritten.
library = ansible/modules
roles_path = ansible/roles
;filter_plugins = plugins/filter_plugins
;lookup_plugins = plugins/lookup_plugins
;callback_plugins = plugins/callback_plugins
;callback_whitelist = timer
;vault_password_file = ~/.ansible/vault-password
force_color = 1
forks = 10
timeout = 240
host_key_checking = False
scp_if_ssh = True
gathering = smart
gather_subset = all
retry_files_enabled = no
[ssh_connection]
pipelining = true
ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=~/.ssh/ansible-%r@%h:%p
5 changes: 5 additions & 0 deletions ansible/inventory/local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all:
hosts:
localhost:
ansible_connection: local
ansible_python_interpreter: "{{ ansible_playbook_python }}"
10 changes: 10 additions & 0 deletions ansible/playbooks/_dockerhub-login.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- assert:
that:
- dockerhub_username is defined and dockerhub_username|trim != ""
- dockerhub_password is defined and dockerhub_password|trim != ""
fail_msg: "variables 'dockerhub_username' and 'dockerhub_password' must be defined"

- name: login to dockerhub
docker_login:
username: "{{ dockerhub_username }}"
password: "{{ dockerhub_password }}"
Loading

0 comments on commit a9cb514

Please sign in to comment.