We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I have multiple servers, I want execute same commands for all servers. How can I do? I think convenient in following way:
{ "server_1": {"username": "root"}, "server_2": {"username": "root"} }
sshconfig: { "server_1": grunt.file.readJSON('secret.json')['server_1'], "server_2":grunt.file.readJSON('secret.json')['server_2'] } sshexec: { task: { command: ['ls -la'], options: {'config': ['server_1', 'server_2']} } }
The text was updated successfully, but these errors were encountered:
👍
Sorry, something went wrong.
You could probably do something like this:
// grunt.initConfig sshconfig: { "server_1": grunt.file.readJSON('secret.json')['server_1'], "server_2": grunt.file.readJSON('secret.json')['server_2'] } sshexec: { task: { command: ['ls -la'] } }
grunt.registerTask('list_multiple', function() { var servers = ['server_1', 'server_2']; for (var i in servers) { grunt.option('config', servers[i]); grunt.task.run(['sshexec:task']); } });
I haven't tested this so please feel free to reply back if it works for you or not.
No branches or pull requests
If I have multiple servers, I want execute same commands for all servers. How can I do?
I think convenient in following way:
{
"server_1": {"username": "root"},
"server_2": {"username": "root"}
}
The text was updated successfully, but these errors were encountered: