diff --git a/group_vars/all b/group_vars/all index c05fb6d..1df9f87 100644 --- a/group_vars/all +++ b/group_vars/all @@ -6,3 +6,4 @@ docker_ce_version_to_install: 17.06.0~ce-0~ubuntu 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 diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index a1ffc29..465114d 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -42,24 +42,30 @@ - linux-headers-server - tmux +- name: Add standard_user to docker group + user: + name: {{ standard_user }} + groups: docker + append: yes + - name: Set authorized key took from url become: yes - become_user: cody + become_user: {{ standard_user }} authorized_key: - user: cody + user: {{ standard_user }} state: present key: {{ home_pub_key }} - git_config: become: yes - become_user: cody + become_user: {{ standard_user }} name: user.name scope: local - value: 'Jacob Cody Wimer' + value: 'Jacob {{ standard_user }} Wimer' - git_config: become: yes - become_user: cody + become_user: {{ standard_user }} name: user.email scope: local value: 'jacob.wimer@gmail.com' @@ -84,14 +90,7 @@ name: America/New_York - name: Replace sudoers file - template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers - -- name: Replace fstab file - lineinfile: dest=/etc/fstab - regexp="^{{ nfs_location }}" - state=present - line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults 0 0" - + 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 @@ -104,7 +103,13 @@ - name: Creates directory file: path=/data state=directory -- name: Mount data directory +- name: USB lab data in fstab + lineinfile: dest=/etc/fstab + regexp="^{{ nfs_location }}:/volumeUSB1" + state=present + line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults 0 0" + +- name: Mount USB lab data directory mount: path: /data src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data diff --git a/roles/developer-machine/tasks/main.yml b/roles/developer-machine/tasks/main.yml index 9b04d15..308034d 100644 --- a/roles/developer-machine/tasks/main.yml +++ b/roles/developer-machine/tasks/main.yml @@ -2,20 +2,20 @@ # This playbook contains plays that will run on developer-machines - name: Is rvm installed - stat: path=/home/cody/.rvm + stat: path=/home/{{ standard_user }}/.rvm register: rvm_installed - name: Install rvm key shell: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 when: not rvm_installed.stat.exists become: true - become_user: cody + become_user: {{ standard_user }} - name: Install rvm and latest ruby shell: \curl -sSL https://get.rvm.io | bash -s stable when: not rvm_installed.stat.exists become: true - become_user: cody + become_user: {{ standard_user }} - name: Is heroku installed shell: which heroku @@ -37,62 +37,56 @@ - name: Install other apt items apt: name={{ item }} state=present with_items: - - siege - - vim - - tmux - - apache2-utils - xrdp - - ack-grep - tmate - nodejs - npm - name: Install localtunnel - shell: npm install -g localtunnel - -- name: Pathogen installed - stat: path=/home/cody/.vim/autoload/pathogen.vim - register: pathogen_installed + npm: + name: localtunnel + global: yes - name: Create vim autoload directory - file: path=/home/cody/.vim/autoload state=directory + file: path=/home/{{ standard_user }}/.vim/autoload state=directory become: yes - become_user: cody + become_user: {{ standard_user }} - name: Create vim bundle directory - file: path=/home/cody/.vim/bundle state=directory + file: path=/home/{{ standard_user }}/.vim/bundle state=directory become: yes - become_user: cody + become_user: {{ standard_user }} - name: Install pathogen - shell: curl -LSso /home/cody/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim - when: not pathogen_installed.stat.exists become: yes - become_user: cody - -- name: Replace .vimrc - template: src=../roles/developer-machine/templates/vimrc.j2 dest=/home/cody/.vimrc - become: yes - become_user: cody - -- name: Nerdtree installed - stat: path=/home/cody/.vim/bundle/nerdtree - register: nerdtree_installed + become_user: {{ standard_user }} + git: repo=https://github.com/tpope/vim-pathogen.git + dest=/home/{{ standard_user }}/.vim/autoload/pathogen.vim - name: Install nerdtree git: repo=https://github.com/scrooloose/nerdtree.git - dest=/home/cody/.vim/bundle/nerdtree - when: not nerdtree_installed.stat.exists + dest=/home/{{ standard_user }}/.vim/bundle/nerdtree become: yes - become_user: cody + become_user: {{ standard_user }} -- name: Replace fstab file - template: src=../roles/developer-machine/templates/fstab.j2 dest=/etc/fstab +- name: Replace .vimrc + template: src=../roles/developer-machine/templates/vimrc.j2 dest=/home/{{ standard_user }}/.vimrc + become: yes + become_user: {{ standard_user }} - name: Creates directory file: path=/data state=directory -- name: Mount data directory - shell: mount 10.0.0.150:/volumeUSB1/usbshare/raw-files /data - ignore_errors: yes +- name: USB raw files in fstab + lineinfile: dest=/etc/fstab + regexp="^{{ nfs_location }}:/volumeUSB1" + state=present + line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files /data nfs defaults 0 0" + +- name: Mount USB raw files to data directory + mount: + path: /data + src: 10.0.0.150:/volumeUSB1/usbshare/raw-files + state: present + diff --git a/roles/developer-machine/templates/fstab.j2 b/roles/developer-machine/templates/fstab.j2 deleted file mode 100644 index 462f472..0000000 --- a/roles/developer-machine/templates/fstab.j2 +++ /dev/null @@ -1,12 +0,0 @@ -# /etc/fstab: static file system information. -# -# Use 'blkid' to print the universally unique identifier for a -# device; this may be used with UUID= as a more robust way to name devices -# that works even if disks are added and removed. See fstab(5). -# -# -# / was on /dev/sda1 during installation -UUID=a4a5a54f-1022-47b3-9c50-77c6139d7fc9 / ext4 errors=remount-ro 0 1 -# swap was on /dev/sda5 during installation -UUID=0f47da63-9d7d-487c-8b99-ea7d5497f7f7 none swap sw 0 0 -10.0.0.150:/volumeUSB1/usbshare/raw-files /data nfs defaults 0 0 \ No newline at end of file