在此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}}
答案 0 :(得分:0)
tasks:
实际上是list of tasks。正确的语法如下
tasks:
- command: touch /Users/rajendartalatam/Desktop/anible.text
- name: Copy and Execute the script
command: sh ./nodeCreate.sh ...