agent ssh connections: declare per agent, render into the agent's ssh config
This commit is contained in:
parent
844fb0a219
commit
934da6f31f
1 changed files with 1420 additions and 12 deletions
|
|
@ -11,6 +11,9 @@
|
|||
//! ([`BEFORE_FIRST_READ`]), so a queue that is down at start never leaves it
|
||||
//! wider than the swarm grants. After one, a set key wins, `[]` holds none and
|
||||
//! an unset key is the default. A failed read keeps the last value.
|
||||
//!
|
||||
//! The same read renders the ssh connections into the agent's ssh config
|
||||
//! ([`crate::ssh_connections`]).
|
||||
|
||||
use std::sync::{PoisonError, RwLock};
|
||||
use std::time::Duration;
|
||||
|
|
@ -68,8 +71,16 @@ pub async fn run() {
|
|||
%agent,
|
||||
"permissions: holding none (no bash) until the first read of this agent's key succeeds"
|
||||
);
|
||||
let mut ssh_applied = crate::ssh_connections::Applied::default();
|
||||
loop {
|
||||
let read = read_once(&client, &agent).await;
|
||||
if let Some(Read::Current(record)) = &read {
|
||||
crate::ssh_connections::apply(
|
||||
record,
|
||||
std::path::Path::new(crate::ssh_connections::CONFIG),
|
||||
&mut ssh_applied,
|
||||
);
|
||||
}
|
||||
{
|
||||
let mut current = CURRENT.write().unwrap_or_else(PoisonError::into_inner);
|
||||
let next = settle(current.clone(), read);
|
||||
|
|
|
|||
Loading…
Reference in a new issue