I’ve got a capfile that has a role defined at the top of it, with a bunch of tasks below. It works great, but I want to be able to easily (and programatically) update the machines in the roles list. I know I could do it in place, but to be safe, I’d like to be able to split out my capfile into (essentially) two files: hosts and tasks
Currently (generically):
role :machines,
"machine1",
"machine2"
desc "This is task 1"
task :task1 do
# stuff
end
I’d like to be able to have something like the following (ignore the “syntax”):
role :machines ==> {Get this information from 'hosts.cap' or something}
desc "This is task 1"
task :task1 do
# stuff
end
Is there a way to break the capfile up? Or would I need to dive into source to do that?
The vanilla
Capfileused to ship with the lineload 'config/deploy'– maybe you can leverage that to load multiple files.