Skip to content

Instantly share code, notes, and snippets.

@omgjlk
Created April 15, 2016 21:54
Show Gist options
  • Select an option

  • Save omgjlk/6980fd922b0bd60f19c64984f0767054 to your computer and use it in GitHub Desktop.

Select an option

Save omgjlk/6980fd922b0bd60f19c64984f0767054 to your computer and use it in GitHub Desktop.
#
# This playbook will automatically accept host keys into the known_hosts
# file for every host in the inventory. Takes an extra argument to define the
# ssh config file to use (relative to playbook location):
# -e ssh_config=../../openstack-envs/zelda-tor/ssh_config
#
---
- name: Load Keys
hosts: localhost
connection: local
gather_facts: false
become: false
tasks:
- name: simple ssh
command: ssh -o StrictHostKeyChecking=no -F {{ ssh_config }} {{ item }} echo
when: item != 'localhost'
with_items: groups['all']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment