diff --git a/Vagrantfile b/Vagrantfile index bc6e23f..eba9d18 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,11 +5,10 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", path: "provision.sh" config.vm.define "node01" do |node01| - #node01.vm.network "private_network", ip: "192.168.33.10" node01.vm.network "public_network" end - #config.vm.define "node02" do |node02| - # node02.vm.network "private_network", ip: "192.168.33.11" - #end + config.vm.define "node02" do |node02| + node01.vm.network "public_network" + end end \ No newline at end of file diff --git a/ansible/inventory.ini b/ansible/inventory.ini deleted file mode 100644 index 420ccfd..0000000 --- a/ansible/inventory.ini +++ /dev/null @@ -1,8 +0,0 @@ -[mongodb] -ubuntu-512mb-nyc3-01 -ubuntu-512mb-ams3-01 -ubuntu-512mb-sfo1-01 -ubuntu-512mb-sgp1-01 -ubuntu-512mb-lon1-01 -ubuntu-512mb-fra1-01 -ubuntu-512mb-tor1-01 diff --git a/ansible/meshbird.yml b/ansible/meshbird.yml deleted file mode 100644 index 8a27c16..0000000 --- a/ansible/meshbird.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: all - vars: - MESHBIRD_KEY: 77cdb4790754e187a8e41fdcde0cee8c0a070000ffff0000 - roles: - - meshbird diff --git a/ansible/meshbird_off.yml b/ansible/meshbird_off.yml deleted file mode 100644 index 64c8dce..0000000 --- a/ansible/meshbird_off.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- hosts: all - vars: - MESHBIRD_KEY: 77cdb4790754e187a8e41fdcde0cee8c0a070000ffff0000 - tasks: - - service: name=meshbird state=stopped - - shell: 'rm -rf .meshbird_*.json' diff --git a/ansible/playbook.yml b/ansible/playbook.yml deleted file mode 100644 index dcad2a7..0000000 --- a/ansible/playbook.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- hosts: all - vars: - mongodb_replSet: 'meshbird' - roles: - - golang - - mongodb diff --git a/ansible/roles/golang/defaults/main.yml b/ansible/roles/golang/defaults/main.yml deleted file mode 100644 index 809db06..0000000 --- a/ansible/roles/golang/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -go_tarball: "go1.5.3.linux-amd64.tar.gz" -go_tarball_checksum: "43afe0c5017e502630b1aea4d44b8a7f059bf60d7f29dfd58db454d4e4e0ae53" -go_version_target: "go version go1.5.3 linux/amd64" \ No newline at end of file diff --git a/ansible/roles/golang/files/go-bin.sh b/ansible/roles/golang/files/go-bin.sh deleted file mode 100644 index 680c12a..0000000 --- a/ansible/roles/golang/files/go-bin.sh +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PATH:/usr/local/go/bin diff --git a/ansible/roles/golang/files/go-path.sh b/ansible/roles/golang/files/go-path.sh deleted file mode 100644 index 178c34b..0000000 --- a/ansible/roles/golang/files/go-path.sh +++ /dev/null @@ -1,2 +0,0 @@ -export GOPATH=$HOME/go -export PATH=$GOPATH/bin:$PATH \ No newline at end of file diff --git a/ansible/roles/golang/tasks/main.yml b/ansible/roles/golang/tasks/main.yml deleted file mode 100644 index f903492..0000000 --- a/ansible/roles/golang/tasks/main.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: Download the Go tarball - get_url: url={{ go_download_location }} - dest=/usr/local/src/{{ go_tarball }} - sha256sum={{ go_tarball_checksum }} - tags: - - packages - -- name: Register the current Go version (if any) - command: /usr/local/go/bin/go version - ignore_errors: yes - register: go_version - changed_when: false - tags: - - packages - -- name: Extract the Go tarball if Go is not yet installed or if it is not the desired version - command: tar -C /usr/local -xf /usr/local/src/{{ go_tarball }} - when: go_version|failed or go_version.stdout != go_version_target - tags: - - packages - -- name: Add the Go bin directory to the PATH environment variable for all users - copy: src=go-bin.sh - dest=/etc/profile.d - tags: - - packages - -- name: Set GOPATH for all users - copy: src=go-path.sh - dest=/etc/profile.d - tags: - - packages - -- name: Creare go folders - file: path={{ item }} state=directory mode=0755 - with_items: - - go/src - - go/pkg - - go/bin - tags: - - configuration diff --git a/ansible/roles/golang/vars/main.yml b/ansible/roles/golang/vars/main.yml deleted file mode 100644 index ed1dbd3..0000000 --- a/ansible/roles/golang/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -go_download_location: "http://golang.org/dl/{{ go_tarball }}" diff --git a/ansible/roles/meshbird/tasks/main.yml b/ansible/roles/meshbird/tasks/main.yml deleted file mode 100644 index 5741e89..0000000 --- a/ansible/roles/meshbird/tasks/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: install meshbird - shell: 'curl http://meshbird.com/install.sh | sh' - -- name: install upstart - template: src=upstart.conf.j2 dest=/etc/init/meshbird.conf owner=root group=root mode=0644 - -- name: start meshbird - service: name=meshbird state=restarted - -- name: restart mongo - service: name=mongod state=restarted - -- name: get ip - shell: 'MESHBIRD_KEY=77cdb4790754e187a8e41fdcde0cee8c0a070000ffff0000 meshbird ip >> /etc/motd.tail' diff --git a/ansible/roles/meshbird/templates/upstart.conf.j2 b/ansible/roles/meshbird/templates/upstart.conf.j2 deleted file mode 100644 index b8a0738..0000000 --- a/ansible/roles/meshbird/templates/upstart.conf.j2 +++ /dev/null @@ -1,12 +0,0 @@ -description "Meshbird - distributed private networking" -author "meshbird.com" - -env MESHBIRD_KEY="{{MESHBIRD_KEY}}" - -respawn -respawn limit 15 5 - -start on runlevel [2345] -stop on runlevel [06] - -exec /usr/local/bin/meshbird join 2>&1 >> /var/log/meshbird.log diff --git a/ansible/roles/mongodb/defaults/main.yml b/ansible/roles/mongodb/defaults/main.yml deleted file mode 100644 index 61499b0..0000000 --- a/ansible/roles/mongodb/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -mongodb_version: '3.2.0' -mongodb_user: 'mongodb' -mongodb_group: 'mongodb' -mongodb_dbPath: '/data/db' diff --git a/ansible/roles/mongodb/handlers/main.yml b/ansible/roles/mongodb/handlers/main.yml deleted file mode 100644 index af36cb5..0000000 --- a/ansible/roles/mongodb/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: restart mongodb - service: name=mongod state=restarted diff --git a/ansible/roles/mongodb/tasks/main.yml b/ansible/roles/mongodb/tasks/main.yml deleted file mode 100644 index 863e69b..0000000 --- a/ansible/roles/mongodb/tasks/main.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: Add mongo key - apt_key: keyserver="hkp://keyserver.ubuntu.com:80" id="7F0CEB10" state=present - tags: - - packages - -- name: Add mongodb repository - apt_repository: repo="deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.0 multiverse" state=present update_cache=true - tags: - - packages - -- name: Install mongodb - apt: "name=mongodb-org={{ mongodb_version }} state=present" - notify: - - restart mongodb - tags: - - packages - -- name: Create mongodb data folder - file: path={{ mongodb_dbPath }} state=directory mode=0755 owner={{ mongodb_user }} group={{ mongodb_group }} - when: mongodb_dbPath is defined - tags: - - configuration - -- name: Write mongod.conf - template: src=mongod.conf.j2 dest=/etc/mongod.conf owner={{ mongodb_user }} group={{ mongodb_group }} mode=0644 - notify: - - restart mongodb - tags: - - configuration - -- name: Mongodb service state - service: name=mongod state=started enabled=yes - tags: - - configuration diff --git a/ansible/roles/mongodb/templates/mongod.conf.j2 b/ansible/roles/mongodb/templates/mongod.conf.j2 deleted file mode 100644 index 7134c5f..0000000 --- a/ansible/roles/mongodb/templates/mongod.conf.j2 +++ /dev/null @@ -1,33 +0,0 @@ -systemLog: - destination: file - path: "{{ mongodb_logpath | default('/var/log/mongodb/mongod.log') }}" - logAppend: {{ mongodb_logappend | default('true') }} - verbosity: {{ mongodb_verbosity | default('0') }} - quiet: {{ mongodb_quiet | default('false') }} -processManagement: -{% if mongodb_pidfilepath is defined %} - pidFilePath: {{ mongodb_pidfilepath }} -{% endif %} - fork: true -net: - bindIp: {{ mongodb_bind_ip | default('0.0.0.0') }} -{% if mongodb_replSet is defined %} -replication: - replSetName: "{{ mongodb_replSet }}" -{% endif %} -storage: - dbPath: {{ mongodb_dbPath | default('/data/db/') }} - directoryPerDB: {{ mongodb_directoryPerDB | default('true')}} - journal: - enabled: {{ mongodb_journal_enabled | default('true')}} - engine: "wiredTiger" - wiredTiger: - engineConfig: -{% if mongodb_cacheSizeGB is defined %} - cacheSizeGB: {{ mongodb_cacheSizeGB }} -{% endif %} - journalCompressor: snappy - collectionConfig: - blockCompressor: snappy - indexConfig: - prefixCompression: true diff --git a/provision.sh b/provision.sh index 3ec5193..14682f5 100755 --- a/provision.sh +++ b/provision.sh @@ -8,8 +8,8 @@ rm -f go1.5.3.linux-amd64.tar.gz echo "" >> /home/vagrant/.profile echo "export PATH=\$PATH:/usr/local/go/bin:/home/vagrant/go/bin" >> /home/vagrant/.profile echo "export GOPATH=/home/vagrant/go" >> /home/vagrant/.profile -mkdir -p /home/vagrant/go/src/github.com/gophergala2016 +mkdir -p /home/vagrant/go/src/github.com/meshbird mkdir -p /home/vagrant/go/pkg mkdir -p /home/vagrant/go/bin -ln -s /vagrant /home/vagrant/go/src/github.com/gophergala2016/meshbird +ln -s /vagrant /home/vagrant/go/src/github.com/meshbird/meshbird chown -R vagrant:vagrant /home/vagrant/go