Last active
December 22, 2015 21:19
-
-
Save akirasosa/6532700 to your computer and use it in GitHub Desktop.
I provision jenkins slaves by using chef. Jenkins slaves have to access to the github.com, heroku.com and so on via ssh. They have to know know_hosts.
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
echo "cookbook 'ssh_known_hosts', github: 'opscode-cookbooks/ssh_known_hosts'" >> Berksfile | |
berks install | |
berks upload | |
knife data bag create ssh_known_hosts | |
knife data bag from file ssh_known_hosts data_bags/ssh_known_hosts/github.json | |
knife data bag from file ssh_known_hosts data_bags/ssh_known_hosts/heroku.json | |
knife role from file roles/jenkins-slave.rb |
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
{ | |
"id": "github", | |
"fqdn": "github.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
{ | |
"id": "heroku", | |
"fqdn": "heroku.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
# roles/jenkins-slave.rb | |
name "jenkins-slave" | |
description "jenkins slave" | |
run_list( | |
"recipe[ssh_known_hosts::default]", | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment