0
Ich habe eine vagrantfile aus einem Buch über Ansible für Devops. Das Problem, das ich habe, ist, dass ich SSH in die Server kann, aber Ansible kann nicht. Hier ist meine vagrantfile
;Vagrantfile Setup zu Ansible zu SSH in
# -*- mode: ruby -*-
# vi: set ft=ruby
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# General Vagrant VM configuration
config.vm.box = "geerlingguy/centos7"
config.ssh.insert_key = false
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider :virtualbox do |v|
v.memory = 256
v.linked_clone = true
end
# Application server 1
config.vm.define "app1" do |app|
app.vm.hostname = "orc-app1.dev"
app.vm.network :private_network, ip: "192.168.60.4"
end
# Application server 2
config.vm.define "app2" do |app|
app.vm.hostname = "orc-app2.dev"
app.vm.network :private_network, ip: "192.168.60.5"
end
# Database server
config.vm.define "db" do |db|
db.vm.hostname = "orc-db.dev"
db.vm.network :private_network, ip: "192.168.60.6"
end
end
Und meine Ansible hosts
Datei;
# Application servers
[app]
192.168.60.4
192.168.60.5
# Database servers
[db]
192.168.60.6
# Group 'multi' with all servers
[multi:children]
app
db
# Variables that will be appliedto all servers
[multi:vars]
ansible_ssh_user=vagrant
ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
Ich weiß, ich ausdrücklich ansible_ssh_port=2200
usw. hinzufügen können, aber ich würde es eher Setup im vagrantfile
Stack Overflow ist eine Website für Programmier- und Entwicklungsfragen. Diese Frage scheint off-topic zu sein, weil es nicht um Programmierung oder Entwicklung geht. Siehe [Welche Themen kann ich hier fragen?] (Http://stackoverflow.com/help/on-topic) in der Hilfe. Vielleicht [Super User] (http://superuser.com/) oder [Unix & Linux Stack Exchange] (http://unix.stackexchange.com/) wäre ein besserer Ort, um zu fragen. – jww