ansible/ansible — pull request #1045 by titanous (2012-09-13 18:47:47+00:00)
Title: Add known_host module for .ssh/known_hosts

This is basically directly copied from the `authorized_key` module because I don't know enough python to share the functionality between the two modules. If you can point me at a module that shares functionality with another I'd give updating these modules a shot.

More generally I think this illustrates a useful pattern of making sure that a file exists with a specific line in it, perhaps `lineinfile` could be modified to serve this purpose.

### Example usage

```yaml
- name: pin github ssh host key
action: known_host user=deploy
host="github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
```