vagrantイメージのプロビジョニングにansibleを使う方法をメモメモ。
- playbook.ymlを作成する
---
- hosts: all
tasks:
- name: step1 (install docker)
shell: curl -sSL https://get.docker.com/ | sudo sh
- name: step2 (install libselinux-python)
yum: name=libselinux-python state=present
- name: step3 (disable selinux)
selinux: policy=targeted state=permissive
sudo: yes
- Vagrantfile
Vagrant.configure(2) do |config| ... config.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" end end
golangでツールを一つ作ろうと思ってるので、ついでにansibleにも勉強しようかなーと。
chefやpuppetよりもシンプルで取っつきやすいよね。