If a value after a colon starts with a “{“, YAML will think it is a dictionary, so you must quote it
とあります。
例えば、以下のような場合は囲う必要があります。
msg:"{{ greeting }}" # OK
以下のように、囲わない場合は、エラーになります。
msg:{{ greeting }} # エラー
エラー
ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: Expecting value: line 1 column 1 (char 0)
Syntax Error while loading YAML.
found unacceptable key (unhashable type: 'AnsibleMapping')
The error appears to be in '/home/studentXX/ansible-files/test.yml': line 11, column 15, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
debug:
msg: {{ greeting }}
^ 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 }}"
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: rt01(config)#
fatal: [rt01]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/vagrant/.ansible/tmp/ansible-local-28450uu8hydjf/ansible-tmp-1591442691.3088439-28456-252030280888868/AnsiballZ_ios_config.py\", line 102, in \n ansiballz_main()\n File \"/home/vagrant/.ansible/tmp/ansible-local-28450uu8hydjf/ansible-tmp-1591442691.3088439-28456-252030280888868/AnsiballZ_ios_config.py\", line 94, in ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/vagrant/.ansible/tmp/ansible-local-28450uu8hydjf/ansible-tmp-1591442691.3088439-28456-252030280888868/AnsiballZ_ios_config.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.network.ios.ios_config', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n fname, loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n
rt01#sh running-config
Building configuration...
Current configuration : 4356 bytes
!
! Last configuration change at 14:19:27 UTC Thu May 28 2020 by ec2-user
!
version 16.12
...(略)...
startup-config
rt01#sh startup-config
Using 2439 out of 33554432 bytes
!
! Last configuration change at 14:05:56 UTC Thu May 28 2020
!
version 16.12
...(略)...
Building configuration...
Current configuration : 4344 bytes
!
! Last configuration change at 14:05:56 UTC Thu May 28 2020
!
version 16.12
service timestamps debug datetime msec
...(略)...
は
version 16.12
service timestamps debug datetime msec
...(略)...