【问题标题】:adding a single host to ansible tower using yaml使用 yaml 将单个主机添加到 ansible 塔
【发布时间】:2018-07-23 14:29:44
【问题描述】:

我有:

  • 设置了一个 ansilbe 塔 (aws EC2)。
  • ubuntu 服务器 (aws ec2)。

我已经在 tower 中创建了一个 main 库存组,并正在尝试将 ubuntu 服务器添加为主机。

---
- name: ubuntu
  add_host:
    name: "192.168.1.1"
    groups: main

根据我为创建主机界面的变量部分编写的上述文档,但是我收到了无效 yaml 消息。

对我哪里出错有什么建议吗?

【问题讨论】:

标签: ansible ansible-inventory ansible-tower


【解决方案1】:

我没有使用 Ansible Tower,但我想看看它是否有帮助

上面的代码对我有用

---
- hosts: localhost
  tasks:
    - name: ubuntu
      add_host:
           name: "192.168.3.104"
           groups: main

希望有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-24
    • 2017-11-27
    相关资源
    最近更新 更多