Last active
October 27, 2015 15:13
-
-
Save dharmab/3c16d813ac889c75f8f4 to your computer and use it in GitHub Desktop.
Salt minion bootstrap with Ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[minions] | |
server1.example.com | |
server2.example.com | |
server3.example.com | |
server4.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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