我们的本地开发框正在运行Virtualbox/Vagrant,并由ansible提供。现在我们为这个盒子设置了一个固定的IP地址,我们需要在三个不同的地方使用这个地址。我们的Vagrantfile文件如下所示:
# Set the Vagrantbox IP address
VAGRANT_NETWORK_IP = "10.0.0.10"
# Set the Ansible configuration environment variable
ENV['ANSIBLE_CONFIG'] = "./ansible/.ansible.cfg"
V
为什么我不能从playbook.yml访问库存文件中定义为组var的变量
以下是playbook.yml的内容
---
- name: test ansible local provisioning
hosts: all
vars:
playbook_var: "playbook_var"
tasks:
- name: Test ansible is working
debug: msg="Ansible seems to be working, this variable is from plabook {{ playbook_
我想做这样的事:
vagrant up --hostname="hello.world"
然而,没有--hostname。
我希望这样做的原因是,提供程序(Ansible)可以根据主机名使用它来修改配置。
我也可以使用vagrant up hello.world (在这种情况下,Ansible可以使用它作为inventory_hostname),但在这种情况下,我需要在Vagrantfile中为hello.world创建一个条目,这是我不想要的,因为所有可能的主机都使用相同的Vagrantfile配置。(另一种选择是在Vagrantfile中以某种方式指定“不管vm名称如何都使
我正在使用Vagrant,并试图使Ansible能够使用它。因为我是在使用Python3.5.0的virtualenv中工作,所以我必须使用Ansible-Local "main“,因为我没有运行Python2.x。
无论如何,除了vagrant up找不到Ansible之外,所有东西都能工作。下面是调用的输出:
==> default: Running provisioner: ansible_local...
default: Installing Ansible...
The Ansible software could not be found! Please v