2017-08-29 4 views
0

Ich habe ein Problem mit Ansible Playbook, das ich verwende, um meine AWS VPC einzurichten. HierAnsible Playbook Syntax Problem

ist das Snippet YML-Datei, die das Problem verursacht

Outputs: 
    TemplateID: 
    Description: cloudonaut.io template id 
    Value: vpc/vpc-2azs 
    StackName: 
    Description: Stack name 
    Value: !Sub '${AWS::StackName}' 

Die letzte Zeile ist, wo der Syntaxfehler erhöht wird. Der Fehler ist

[WARNING]: Host file not found: /etc/ansible/hosts 

[WARNING]: provided hosts list is empty, only localhost is available 

ERROR! Syntax Error while loading YAML. 


The error appears to have been in '/vagrant/Devel/chalktalk-config/chalktalk-config/cloudformation/vpc2az.yaml': line 233, column 13, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 

    Description: Stack name 
    Value: !Sub '${AWS::StackName}' 
      ^here 

Antwort

2

Sie laufen in YAML-Tag-Syntax. Weitere Informationen finden Sie unter What does a single exclamation mark do in YAML?.

Die schnelle Antwort ist die Value Variable mit doppelten Anführungszeichen zu umhüllen.

Value: "!Sub '${AWS::StackName}'" 
+1

Bitte seien Sie nett, Erklärung über '!' In YAML hinzuzufügen –