Skip to content

Instantly share code, notes, and snippets.

@orange634nty
Last active January 22, 2019 14:00
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 orange634nty/44e1626933ce75f2c62f2c3a7080179e to your computer and use it in GitHub Desktop.
Save orange634nty/44e1626933ce75f2c62f2c3a7080179e to your computer and use it in GitHub Desktop.
この記事で使用しているコード:https://qiita.com/orange634nty/items/7927634d471805e460fe
[ssh_connection]
ssh_args = -F ssh_config
[develop]
default ansible_host=default
# Makefile
#### vagrant ####
# 仮想環境起動
vup:
vagrant up
vagrant ssh-config > ssh_config
# 仮想環境削除
vdestroy:
vagrant destroy -f
# 仮想環境起動 + ansible実行
vinit:
make vup
make play
#### ansible ####
# ansible実行
play:
ansible-playbook -i hosts playbook.yml
# ansible実行(チェック)
check:
ansible-playbook -i hosts playbook.yml --check
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "mvbcoding/awslinux"
config.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
config.vm.network "private_network", ip: "192.168.33.25"
end
.
├── Makefile
├── Vagrantfile
├── ansible.cfg
├── hosts
├── ssh_config # gitignoreする
├── playbook.yml # ↓これ以下は普通のansibleと同じです
├── roles/
├── var_groups/
└── vars/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment