Open jefflunt opened 12 years ago
Learned how to do some more things with Chef lately. Should be able to provision the user, set the .bashrc
and .bash_aliases
files easily using templates (including the removal of .bash_profile
, and the creation/modification of the database.yml on a per-environment basis.
Should also be able to write a capistrano recipe that will allow me to swap which database a given server points to by recreating the database.yml file by grabbing it from Chef and building it on the fly in capistrano.
Really this provisioning seems a lot simpler now that I've done more with Chef.
The swap
command should really be something like cap preop deploy:promote
The purpose of this task would be the following:
prev.rpglogger.com
This puts the new production server in place, promoting it with all production settings, and rebooting it, giving it a chance to get a clean start. Then, only after the smokescreen test passes will it reassign the IP and stop the old server. There might be some details I'm missing, but this should not only be possible, but relatively easy.
There will no longer be a preop
server - I will simply rebuild the staging server and promote it when necessary before a big, stack-changing deploy.
database.yml
file could be done via a combination of capistrano calling out to ChefOnce these two things are done, the deploy:install
and deploy:setup
steps would be fully automated. This means that you could simply do deploy:cold
and it should be able to everything in the first two steps, perhaps with a reboot in the middle, and go from zero to deployed app with a single command (after bootstrapping).
I might be able to move all the commands from the bootstrap script into capistrano as a bootstrap
recipe, or something similar. It would effectively convert the current script into a series of run "command"
commands inside of capistrano, but that's probably 100% okay after all.
useradd
command, when not specifying a password, might generate the home folder as expected and make the user password-less. With key-based authentication turned on I'd be happy with that http://askubuntu.com/questions/166453/how-to-create-user-account-via-a-bash-scriptAlso a (private) spreadsheet which currently shows that 25% of the server build process is manual. I really need to get this down to something like 1% - the 1% that is the kickoff of the provisioning of the server.