diff options
author | Paul Allen <pallen@perforce.com> | 2014-06-16 17:04:52 +0100 |
---|---|---|
committer | Paul Allen <pallen@perforce.com> | 2014-06-20 12:16:29 +0100 |
commit | 8256eff1800e1377c7cf2b961ef63074a2ede0d4 (patch) | |
tree | a6dc22ae3fd34aa618ce3af7f2ac363455902f14 /lib | |
parent | 58f9cb20657a7be01777c920a37279f30dc1fce6 (diff) |
Add support for passing password/ticket
Uses param ‘p4passwd’ to set P4PASSWD environment to pass a valid
ticket or password.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/provider/vcsrepo/p4.rb | 2 | ||||
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/provider/vcsrepo/p4.rb b/lib/puppet/provider/vcsrepo/p4.rb index 2fdae70..df1ec21 100644 --- a/lib/puppet/provider/vcsrepo/p4.rb +++ b/lib/puppet/provider/vcsrepo/p4.rb @@ -162,12 +162,14 @@ Puppet::Type.type(:vcsrepo).provide(:p4, :parent => Puppet::Provider::Vcsrepo) d p4port = @resource.value(:p4port) p4user = @resource.value(:p4user) p4charset = @resource.value(:p4charset) + p4passwd = @resource.value(:p4passwd) p4client = @resource.value(:p4client) || client_name cfg = Hash.new cfg.store 'P4USER', p4user if p4user cfg.store 'P4PORT', p4port if p4port cfg.store 'P4CHARSET', p4charset if p4charset + cfg.store 'P4PASSWD', p4passwd if p4passwd cfg.store 'P4CLIENT', p4client if p4client return cfg diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index ad964c5..649789a 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -227,6 +227,10 @@ Puppet::Type.newtype(:vcsrepo) do newparam :p4charset, :required_features => [:p4_config] do desc "The Perforce P4CHARSET environment." end + + newparam :p4passwd, :required_features => [:p4_config] do + desc "The Perforce P4PASSWD environment." + end autorequire(:package) do ['git', 'git-core'] |