触摸命令无法正常执行

时间:2019-08-30 19:02:23

标签: ansible

在此ansible-playbook中,第一个任务没有执行,但是第二个任务正在执行 如何调试问题

 - name: Transfer and execute a script.
#ansible-playbook -vvv createNode.yml --extra-vars "MASTER_URL=http://localhost:8080 MASTER_USERNAME=rajendar MASTER_PASSWORD=@Oracle38 NODE_NAME=testNode14 NUM_EXECUTORS=2"
  hosts: 127.0.0.1
  vars:

  tasks:
      command: touch /Users/rajendartalatam/Desktop/anible.text
  tasks:
    - name: Copy and Execute the script 
      command: sh ./nodeCreate.sh  {{MASTER_URL}} {{MASTER_USERNAME}} {{MASTER_PASSWORD}} {{NODE_NAME}} {{NUM_EXECUTORS}}

1 个答案:

答案 0 :(得分:0)

tasks: 实际上是list of tasks。正确的语法如下

tasks:
  - command: touch /Users/rajendartalatam/Desktop/anible.text
  - name: Copy and Execute the script 
    command: sh ./nodeCreate.sh ...
相关问题