ansible-known_hosts
ansible-known_hosts copied to clipboard
Does not work with sudo, sudo_user
Gives me msg: host is required, e.g. github.com
Task:
- name: github known host
known_hosts: host=github.com state=present
sudo: yes
sudo_user: someuser
Hi @shuhaowu Hmm did you try it without sudo/sudo_user? What version of Ansible?
This is a problem but otherwise a good library idea.
I tried:
- name: add master public to known_hosts
sudo: yes
known_hosts: host='192.168.22.12' state=present file=/var/lib/postgresql/.ssh/known_hosts
But my result is always the same:
vagrant@m4:~$ sudo cat /var/lib/postgresql/.ssh/known_hosts
vagrant@m4:~$