Well, for now I still can not manage HOMES users, as I would like, but I 
could manage the user who is logged tty7. With this I can apply a class inthe 
User's Node and 
manipulate your home/Desktop, /home/Documents etc. 

I created a custom fact to identify which user is logged in at the time and 
so I could add and remove files from your Desktop, fixing permissions.

I looked for facts that show the user in tty7 e did't found it!!

My custom fact

who.rb

mkdir -p /etc/puppet/modules/myfacts/lib/facter/who.rb

cat /etc/puppet/modules/myfacts/lib/facter/who.rb 
require 'facter'
Facter.add("who") do
  setcode do
     %x{who |egrep 'tty7' | cut -d ' ' -f1}.chomp
  end
end

After that I exported the RUBYLIB

export RUBYLIB=/etc/puppet/modules/myfacts/lib


Now test the custom fact!
# facter who
rafael

This is a Class of example:

who.pp

file    {'link':
    path    => "/home/${who}/Desktop/link.txt",
    ensure    => present,
    owner    => "${who}",
    group    => "${who}",
    mode    => 0660,
    #source    => '/tmp/link.txt',
    content    => "\n O custom facter WHO funcionou!",
    }

All Right!! ..there is my file on Desktop!! It works!

Any help with this implementation ?


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cc39b62e-9a99-4d18-b402-5f866e4201e6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to