124 lines
3.4 KiB
YAML
124 lines
3.4 KiB
YAML
---
|
|
# This playbook contains plays that will run on developer-machines
|
|
|
|
- name: Is rvm installed
|
|
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: "{{ 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: "{{ standard_user }}"
|
|
|
|
- name: install heroku apt key
|
|
apt_key: url='https://toolbelt.heroku.com/apt/release.key' state=present
|
|
|
|
- name: install heroku apt repo
|
|
apt_repository: >
|
|
repo='deb http://toolbelt.heroku.com/ubuntu ./'
|
|
state=present
|
|
update_cache=yes
|
|
|
|
- name: install heroku-toolbelt
|
|
apt: name=heroku-toolbelt state=present
|
|
|
|
- name: Install nvm
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
shell: >
|
|
curl https://raw.githubusercontent.com/creationix/nvm/{{ nvm_version }}/install.sh | sh
|
|
creates=/home/{{ standard_user }}/.nvm/nvm.sh
|
|
|
|
- name: Install node and set version
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
shell: >
|
|
/bin/bash -c "source ~/.nvm/nvm.sh && nvm install {{ node_version }} && nvm alias default {{ node_version }}"
|
|
creates=/home/{{ standard_user }}/.nvm/alias
|
|
|
|
- name: Add tmate repo
|
|
apt_repository:
|
|
repo: 'ppa:tmate.io/archive'
|
|
state: present
|
|
|
|
- name: Update apt
|
|
apt: update_cache=yes
|
|
|
|
- name: Install other apt items
|
|
apt: name={{ item }} state=present
|
|
with_items:
|
|
- xrdp
|
|
- tmate
|
|
- xubuntu-desktop
|
|
|
|
- name: Create vim autoload directory
|
|
file: path=/home/{{ standard_user }}/.vim/autoload state=directory
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
|
|
- name: Create vim bundle directory
|
|
file: path=/home/{{ standard_user }}/.vim/bundle state=directory
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
|
|
- name: Install pathogen
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
git:
|
|
repo: https://github.com/tpope/vim-pathogen.git
|
|
dest: /home/{{ standard_user }}/.vim/autoload/pathogen.vim
|
|
ignore_errors: yes
|
|
|
|
- name: Install nerdtree
|
|
git:
|
|
repo: https://github.com/scrooloose/nerdtree.git
|
|
dest: /home/{{ standard_user }}/.vim/bundle/nerdtree
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
ignore_errors: yes
|
|
|
|
- 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=/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=\/raw-files
|
|
state=present
|
|
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: /raw-files
|
|
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files
|
|
state: mounted
|
|
fstype: nfs
|
|
|
|
- name: Install ngrok
|
|
npm:
|
|
name: ngrok
|
|
global: true
|
|
environment:
|
|
PATH: "/home/{{ standard_user }}/.nvm/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"
|
|
ignore_errors: yes
|
|
|
|
- name: Set xrdp session
|
|
command: echo "xfce4-session" > /home/{{ standard_user }}/.xsession
|