From: Matt S Trout Date: Mon, 24 Feb 2014 07:50:11 +0000 (+0000) Subject: fill out keyman example X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf7d9637aa1c5a4093766ac6f458d09bfb094388;p=scpubgit%2FDKit.git fill out keyman example --- diff --git a/examples/keyman b/examples/keyman index 88c9702..07021f0 100644 --- a/examples/keyman +++ b/examples/keyman @@ -15,21 +15,48 @@ rule key_installed_on { A K } { contains_line F K } +rule key_not_installed_on { A K } { + authorized_keys_on A F + not_contains_line F K +} + rule my_config_dir D { home_dir_on '' H directory_in H '.keymangler' D } -rule config_contains_line { C L } { +rule my_config_file { C F } { my_config_dir D file_in D C F +} + +rule config_contains_line { C L } { + my_config_file C F contains_line F L } +rule config_not_contains_line { C L } { + my_config_file C F + not_contains_line F L +} + rule known_account A { config_contains_line 'accounts' A } rule known_key K { config_contains_line 'keys' K } rule known_dead D { config_contains_line 'keys.dead' D } -rule sync_account A { +rule not_known_account A { config_not_contains_line 'accounts' A } +rule not_known_key K { config_not_contains_line 'keys' K } +rule not_known_dead D { config_not_contains_line 'keys.dead' D } + +rule account_synchronized A { foreach K { known_key K } { key_installed_on A K } } + +rule all_synchronized {} { + foreach A { known_account A } { account_synchronized A } +} + +rule unknown_installed_on { A K } { + key_installed_on A K + not { known_key K } +}