[meta] irregular apocalypse ruby/rust installation updates

pull/28/head
Alpha Chen 7 years ago
parent 0ddb893b8d
commit 6cdaec53ac

@ -27,6 +27,16 @@
- dotfiles - dotfiles
- zsh - zsh
- hosts: all
name: create home dirs
tasks:
- file:
path: "{{ item }}"
state: directory
with_items:
- src
- tmp
- hosts: all - hosts: all
name: install Ansible name: install Ansible
tasks: tasks:
@ -48,7 +58,7 @@
version: 0.3.9 version: 0.3.9
when: chruby.stat.exists == False when: chruby.stat.exists == False
- stat: path=/usr/bin/local/ruby-install - stat: path=/usr/local/bin/ruby-install
register: ruby_install register: ruby_install
- import_tasks: irregular-apocalypse/ruby-install.yml - import_tasks: irregular-apocalypse/ruby-install.yml
vars: vars:
@ -59,3 +69,26 @@
register: rubies register: rubies
- command: ruby-install ruby - command: ruby-install ruby
when: rubies.stat.exists == False when: rubies.stat.exists == False
- hosts: all
name: install Rust
tasks:
- stat: path=~/.cargo/bin/rustup
register: rustup
- import_tasks: irregular-apocalypse/rustup.yml
when: rustup.stat.exists == False
- command: ~/.cargo/bin/rustup toolchain list
register: rustup_toolchains
- name: install rust
command: ~/.cargo/bin/rustup install nightly
when: "'nightly' not in rustup_toolchains.stdout"
- name: default to nightly
command: ~/.cargo/bin/rustup default nightly
- name: install Rust-based tools
command: ~/.cargo/bin/cargo install {{ item }}
with_items:
- exa
- ripgrep

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

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

@ -0,0 +1,9 @@
- name: download rustup
get_url:
url: https://sh.rustup.rs
dest: ~/tmp/rustup-init.sh
force: yes
mode: a+x
- name: install rustup
command: ~/tmp/rustup-init.sh -y
Loading…
Cancel
Save