User/managehome with useradd provider on CentOS

56 views
Skip to first unread message

Calimero

unread,
Feb 24, 2009, 9:45:03 AM2/24/09
to Puppet Users
Hi,

When you set managehome to false on a User ressource, homedir will
still be created on a CentOS box as the -M flag is not passed to
useradd.

$ diff -u /usr/lib/ruby/site_ruby/1.8/puppet/provider/user/
useradd.rb.bak \
/usr/lib/ruby/site_ruby/1.8/puppet/provider/user/useradd.rb
--- /usr/lib/ruby/site_ruby/1.8/puppet/provider/user/
useradd.rb.bak 2008-10-23 01:19:07.000000000 +0200
+++ /usr/lib/ruby/site_ruby/1.8/puppet/provider/user/useradd.rb
2009-02-24 15:25:35.000000000 +0100
@@ -31,7 +31,7 @@
cmd = []
if @resource.managehome?
cmd << "-m"
- elsif %w{Fedora RedHat}.include?(Facter.value
("operatingsystem"))
+ elsif %w{Fedora RedHat CentOS}.include?(Facter.value
("operatingsystem"))
cmd << "-M"
end
cmd

These are source files from the EPEL 0.24.7 package. I cannot report
this (minor) bug through Redmine as the system just won't let me
register... Hope it helps.

Bye,
Calimero

Steven Nemetz

unread,
Feb 24, 2009, 9:59:03 AM2/24/09
to puppet...@googlegroups.com

Is there a way to pass parameters to rpm with the package type?

I have some rpms that need to be installed with --nodeps

Thanks,

Steven

James Turnbull

unread,
Feb 24, 2009, 10:27:00 AM2/24/09
to puppet...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for reporting this.

I've pushed a commit fixing this issue. It'll be in the forthcoming
0.24.8 release.

Regards

James Turnbull

- --
Author of:
* Pulling Strings with Puppet
(http://www.amazon.com/gp/product/1590599780/)
* Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
* Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJpBHE9hTGvAxC30ARAgZ3AJ9V2X6bDNL0DFUW6qB8+MkIF4RfNACfQD1l
osORC6Q7r22k7XX6Oj/FQDA=
=UuGK
-----END PGP SIGNATURE-----

Todd Zullinger

unread,
Feb 26, 2009, 8:18:08 PM2/26/09
to puppet...@googlegroups.com
Steven Nemetz wrote:
> Is there a way to pass parameters to rpm with the package type?
>
> I have some rpms that need to be installed with --nodeps

What sort of packages do you need to do this with? It sounds like
broken packages (which often come from proprietary vendors that don't
know how to package properly :).

There are probably better ways to handle this sort of breakage. For
example, create dummy packages that "provide" the dependencies.

Of course, I'm just guessing at what you really need to do, so I could
be way off.

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Erotic is when you use a feather, kinky is when you use the whole
chicken.
-- C. Haynes.

Steven Nemetz

unread,
Feb 27, 2009, 12:23:31 AM2/27/09
to puppet...@googlegroups.com
The packages are ok (straight CentOS 4), but the OS is our own dialect
(modified from CentOS 4). So, I end up with some packages that depend on
others only to create a directory or a config file that puppet will be
doing anyways. I don't want to install the dependence because it
installs other stuff that I don't want or need and might interfere with
our custom OS.

I was hoping not to have to create a either a modified rpm or a dummy
one.

So far, it sound like creating a dummy package or modifying the puppet
rpm provider are my best choices.

Thanks,

Steven

Ohad Levy

unread,
Feb 27, 2009, 3:50:29 AM2/27/09
to puppet...@googlegroups.com
or just uses an exec to execute it with nodeps....
Ohad

Bruce Richardson

unread,
Feb 27, 2009, 5:48:04 AM2/27/09
to puppet...@googlegroups.com
On Thu, Feb 26, 2009 at 09:23:31PM -0800, Steven Nemetz wrote:
> I was hoping not to have to create a either a modified rpm or a dummy
> one.
>
> So far, it sound like creating a dummy package or modifying the puppet
> rpm provider are my best choices.
>

I would urge you to go the dummy package root. It is good practice
generally, not just for puppet; it keeps your package database
consistent and healthy *and* (very importantly) it documents your
intent. If you just force --no-deps, how will you (or somebody filling
in while you are ill, on holiday, under a bus etc.) know which broken
dependencies on a system are evidence of error and breakage and which
are deliberate policy?

--
Bruce

I unfortunately do not know how to turn cheese into gold.

Reply all
Reply to author
Forward
0 new messages