172 lines
5.1 KiB
YAML
172 lines
5.1 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://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
|
|
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 --ruby
|
|
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
|
|
- mosh
|
|
- 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: Create vim colors directory
|
|
file: path=/home/{{ standard_user }}/.vim/colors state=directory
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
|
|
- name: Install pathogen
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
shell: curl -LSso /home/{{ standard_user }}/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
|
|
ignore_errors: yes
|
|
|
|
- name: Install nerdtree vim plugin
|
|
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: Install airline vim plugin
|
|
git:
|
|
repo: https://github.com/vim-airline/vim-airline.git
|
|
dest: /home/{{ standard_user }}/.vim/bundle/airline
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
ignore_errors: yes
|
|
|
|
- name: Create vim colors directory
|
|
file: path=/home/{{ standard_user }}/.vim/colors state=directory
|
|
|
|
- name: Install vim colors
|
|
template: src=../roles/developer-machine/templates/{{ item }}.vim.j2 dest=/home/{{ standard_user }}/.vim/colors/{{ item }}.vim
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
with_items:
|
|
- sublimemonokai
|
|
|
|
- name: Replace .vimrc
|
|
template: src=../roles/developer-machine/templates/vimrc.j2 dest=/home/{{ standard_user }}/.vimrc
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
|
|
- name: Replace tmux config
|
|
template: src=../roles/developer-machine/templates/tmux.conf.j2 dest=/home/{{ standard_user }}/.tmux.conf
|
|
|
|
- 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 }}:{{ nfs_share }}/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:{{ nfs_share }}/raw-files
|
|
state: mounted
|
|
fstype: nfs
|
|
ignore_errors: true
|
|
|
|
- name: Install ngrok
|
|
shell: npm install -g ngrok
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
ignore_errors: yes
|
|
environment:
|
|
PATH: "/home/{{ standard_user }}/.nvm/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"
|
|
|
|
#- name: Set xrdp session
|
|
# command: echo "xfce4-session" > /home/{{ standard_user }}/.xsession
|
|
|
|
#- name: Set up xrdp.ini
|
|
# template: src=../roles/developer-machine/templates/xrdp.ini.j2 dest=/etc/xrdp/xrdp.ini
|
|
|
|
#- name: Fix xrdp tabbing
|
|
# template: src=../roles/developer-machine/templates/xfce4-keyboard-shortcuts.xml.j2 dest=/home/{{ standard_user }}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
|
|
# become: yes
|
|
# become_user: "{{ standard_user }}"
|
|
|
|
#- name: Restart xrdp
|
|
# shell: service xrdp restart
|
|
|
|
- name: Install ssh-config
|
|
template: src=../roles/developer-machine/templates/ssh-config.j2 dest=/home/{{ standard_user }}/.ssh/config
|
|
become: yes
|
|
become_user: "{{ standard_user }}"
|
|
|
|
- name: Install desktop grub file
|
|
template: src=../roles/developer-machine/templates/grub-default.j2 dest=/etc/default/grub
|
|
|
|
- name: Update Grub
|
|
shell: update-grub
|