我是ansible的新手,遇到了以下问题。我能够ssh到我的客户端机器.but,无法运行playbook。
获取以下错误:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
我试图设置一个环境变量为一个不可玩的游戏。基于,我应该能够做如下的事情:
---
- hosts: localhost
connection: local
environment:
test_var: "a vault here"
tasks:
- debug:
msg: "Test var is: {{lookup('env', 'test_var')}}"
- debug:
msg: "Home is here {{lookup('env
我只是通过使用Ansible提供的例子来学习Ansible。
当我试图在剧本的开头放一条调试消息时,我得到了如下所示的错误。
vagrant@packer-debian-7:~/ansible-examples-master/lamp_simple$ ansible-playbook -i hosts site.yml --private-key=~/.ssh/google_compute_engine -vvvv
ERROR: debug is not a legal parameter at this level in an Ansible Playbook
site.yml
---
#
参考:
有如此多的帖子提到使用Chef inspec进行Ansible测试。但他们通常会给出这样的例子:
可能的:
- hosts: all
user: root
tasks:
- debug: msg="debug {{inventory_hostname}}"
- apt: name=apache2 state=present
主厨检查:
impact 0.7
title "Test some simple resources"
describe package('apache2') do
it { should be
我使用的是Ubuntu14.04和Python3.4.3。我想安装那个Ubuntu版本和这个Python支持的最新版本的ansible-lint。
ansible-lint包的依赖项之一是ansible。
当我使用pip3 install ansible-lint时,我为我安装了一个不受支持的ansible版本--因为如果我运行ansible-lint --version,我会得到以下错误:
Ansible requires a minimum of Python2 version 2.6 or Python3 version 3.5. Current version: 3.4.3。
那么,我