3
文字列をapp_name: <anything>
からapp_name: {{ node }}
に置き換える必要があります。文字列を正規表現で置換するAnitoryで置換モジュールを使用する
置き換える:DEST =/ABC/HYBRIS/newrelic/newrelic.yml正規表現= 'APP_NAMEを:\ S [A-ZAの下交換モジュールを使用して実行しようとしながら
いくつかの構文エラーがあります-z0-9] * APP_NAME」=置き換える ': "{{}}ノードを"'
エラーメッセージ:
[[email protected] ansible]$ ansible-playbook -i hosts_acc ACC.yml --tags=newrelic
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/ABC/Ansible/roles/NewRelic_Base/tasks/main.yml': line 12, column 101, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: NewRelic - Replace app_name variable
replace: dest=/ABC/hybris/newrelic/newrelic.yml regexp='app_name:\s[A-Za-z0-9 ]*' replace="app_name: {{ node }}"
^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 }}"
、あなたは' template'を使用し、全体のことを書く必要があります。 – tedder42