AnsibleDevOpsLinuxServerTips & TricksTutorial

Ansible Unable to parse /etc/ansible/hosts as an inventory source

627
Ansible
Ansible

Posting kali ini membahas warning ataupun error pada saat menjalankan ansible. Karena settingan hosts pada ansible belum di set default.

Warning atau Error seperti  :

[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: kube-master

Solusinya :

kita perlu membuat hosts pada ansible di folder : /etc/ansible/

Perintahnya sebagai berikut :

sudo mkdir /etc/ansible/
sudo touch /etc/ansible/hosts
sudo chmod 777 /etc/ansible/hosts
sudo echo "localhost ansible_connection=local" >> /etc/ansible/hosts

Jika perintah di atas selesai coba, jalankan perintah ansible kembali seperti perintah update all server yang terdaftar pada ansible.

Sekian tutorial kali ini, happy coding 🙂

Referensi :

https://groups.google.com/forum/#!topic/ansible-project/W1E2gJEfRls

 

Exit mobile version
Verified by MonsterInsights