RubyをインストールするためのPlaybook
- update yum packages
- set lang ja_JP.UTF-8
- installed git
- deployed .bash_profile flagment .bash.d
- made dir .bash.d
- installed rbenv
- registered rbenv path
- installed ruby-build
ansible
$ sudo amazon-linux-extras install ansible2 -y
$ ansible --version
$ sudo yum install git -y
From local pc
$ scp -i <secretkey> <secretkey> ec2-user@<IP ADDRESS>:~/.ssh
$ git clone https://github.com/hito-kotaro/an-sample-http.git
$ cd an-sample-http
$ vim hosts
[server]
<YOUR SERVER IP ADDRESSS>
[server:vars]
ansible_ssh_port=22
ansible_ssh_user=ec2-user
ansible_ssh_private_key_file=<YOUR SECRET KEY>
__working_user=ec2-user
$ ansible-playbook site.yml --syntax-check
$ ansible-playbook -i hosts site.yml
$ rbenv install <VERSION>
$ rbenv global <VERSION>