Ansible学习笔记》上有5条评论

  1. ibhibm

    你好,,想请教一下ansible 的playbook的格式问题,,我照着官方的demo用VI敲了 T2.yml文件..但是执行时就报格式错误,但我实在看不出来哪里有问题.
    [root@ansible_server ~]# ansible-playbook t2.yml
    ERROR: Syntax Error while loading YAML script, t2.yml
    Note: The error may actually appear before this position: line 4, column 7

    remote_user:root
    task:
    ^
    [root@ansible_server ~]#


    – hosts:webservers
    remote_user:root
    task:
    – name:test connection
    ping:
    remote_user:root
    ~

    回复
  2. ibhibm

    “t2.yml” 7L, 107C written
    [root@ansible_server ~]# ansible-playbook t2.yml
    ERROR: Syntax Error while loading YAML script, t2.yml
    Note: The error may actually appear before this position: line 4, column 8

    remote_user:root
    tasks:
    ^
    [root@ansible_server ~]#
    t2.yml文件如下:
    ^
    [root@ansible_server ~]# vi t2.yml

    – hosts:webservers
    remote_user:root
    tasks:
    – name:test connection
    ping:
    remote_user:root
    ~
    谢谢

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注