Skip to content

Instantly share code, notes, and snippets.

@dharmab
Last active October 27, 2015 15:13
Show Gist options
  • Save dharmab/3c16d813ac889c75f8f4 to your computer and use it in GitHub Desktop.
Save dharmab/3c16d813ac889c75f8f4 to your computer and use it in GitHub Desktop.
Salt minion bootstrap with Ansible
#!/bin/bash
# Add the SSH fingerprints to the known hosts file
while read minion; do ssh-keyscan -H $minion >> ~/.ssh/known_hosts; done < inventory
# Run the ansible playbook
ansible-playbook --inventory inventory --ask-pass --ask-become-pass playbook.yml
[minions]
server1.example.com
server2.example.com
server3.example.com
server4.example.com
---
- hosts: minions
remote_user: user_with_sudo
tasks:
- name: start salt minion
service: name=salt-minion state=started enabled=yes
become: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment