[meta] irregular-apocalypse

pull/28/head
Alpha Chen 7 years ago
parent 7eb91b8600
commit b892605076

@ -19,3 +19,6 @@ Host kejadlen.console.xen.prgmr.com
Host 127.0.0.1 Host 127.0.0.1
StrictHostKeyChecking no StrictHostKeyChecking no
Host irregular-apocalypse
HostName 35.197.9.101

@ -13,6 +13,8 @@ brew 'fzf'
brew 'git' brew 'git'
brew 'macvim', args: ['with-override-system-vim'] brew 'macvim', args: ['with-override-system-vim']
brew 'mas' brew 'mas'
brew 'pip'
brew 'python'
brew 'reattach-to-user-namespace' brew 'reattach-to-user-namespace'
brew 'ripgrep' brew 'ripgrep'
brew 'ruby-install' brew 'ruby-install'

@ -2,6 +2,7 @@
inventory = hosts.private inventory = hosts.private
retry_files_enabled = False retry_files_enabled = False
pipelining = True pipelining = True
host_key_checking = False
[ssh_connection] [ssh_connection]
ssh_args = -o ForwardAgent=yes ssh_args = -o ForwardAgent=yes

@ -0,0 +1,48 @@
---
- hosts: all
pre_tasks:
- name: update dotfiles repo
git:
repo: https://github.com/kejadlen/dotfiles.git
dest: ~/.dotfiles
ignore_errors: yes
- hosts: all
tasks:
- name: install dependencies
apt:
name: "{{ item }}"
update_cache: yes
with_items:
- make
- python-pip
- zsh
become: yes
- hosts: all
roles:
- dotfiles
- zsh
- hosts: all
tasks:
- stat: path=/usr/bin/local/chruby-exec
register: chruby
- import_tasks: irregular-apocalypse/chruby.yml
vars:
version: 0.3.9
when: chruby.stat.exists == False
- hosts: all
tasks:
- stat: path=/usr/bin/local/ruby-install
register: ruby_install
- import_tasks: irregular-apocalypse/ruby-install.yml
vars:
version: 0.6.1
when: ruby_install.stat.exists == True
- hosts: all
tasks:
- name: install Ruby
command: ruby-install ruby

@ -0,0 +1,21 @@
- name: create ~/src
file:
path: ~/src
state: directory
- name: download chruby
get_url:
url: https://github.com/postmodern/chruby/archive/v{{ version }}.tar.gz
dest: ~/src/chruby-{{ version }}.tar.gz
- name: extract chruby
unarchive:
src: ~/src/chruby-{{ version }}.tar.gz
dest: ~/src
remote_src: yes
- name: install chruby
command: make install
args:
chdir: "{{ ansible_env.HOME }}/src/chruby-{{ version }}"
become: yes

@ -0,0 +1,16 @@
- name: download ruby-install
get_url:
url: https://github.com/postmodern/ruby-install/archive/v{{ version }}.tar.gz
dest: ~/src/ruby-install-{{ version }}.tar.gz
- name: extract ruby-install
unarchive:
src: ~/src/ruby-install-{{ version }}.tar.gz
dest: ~/src
remote_src: yes
- name: install ruby-install
command: make install
args:
chdir: "{{ ansible_env.HOME }}/src/ruby-install-{{ version }}"
become: yes

@ -16,7 +16,7 @@
with_dict: "{{ private_symlinks }}" with_dict: "{{ private_symlinks }}"
- name: symlink SSH configs - name: symlink SSH configs
file: src={{ item }} dest=~/.ssh/{{ item | basename }} state=link file: src=~/.dotfiles/.ssh/{{ item | basename }} dest=~/.ssh/{{ item | basename }} state=link
with_fileglob: ~/.dotfiles/.ssh/* with_fileglob: ~/.dotfiles/.ssh/*
- name: symlink ~bin - name: symlink ~bin

@ -1,16 +1,14 @@
- name: install Python
homebrew: name=python state=present
- name: check if Powerline is already installed - name: check if Powerline is already installed
shell: /usr/local/bin/pip list | grep Powerline shell: pip list | grep Powerline
ignore_errors: true ignore_errors: true
register: powerline_installed register: powerline_installed
- name: install Powerline - name: install Powerline
command: > command: >
/usr/local/bin/pip pip
install install
--user --user
--editable={{ ansible_env.HOME }}/.dotfiles/src/powerline --editable=~/.dotfiles/src/powerline
when: powerline_installed.failed when: powerline_installed.failed
- name: symlink Powerline configs - name: symlink Powerline configs

@ -1,6 +1,3 @@
- name: install ZSH
homebrew: name=zsh state=present
- name: symlink ~/.zprezto - name: symlink ~/.zprezto
file: file:
src: "{{ ansible_env.HOME }}/.dotfiles/src/prezto" src: "{{ ansible_env.HOME }}/.dotfiles/src/prezto"
@ -18,10 +15,14 @@
state: link state: link
with_items: "{{ prezto_runcoms.stdout_lines }}" with_items: "{{ prezto_runcoms.stdout_lines }}"
- name: add /usr/local/bin/zsh to /etc/shells - name: find where zsh is
lineinfile: dest=/etc/shells line=/usr/local/bin/zsh state=present command: which zsh
register: which_zsh
- name: add zsh to /etc/shells
lineinfile: dest=/etc/shells line={{ which_zsh.stdout | trim }} state=present
become: yes become: yes
- name: set the default user shell to zsh - name: set the default user shell to zsh
user: name={{ ansible_env.USER }} shell=/usr/local/bin/zsh user: name={{ ansible_env.USER }} shell={{ which_zsh.stdout | trim }}
become: yes become: yes

Loading…
Cancel
Save