Skip to content

Instantly share code, notes, and snippets.

@STAR-ZERO
Created August 5, 2014 14:54
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 STAR-ZERO/5a8e9fac5e78d7980de0 to your computer and use it in GitHub Desktop.
Save STAR-ZERO/5a8e9fac5e78d7980de0 to your computer and use it in GitHub Desktop.
AnsibleからVagrantにアクセスするための設定

AnsibleからVagrantにアクセスするための設定

Vagrant側の設定

IPアドレスを設定しておく

config.vm.network "private_network", ip: "192.168.33.10"

.ssh/configに設定 1

.ssh/config

Host 192.168.33.10
User vagrant
IdentityFile ~/.vagrant.d/insecure_private_key

inventory file

192.168.33.10

.ssh/configに設定 2

.ssh/config

Host vagrant
  HostName 192.168.33.10
  User vagrant
  IdentityFile ~/.vagrant.d/insecure_private_key

inventory file

vagrant

inventory fileのみで設定

たぶんこれが一番単純で環境を汚さずに済む

192.168.33.10 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment