ansible-known_hosts icon indicating copy to clipboard operation
ansible-known_hosts copied to clipboard

Does not work with sudo, sudo_user

Open shuhaowu opened this issue 12 years ago • 3 comments

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

shuhaowu avatar Jul 16 '13 04:07 shuhaowu

Hi @shuhaowu Hmm did you try it without sudo/sudo_user? What version of Ansible?

brycebaril avatar Jul 23 '13 03:07 brycebaril

This is a problem but otherwise a good library idea.

nicholasf avatar Jan 14 '14 01:01 nicholasf

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:~$ 

soupdiver avatar Jun 15 '14 13:06 soupdiver