[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
StrictHostKeyChecking no
Host irregular-apocalypse
HostName 35.197.9.101

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

@ -2,6 +2,7 @@
inventory = hosts.private
retry_files_enabled = False
pipelining = True
host_key_checking = False
[ssh_connection]
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 }}"
- 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/*
- name: symlink ~bin

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

@ -1,6 +1,3 @@
- name: install ZSH
homebrew: name=zsh state=present
- name: symlink ~/.zprezto
file:
src: "{{ ansible_env.HOME }}/.dotfiles/src/prezto"
@ -18,10 +15,14 @@
state: link
with_items: "{{ prezto_runcoms.stdout_lines }}"
- name: add /usr/local/bin/zsh to /etc/shells
lineinfile: dest=/etc/shells line=/usr/local/bin/zsh state=present
- name: find where zsh is
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
- 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

Loading…
Cancel
Save