Rex
Rex copied to clipboard
Can private_key be used as a property for a server?
The documentation on configuring a server is thin.
I have this in Rexfile:
group "lightsails", "ilwu_big" => { user => 'my_user', private_key => '/path/to/key.pem' };
task 'uptime', 'ilwu_big', sub {
say run 'uptime';
};
However, authentication fails. If I add the following above the task, however:
private_key '/path/to/key.pem';
The task runs.
Thanks for the report!
Hmm, when I first started to reply, I noticed that there are at least the following factors in play here:
- I'd expect the
use_server_authfeature flag and/or some newer versioned feature flag would be needed for that notation to work - the task says the code is tied to the host named
ilwu_big, and not to the group namedlightsails(that would betask 'uptime', group => 'lightsails', sub {...};) - I would recommend
auth forto override per-task or per-group authentication details
But then I could not make this use case for the private keys working in my quick local tests, so I think it's best to investigate it further as a potential bug.
To avoid duplication, I will cross-link this with the Rex Users group thread about the same topic, and only follow it here.