Replaced localtunnel with ngrok, changed the supporting scripts pathing, add vars for git, fixed pathing for nfs mounts

This commit is contained in:
2017-12-21 08:48:16 -05:00
parent 37bdbae2df
commit 70383357b8
4 changed files with 36 additions and 21 deletions

View File

@@ -1,11 +1,13 @@
---
# Variables listed here are applicable to all host groups
docker_compose_version_to_install: 1.14.0
docker_ce_version_to_install: 17.06.0~ce-0~ubuntu
docker_compose_version_to_install: 1.18.0
docker_ce_version_to_install: 17.09.1~ce-0~ubuntu
nvm_version: v0.33.5
node_version: 8.4.0
registry_location: "registry.wimer.local:5000"
nfs_location: 10.0.0.150
home_pub_key: https://raw.githubusercontent.com/jcwimer/ubuntu-template/master/post/id_rsa.pub
standard_user: cody
git_user: "Jacob Cody Wimer"
git_email: "jacob.wimer@gmail.com"

View File

@@ -56,13 +56,13 @@
- git_config:
name: user.name
value: 'Jacob {{ standard_user }} Wimer'
value: "{{ git_user }}"
become: yes
become_user: "{{ standard_user }}"
- git_config:
name: user.email
value: 'jacob.wimer@gmail.com'
value: "{{ git_email }}"
become: yes
become_user: "{{ standard_user }}"
@@ -77,14 +77,14 @@
name: America/New_York
- name: Replace sudoers file
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
- name: Replace docker daemon file
template: src=../roles/common/templates/docker-daemon.json.j2 dest=/etc/docker/daemon.json
register: dockerdaemon
- name: Restart docker if daemon changes
service:
service:
name: docker
state: restarted
when: dockerdaemon.changed
@@ -92,13 +92,19 @@
- name: Creates directory
file: path=/data state=directory
- name: Data is mounted
stat: path=/data/swarm
register: data_mounted
- name: USB lab data in fstab
when: not data_mounted.stat.exists
lineinfile: dest=/etc/fstab
regexp="^{{ nfs_location }}:/volumeUSB1"
regexp=\/data
state=present
line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults 0 0"
- name: Mount USB lab data directory
when: not data_mounted.stat.exists
mount:
path: /data
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data
@@ -112,7 +118,7 @@
- name: create swapfile
when: swapfile|failed
shell: fallocate -l 4G /swapfile
shell: fallocate -l 4G /swapfile
- name: set swapfile permissions
when: swapfile|failed

View File

@@ -70,12 +70,12 @@
- name: Install pathogen
become: yes
become_user: "{{ standard_user }}"
git:
git:
repo: https://github.com/tpope/vim-pathogen.git
dest: /home/{{ standard_user }}/.vim/autoload/pathogen.vim
- name: Install nerdtree
git:
git:
repo: https://github.com/scrooloose/nerdtree.git
dest: /home/{{ standard_user }}/.vim/bundle/nerdtree
become: yes
@@ -87,25 +87,30 @@
become_user: "{{ standard_user }}"
- name: Creates directory
file: path=/data state=directory
file: path=/raw-files state=directory
- name: Raw files is mounted
stat: path=/raw-files/backups
register: raw_mounted
- name: USB raw files in fstab
when: not raw_mounted.stat.exists
lineinfile: dest=/etc/fstab
regexp="^{{ nfs_location }}:/volumeUSB1"
regexp=\/raw-files
state=present
line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files /data nfs defaults 0 0"
line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files /raw-files nfs defaults 0 0"
- name: Mount USB raw files to data directory
when: not raw_mounted.stat.exists
mount:
path: /data
path: /raw-files
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files
state: present
fstype: nfs
- name: Install localtunnel
- name: Install ngrok
npm:
name: localtunnel
global: yes
executable: /home/{{ standard_user }}/.nvm/versions/node/v{{ node_version }}/bin/npm
name: ngrok
global: true
environment:
PATH: "/home/{{ standard_user }}/.nvm/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"

View File

@@ -1,2 +1,4 @@
#!/bin/bash
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts playbooks/site.yml --check --diff
#keep adding dirname's to go up more directories.
project_dir="$(dirname $( dirname $(readlink -f ${BASH_SOURCE[0]})))"
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i ${project_dir}/hosts ${project_dir}/playbooks/site.yml --check --diff