我在我的剧本中使用命令模块,它目前看起来像这样。
- hosts: all
tasks:
- name: Update tar file
command: sudo scp -r username@hostname:/path/from/destination /path/to/destination
Run Code Online (Sandbox Code Playgroud)
出于可读性的目的,我省略了在此任务之前发生的任务,但是当我运行此 playbook 时,它会在此任务处停止。它根本不会前进。我确定这是因为 sudo,所以它可能需要密码。但是,我不确定如何解决这个问题。
我正在尝试在包含在数组中的数组中创建多维。
tests=("'0' '1 2'" "'4' '5 6'")
Run Code Online (Sandbox Code Playgroud)
在测试中的每个数组中,我想要子数组。使用第一个数组“'0''1,2'”,创建另一个 for 循环以遍历子数组的内容。