playbook
- name: create log files shell: [ ! -e {{ item }} ] && touch {{ item }} && chmod 640 with_items: - "/var/log/snmplog" - "/var/log/ftp.log" changed_when: false
エラー内容
ERROR! Syntax Error while loading YAML. The error appears to have been in '/xxxx/xxxx/xxxx/xxx/tasks/main.yml': line 140, column 17, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: create log files shell: [ ! -e {{ item }} ] && touch {{ item }} && chmod 640 ^ here We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value. For instance: with_items: - {{ foo }} Should be written as: with_items: - "{{ foo }}" exception type: <class 'yaml.parser.ParserError'> exception: while parsing a flow sequence in "<unicode string>", line 140, column 10 did not find expected ',' or ']' in "<unicode string>", line 140, column 17
なお140行目はshell:の部分です。
どこが問題なのでしょうか?
ダブルクォートでくくってみたりしましたが、うまく動作しませんでした。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/05 03:12