-
-
Save jtimberman/401336 to your computer and use it in GitHub Desktop.
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/sh | |
#Provides add-apt-repository | |
sudo apt-get install -y python-software-properties | |
#use jtimberman's chef ppa for installation | |
sudo add-apt-repository ppa:jtimberman/opschef | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
#This step asks for a chef server url to put in /etc/chef/client.rb | |
sudo apt-get install -y chef | |
#copy /etc/chef/validation.pem from server to same location on client | |
#How to script this? | |
scp user@chefserver.local:/etc/chef/validation.pem /etc/chef/ | |
# Verify chef-client works: | |
sudo chef-client |
For the validation.pem you could put it somewhere it is accessible without needing a user credential to the server (symlink/hardlink to /var/www and then present it via nginx with basic auth using an .htaccess maybe and use curl to pull it with the username and password hardcoded. Otherwise you would need to have an SSH key setup for passwordless access to the server for SSH/scp to work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you add a -y to the
add-apt-repository
command somebody can copy and paste the script into the terminal without getting interrupted by the "press Enter to add to system" that shows up for interactive terminals. The reason it works in a script without it is that it detects the terminal isn't interactive and just continues.