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
467 views

1 answer to this question.

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
2 answers
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer