Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playbook格式问题 #109

Open
wodezz opened this issue Dec 17, 2021 · 5 comments
Open

playbook格式问题 #109

wodezz opened this issue Dec 17, 2021 · 5 comments

Comments

@wodezz
Copy link

wodezz commented Dec 17, 2021


  • 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
@wodezz
Copy link
Author

wodezz commented Dec 17, 2021

image

@pythonzm
Copy link
Owner

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

@wodezz
Copy link
Author

wodezz commented Dec 17, 2021

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

@pythonzm
Copy link
Owner

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

@wodezz
Copy link
Author

wodezz commented Dec 17, 2021

好的 谢谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants