Error saying " mapping values are not allowed in this context" while executing an ansible playbook

0 votes

Hey I'm trying to execute a playbook but I get the following error:

ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context
The error appears to have been in '/home/ubuntu/launch.yml': line 34, column 25, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
            volume_type: gp2
             volume_size: 8
                        ^ here
Jan 21 in Ansible by Nishit
200 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hey, @Nishit seems like you've made a small syntax error. 

yml files are very particular about the indentations and the spacing. The error log itself is showing you the where you've gone wrong 

Remove a space before volume-size: 8

It should be like this:

volume_type: gp2
volume_size: 8
answered Jan 21 by Emily

Related Questions In Ansible

0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.