Skip to content

playbook格式问题 #109

Open
Open

Description

@wodezz

  • hosts: 120.55.89.170
    remote_user: root

    tasks:

    • name: copy file
      copy: src=/root/initial-setup-ks.cfg dest=/root/initial-setup-ks.cfg
      我这样写是可以执行的, 但是这个hosts不就写死了吗? 这里hosts后面应该怎么写? 谢谢!!

  • hosts: {{ 这里应该怎么写 }}
    remote_user: root

    tasks:

    • name: copy file
      copy: src=/root/initial-setup-ks.cfg dest=/root/initial-setup-ks.cfg

Activity

  1. wodezz commented on Dec 17, 2021

    @wodezz
    Author

    image

  2. pythonzm commented on Dec 17, 2021

    @pythonzm
    Owner

    就是正常的playbook内容就行,里面的内容没有做变量处理,可以在动态主机组中先添加主机组,然后在playbook中指定组名

  3. wodezz commented on Dec 17, 2021

    @wodezz
    Author

    添加主机组列表的时候 主机组名称不能是中文吧,写成英文 然在playbook里面- hosts: 主机组名称 这样写吗

  4. pythonzm commented on Dec 17, 2021

    @pythonzm
    Owner

    嗯,是这样的,先添加主机组,然后在playbook中指定主机组名,最好不要用中文

  5. wodezz commented on Dec 17, 2021

    @wodezz
    Author

    好的 谢谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions