diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-16 19:06:29 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-16 19:06:29 -0400 |
| commit | 91610aee8f34bb10959bdf6a6e5b16c895c7c1c2 (patch) | |
| tree | 7e493e4b3044de2ce2f3ef2f96dcc5e27d11c19b /src/Propellor/Property/SiteSpecific/IABak.hs | |
| parent | 2d58a7e8ca2699442d8452c5d3bca8ce43d9e87a (diff) | |
improve ssh user key properties
* Ssh.keyImported is replaced with Ssh.userKeys. (API change)
The new property only gets the private key from the privdata; the
public key is provided as a parameter, and so is available as
Info that other properties can use.
* Ssh.keyImported' is renamed to Ssh.userKeyAt, and also changed
to only import the private key from the privdata. (API change)
* While Ssh.keyImported and Ssh.keyImported' avoided updating existing
keys, the new Ssh.userKeys and Ssh.userKeyAt properties will
always update out of date key files.
* Ssh.pubKey renamed to Ssh.hostPubKey. (API change)
This makes eg, setting up ssh for spin controllers work better.
Diffstat (limited to 'src/Propellor/Property/SiteSpecific/IABak.hs')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/IABak.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Propellor/Property/SiteSpecific/IABak.hs b/src/Propellor/Property/SiteSpecific/IABak.hs index 93cf0b71..fce5aefb 100644 --- a/src/Propellor/Property/SiteSpecific/IABak.hs +++ b/src/Propellor/Property/SiteSpecific/IABak.hs @@ -26,7 +26,7 @@ gitServer :: [Host] -> Property HasInfo gitServer knownhosts = propertyList "iabak git server" $ props & Git.cloned (User "root") repo "/usr/local/IA.BAK" (Just "server") & Git.cloned (User "root") repo "/usr/local/IA.BAK/client" (Just "master") - & Ssh.keyImported SshRsa (User "root") (Context "IA.bak.users.git") + & Ssh.userKeys (User "root") (Context "IA.bak.users.git") sshKeys & Ssh.knownHost knownhosts "gitlab.com" (User "root") & Git.cloned (User "root") userrepo "/usr/local/IA.BAK/pubkeys" (Just "master") & Apt.serviceInstalledRunning "apache2" @@ -45,7 +45,7 @@ gitServer knownhosts = propertyList "iabak git server" $ props registrationServer :: [Host] -> Property HasInfo registrationServer knownhosts = propertyList "iabak registration server" $ props & User.accountFor (User "registrar") - & Ssh.keyImported SshRsa (User "registrar") (Context "IA.bak.users.git") + & Ssh.userKeys (User "registrar") (Context "IA.bak.users.git") sshKeys & Ssh.knownHost knownhosts "gitlab.com" (User "registrar") & Git.cloned (User "registrar") repo "/home/registrar/IA.BAK" (Just "server") & Git.cloned (User "registrar") userrepo "/home/registrar/users" (Just "master") @@ -60,6 +60,11 @@ registrationServer knownhosts = propertyList "iabak registration server" $ props where link = "/usr/lib/cgi-bin/register.cgi" +sshKeys :: [(SshKeyType, Ssh.PubKeyText)] +sshKeys = + [ (SshRsa, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoiE+CPiIQyfWnl/E9iKG3eo4QzlH30vi7xAgKolGaTu6qKy4XPtl+8MNm2Dqn9QEYRVyyOT/XH0yP5dRc6uyReT8dBy03MmLkVbj8Q+nKCz5YOMTxrY3sX6RRXU1zVGjeVd0DtC+rKRT7reoCxef42LAJTm8nCyZu/enAuso5qHqBbqulFz2YXEKfU1SEEXLawtvgGck1KmCyg+pqazeI1eHWXrojQf5isTBKfPQLWVppBkWAf5cA4wP5U1vN9dVirIdw66ds1M8vnGlkTBjxP/HLGBWGYhZHE7QXjXRsk2RIXlHN9q6GdNu8+F3HXS22mst47E4UAeRoiXSMMtF5") + ] + graphiteServer :: Property HasInfo graphiteServer = propertyList "iabak graphite server" $ props & Apt.serviceInstalledRunning "apache2" |
