Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per host rendering of configuration templates #193

Open
k1w1 opened this issue Jun 19, 2014 · 1 comment
Open

Per host rendering of configuration templates #193

k1w1 opened this issue Jun 19, 2014 · 1 comment

Comments

@k1w1
Copy link

k1w1 commented Jun 19, 2014

As I use sprinkle for more sophisticated deployments I am running into a problem where I need my configuration files to be slightly different for each destination host. The differences are trivial, so using the template rendering would be ideal, however it looks like there is a fundamental problem. The rendering is done once and the same resulting file sent to each server.

Ideally in my template I could have code like this:

...
/path/on/machine/<%= @server_info.name %>/more/path
...

and generate a path that includes the name of the server.

This is related to #95, and probably difficult to support because of the way capistrano works in parallel. However it seems that flexibility in configuration is more valuable than the performance benefits of parallel execution. Though it is not clear to me that it is not possible to concurrently copy different files to each server, but perhaps capistrano doesn't support that.


It occurs to me that perhaps an alternative solution would be to have an installer where the template rendering happens on the destination server using a local templating mechanism. Then I could use hostname, etc in my templates.

@joshgoebel
Copy link
Contributor

However it seems that flexibility in configuration is more valuable than the performance benefits of parallel execution. Though it is not clear to me that it is not possible to concurrently copy different files to each server, but perhaps capistrano doesn't support that.

Until you have 200 servers. This is definitely a problem that would require reviewing SSHKit, Cap 3, etc... and a major rethink of Sprinkle and how it works. Since simultaneous SSH is technically just a bunch of connection management it should be technically possible to do this sort of thing... but may require building directly on a SSH lib foundation vs supporting multiple "actors". Again, not sure exactly what SSHKit might bring to the table in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants