help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem keeping user .ssh directories synchronized


From: address@hidden
Subject: Problem keeping user .ssh directories synchronized
Date: 17 Feb 2006 14:02:17 -0800
User-agent: G2/0.2

Hi All,

I have an interesting problem here, and I'm wondering what would be the
best way to solve it using cfengine.

Let's say I have three users "joe, moe, curly". These users have their
homes under /home (/home/joe, /home/moe and /home/curly). Each user has
a ".ssh" directory inside their homes with the SSH private and public
keys, authorized_keys file, etc. I want to copy these directories to
other servers on the network.

The obvious brute force approach is:

copy:
   /home/moe/.ssh dest=/home/moe/.ssh server=mymaster
   /home/joe/.ssh dest=/home/joe/.ssh server=mymaster
   /home/curly/.ssh dest=/home/curly/.ssh server=mymaster

This works, but I'd like something more "automated". Adding a user and
a home directory alone should not require changes in the cfagent.conf
file...

I then tried using iterations, but cfengine does not allow iterations
to be used in the 'dest=' part of the copy action, making it rather
useless for this case. :\

I also tried to copy the .ssh directories using recursive copy, but:

1) I cannot use exclude, as it only works on files, not directories
2) Ignore does not work well in this case, as I'd have to ignore
everything else *except* these users, and all directories under their
homes would be copied as well (I only want .ssh)
3) I tried some black magic using shell substitutions, but it did not
work so well.

I can't believe something so simple is impossible or that hard to do
with cfengine...

Any ideas?

Regards,
Paga



reply via email to

[Prev in Thread] Current Thread [Next in Thread]