Skip to content

Instantly share code, notes, and snippets.

@FGtatsuro
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FGtatsuro/74cb2b67cf67b1ed263b to your computer and use it in GitHub Desktop.
Save FGtatsuro/74cb2b67cf67b1ed263b to your computer and use it in GitHub Desktop.
Ansibleでシェル設定の再読み込みが必要になった場合の対応 ref: http://qiita.com/FGtatsuro/items/2366c93131c47aef8dfe
# ~/.bashrc(~/.bash_profile) にrbenvの設定を追記する
- name: Set rbenv config
copy: src=files/bashrc dest=~/.bashrc
# ~/.bashrcに書き込んだ設定を読み込む
- name: Load rbenv setting
shell: source ~/.bashrc executable=/bin/bash
- name: Install ruby 2.1.2
shell: rbenv install 2.1.2 && rbenv rehash && rbenv global 2.1.2 executable=/bin/bash
# ~/.bashrc(~/.bash_profile) にrbenvの設定を追記する
- name: Set rbenv config
copy: src=files/bashrc dest=~/.bashrc
# lオプションによりログインシェルとしてbashを起動する
- name: Install ruby 2.1.2
shell: /bin/bash -lc "rbenv install 2.1.2 && rbenv rehash && rbenv global 2.1.2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment