2017-10-13 11 views
0

私はプレイブックを展開しようとしていますが、そのエラーの内容は不明です。私はこのようなエラーを取得しています、なぜいくつかのいずれかが、私を助けてくださいすることができ不可能なプレイブックの構文エラーを解決できません

ERROR! Syntax Error while loading YAML. 


The error appears to have been in '/root/git-work/ansible/sparkbeyond.yml': line 16, column 3, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 

    register: ami_find 

^here 
There appears to be a tab character at the start of the line. 

YAML does not use tabs for formatting. Tabs should be replaced with spaces. 

For example: 
    - name: update tooling 
     vars: 
     version: 1.2.3 
# ^--- there is a tab there. 

Should be written as: 
    - name: update tooling 
     vars: 
     version: 1.2.3 
# ^--- all spaces here. 

:私はエラーが連続し、この取得しています

- name: trying to find sb ami 
    ec2_ami_find: 
     owner: self 
     name: SB 
    register: ami_find 

- name : use custom ami 
    ec2: 
    image: "{{ ami_find.results[0].ami_id }}" 
    instance_type: t2.small 
    key_name: mykey 
    region: us-east-1 
    wait: yes 
    register: ec2 

:私の脚本は、次のようになります。私はubuntuマシンでバージョン2.3を使用しています

答えて

1

あなたのインデントは、最初のプレイではオフでした。 2番目の演奏では、registerec2モジュールのパラメータではありません。

- name: trying to find sb ami 
    ec2_ami_find: 
    owner: self 
    name: SB 
    register: ami_find 

- name: use custom ami 
    ec2: 
    image: "{{ ami_find.results[0].ami_id }}" 
    instance_type: t2.small 
    key_name: mykey 
    region: us-east-1 
    wait: yes 
    register: ec2 
関連する問題