iT邦幫忙

0

ansible已在 inventory 新增 IP 與使用者等,於YML檔執行時發生錯誤

  • 分享至 

  • xImage

各位大家好,日前研究公司已有的ansible。
照前輩跟我說的將IP加入inventory
IP位置 ansible_user=ubuntu
且於playbooks中撰寫如下

  • hosts: test
    gather_facts: true
    become: yes
    environment:
    LINODE_API_KEY: "{{ linode_api_key }}"
    vars_files:
    • "vars/bao.yml"
      roles:
    • role: larvata
      default_user: "{{ ansible_user }}"
    • timezone
    • ubuntu
    • docker
    • role: oh-my-zsh
      users:
      • username: ubuntu

但卻跳出以下ERROR:

ERROR! the role 'larvata' was not found in /home/bill/larvata-ansible/playbooks/roles:/home/bill/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/bill/larvata-ansible/playbooks

The error appears to have been in '/home/bill/larvata-ansible/playbooks/bao.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:
- role: larvata
^ here
看起來很像是role中少了東西,但怎麼查網路上卻沒什麼資料,跪求各位大神幫忙

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答