> (erb):1: warning: Object#id will be deprecated; use Object#object_id
> err: //File[/etc/cntlm.conf]/ensure: change from absent to present
> failed: Could not set present on ensure: Permission denied - /etc/
> cntlm.conf.puppettmp at /opt/etrade/p6/puppet/modules/cntlm/manifests/
> cntlm.pp:12
> err: //Package[cntlm]/ensure: change from absent to present failed:
> Execution of '/bin/rpm -i --oldpackage http://binford.etrade.com/CentOS5-RPMS/cntlm-0.35.1-1.i386.rpm'
> returned 256: error: can't create transaction lock on /var/lib/rpm/
> __db.000
I'd expect these don't work if jleggett doesn't have write access to
/etc to make that puppettmp file, and if jleggett can't install an rpm
as a regular user. I don't know if anyone runs puppet as a non-root user
normally, but I don't know everyone's situation.
> [jleggett@lxp6d4m3 manifests]$ sudo puppet cntlm.pp
> (erb):1: warning: Object#id will be deprecated; use Object#object_id
> Failed to parse template /opt/etrade/p6/puppet/modules/cntlm/templates/
> cntlm.conf.erb: Could not find value for 'proxy' at /opt/etrade/p6/
> puppet/modules/cntlm/manifests/cntlm.pp:11 on node lxp6d4m3
Does 'sudo facter proxy' return something sensible? I saw it work for
jleggett, but is there something in a user-specific Ruby path or a
FACTER_proxy environment variable that lets the non-root facter find
this proxy variable?
--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University
> I need to be my user when the template is evaluated:
Is there another reason for this beyond the "id" fact being set properly
when you're jleggett and not when you're root? Any reason why cntlm has
to connect as your user (or whoever runs puppet in the general sense),
and not as a dedicated account?
I don't have a good answer to the template id variable turning numeric
when facter id is correct, though.
--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- ren...@tntech.edu
Ok. So do they all proxy out as jleggett (which really doesn't sound any
better than proxying through a separate account, but I don't have to
deal with lots of compliance regulations)? If so, hard-code the username
into the template similar to how it appears you've hard-coded the NTLMv2
hash. If they proxy out as different users, then I assume something's
missing in the template that provides a varying NTLMv2 hash.
If the stated policy goal is "whoever's running puppet, put their
credentials into cntlm.conf", then you're heading that way. If the
policy is a bit more complicated, like "for this group of servers, proxy
out as jleggett. For this other group, proxy out as bob", then I'd wrap
this up in a definition that allows the desired username and hash to be
passed as parameters to the file entry.
> Automatic configuration modules now work pretty well. Now I am
> working on the pieces that apply to the individual developer that
> gets this workstation. In this case, me - jleggett. so i want to
> run this puppet cntlm.pp manifest and wa-la... my proxy on the box is
> setup, and authenticating to our external proxy. Then all the
> myriad other tools that need a proxy can just point to it in their
> conf files (yum, subversion etc). This meets regulatory
> requirements, and has the added bonus of not having a single
> cleartext password on the box.
Are any regulatory requirements violated if the NTLMv2 hashes already
stored on each workstation are also stored in a common location on the
puppetmaster? Are there any variables other than the developer's
username and hash that would normally be generated on the client?
If not, would something like the following work with the regular
puppetmasterd/puppetd setup (completely untested, but should be close)?
=====
class cntlm {
package { "cntlm":
...
}
file { "/etc/cntlm.conf":
content => template("puppet://server/path/to/cntlm.conf.erb"),
...
}
}
node jleggett_managed {
$developer = 'jleggett'
$ntlmhash = 'whatever'
$proxy = 'somehost' # Could be moved into a higher part of the
# manifest or into the cntlm class, too.
}
node jleggett_node inherits jleggett_managed {
include cntlm
}
- cntlm.conf.erb -
Username <%= developer %>
Domain CORP
PassNTLMv2 <%= ntlmhash %>
Proxy http://<%= proxy %>:8080
Listen 3128
Auth NTLMv2
=====
Another option would be to modify your kickstart configuration with
information about which developer will own this workstation, drop that
into a FACTER_developer environment variable, and continue with your
running puppet interactively.