f Ansible YAML 好重Ident 阿 ~ 迪貝之家

Pages

Ansible YAML 好重Ident 阿

 我在測底下的playbook

- name: Install Remi repo.

  yum:

   name: "http://rpms.remirepo.net/enterprise/remi-release-7.rpm"

   state: present


- name: Import Remi GPG key.

   rpm_key:

   key: "http://rpms.remirepo.net/RPM-GPG-KEY-remi"

   state: present


- name: Install EPEL repo.

   yum: name=epel-release state=present


- name: Ensure firewalld is stopped (since this is for testing).

   service: name=firewalld state=stopped


- name: Install Node.js and npm.

   yum: name=npm state=present enablerepo=epel


- name: Install Forever (to run our Node.js app).

   npm: name=forever global=yes state=present

一直出現format錯誤


fatal: [192.168.60.4]: FAILED! => {"reason": "We were unable to read either as JSON nor YAML, these are the errors we got from each:\nJSON: No JSON object could be decoded\n\nSyntax Error while loading YAML.\n mapping values are not allowed here\n\nThe error appears to be in '/home/p10303550/VMs/npm_test/test.yml': line 7, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- name: Import Remi GPG key.\n rpm_key:\n

後來我調整了ident

居然ok了~~~
用diff 來看兩個檔案的差異
test.yml 是可以執行的
test2.yml是parse 錯誤的
我用紅線抓了一個對齊線
也不過就差了一個空白
應該說
要執行的各模組要align
挖................
真是......