[Puppet Users] Re: inlined-epp with hash

2020-09-10 Thread Andreas Dvorak
I found a solution:
<%- | String $database_schemes,
 Hash[String, Hash[String, String]] $database_conf,
| -%>

DATABASES=<%= $database_schemes %>
<% $database_conf.keys.sort.each |$key| { -%>
##
<%= $key %>.jdbc.DRIVER=<%= $database_conf[$key]['oracle_cms_jdbc_driver'] 
%>
<% } -%>

Andreas Dvorak schrieb am Donnerstag, 10. September 2020 um 08:10:26 UTC+2:

> Hi,
>
> I have this structure in hiera and want to use it in a inlined-epp file
>
>
>
>
>
>
>
>
>
>
>
> *cms::params::database_conf: 'oracle_cms_dev':oracle_cms_jdbc_schema: 
> 'CMS_DEV'oracle_cms_jdbc_user: 'CMS_DEV'oracle_cms_jdbc_driver: 
> 'oracle.jdbc.OracleDriver'oracle_cms_jdbc_url: 'jdbc:oracle:thin:)' 
> 'oracle_cms_dev2':oracle_cms_jdbc_schema: 'CMS_DEV2'   
>  oracle_cms_jdbc_user: 'CMS_DEV2'oracle_cms_jdbc_driver: 
> 'oracle.jdbc.OracleDriver'oracle_cms_jdbc_url: 'jdbc:oracle:thin:*
>
> code in the class
> $vault_vars_jdbc = {
> 'database_conf' => $cms::params::database_conf,
> }
>
> epp file
> <%- |
>   Hash database_conf,
> | -%>
>
> But I get the error:
> Error: Failed to apply catalog: inline_epp(): Invalid EPP: Syntax error at 
> 'database_conf' (file: inlined-epp-text, line: 2, column: 11)
>
> So "Hash" does not work. Can somebody please help me?
>
> Regards,
> Andreas
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2c1244b6-e43d-4036-8ff6-95b0ca9c3886n%40googlegroups.com.


[Puppet Users] inlined-epp with hash

2020-09-10 Thread Andreas Dvorak
Hi,

I have this structure in hiera and want to use it in a inlined-epp file











*cms::params::database_conf: 'oracle_cms_dev':oracle_cms_jdbc_schema: 
'CMS_DEV'oracle_cms_jdbc_user: 'CMS_DEV'oracle_cms_jdbc_driver: 
'oracle.jdbc.OracleDriver'oracle_cms_jdbc_url: 'jdbc:oracle:thin:)' 
'oracle_cms_dev2':oracle_cms_jdbc_schema: 'CMS_DEV2'   
 oracle_cms_jdbc_user: 'CMS_DEV2'oracle_cms_jdbc_driver: 
'oracle.jdbc.OracleDriver'oracle_cms_jdbc_url: 'jdbc:oracle:thin:*

code in the class
$vault_vars_jdbc = {
'database_conf' => $cms::params::database_conf,
}

epp file
<%- |
  Hash database_conf,
| -%>

But I get the error:
Error: Failed to apply catalog: inline_epp(): Invalid EPP: Syntax error at 
'database_conf' (file: inlined-epp-text, line: 2, column: 11)

So "Hash" does not work. Can somebody please help me?

Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7f184df-f421-4488-8bb9-dbc6dc85065en%40googlegroups.com.


Re: [Puppet Users] Deferred without result

2020-06-15 Thread Andreas Dvorak
Hi,
>
>
I have
Puppet Agent v6.14.0. and puppetserver version: 6.10.0.
Do I need to update?

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8c29fe24-715d-422c-86aa-939f662fedfdo%40googlegroups.com.


[Puppet Users] Re: puppetserver - Performance and tuning

2020-06-15 Thread Andreas Dvorak
Hi,

according 
to https://puppet.com/docs/puppetserver/latest/config_file_puppetserver.html 
the maximum of max-active-instances is 4.

max-active-instances: Optional. The maximum number of JRuby instances 
allowed. The default is ‘num-cpus - 1’, with a minimum value of 1 and a 
maximum value of 4.

I have the problem that we switch from puppet 4 to puppet 6 on much faster 
hardware, but the agent runtime is longer.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4064399a-9c5a-4dad-9fa2-04114266dbdao%40googlegroups.com.


[Puppet Users] Deferred without result

2020-06-15 Thread Andreas Dvorak
Hello,

I am trying to use the deferred function according to the 
page http://puppet-on-the-edge.blogspot.com/2018/10/the-topic-is-deferred.html

My code does not show the time. Does anybody has a solution?

notify {"time_now":
  message => Deferred('new', [TimeStamp])
}

$d = Deferred('new', [TimeStamp])
notify {'time_now_2':
  message => "The time is: ${d}"
}

$dd = Deferred('new', [TimeStamp])
notify {"time_now_3":
  message => Deferred("sprintf", ["The time is: %s", $dd])
}

notify { 'time_now_4':
  message => Deferred('inline_epp', [@(END)])
  The time is: <%= TimeStamp() %>
  |- END
}


My result

Notice: Deferred({'name' => 'new', 'arguments' => [Timestamp]})
Notice: 
/Stage[main]/Vault::Consul_server::Install/Notify[time_now]/message: 
defined 'message' as 'Deferred({\'name\' => \'new\', \'arguments\' => 
[Timestamp]})'
Notice: The time is: Deferred({'name' => 'new', 'arguments' => [Timestamp]})
Notice: 
/Stage[main]/Vault::Consul_server::Install/Notify[time_now_2]/message: 
defined 'message' as 'The time is: Deferred({\'name\' => \'new\', 
\'arguments\' => [Timestamp]})'
Notice: Deferred({'name' => 'sprintf', 'arguments' => ['The time is: %s', 
Deferred({'name' => 'new', 'arguments' => [Timestamp]})]})
Notice: 
/Stage[main]/Vault::Consul_server::Install/Notify[time_now_3]/message: 
defined 'message' as 'Deferred({\'name\' => \'sprintf\', \'arguments\' => 
[\'The time is: %s\', Deferred({\'name\' => \'new\', \'arguments\' => 
[Timestamp]})]})'
Notice: Deferred({'name' => 'inline_epp', 'arguments' => ['The time is: <%= 
TimeStamp() %>']})
Notice: 
/Stage[main]/Vault::Consul_server::Install/Notify[time_now_4]/message: 
defined 'message' as 'Deferred({\'name\' => \'inline_epp\', \'arguments\' 
=> [\'The time is: <%= TimeStamp() %>\']})'

 
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/84e6d862-2c4c-41d6-b45e-f16f94594b99o%40googlegroups.com.


Re: [Puppet Users] puppet 6 facter -p Thread.exclusive is deprecated, use Thread::Mutex

2019-04-09 Thread Andreas Dvorak
Great thank you.
Years ago we created the fact.


Am Freitag, 5. April 2019 18:54:04 UTC+2 schrieb Josh Cooper:
>
>
> On Thu, Apr 4, 2019 at 11:45 PM Andreas Dvorak  > wrote:
>
>> Hi,
>>
>> I have installed a new server with puppet 6.
>>
>> I get these errors with facter. Can somebody please help me?
>>
>> facter -v
>> 3.13.1 (commit 4e1df48f76caa0eaeee90af4239a1df450d45cd7)
>>
>>
>> facter -p osmajorrelease
>> Thread.exclusive is deprecated, use Thread::Mutex
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in 
>> `meminfo_number'
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
>> levels) in '
>> Thread.exclusive is deprecated, use Thread::Mutex
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in 
>> `meminfo_number'
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
>> levels) in '
>> Thread.exclusive is deprecated, use Thread::Mutex
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in 
>> `meminfo_number'
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
>> levels) in '
>> Thread.exclusive is deprecated, use Thread::Mutex
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in 
>> `meminfo_number'
>> /opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
>> levels) in '
>> 7
>>
>> puppet-agent-6.4.0-1.el7.x86_64
>> puppetserver-6.3.0-1.el7.noarch
>> puppet6-release-6.0.0-1.el7.noarch
>>
>> Regards
>> Andreas
>> -- 
>> 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 puppet...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/038d99f1-8562-40c3-b993-548374913995%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/038d99f1-8562-40c3-b993-548374913995%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> The "meminbytes" fact is coming from a module and downloaded to the agent. 
> The Thread.exclusive call is not needed, and likely occurred when 
> copy/pasting from an old core fact in the Ruby facter implementation. We 
> removed that from core Ruby in 
> https://github.com/puppetlabs/facter/commit/159d3a682f141a5183c933be5ef2cf763f59bb6c#diff-5ac9627bb8707b6cf7eb398ec448edb2
>
> Josh
>
> -- 
> Josh Cooper | Software Engineer
> jo...@puppet.com  | @coopjn
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ede14e7b-ab18-4cc4-978a-9d78dfb77aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet 6 facter -p Thread.exclusive is deprecated, use Thread::Mutex

2019-04-05 Thread Andreas Dvorak
Hi,

I have installed a new server with puppet 6.

I get these errors with facter. Can somebody please help me?

facter -v
3.13.1 (commit 4e1df48f76caa0eaeee90af4239a1df450d45cd7)


facter -p osmajorrelease
Thread.exclusive is deprecated, use Thread::Mutex
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in `meminfo_number'
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
levels) in '
Thread.exclusive is deprecated, use Thread::Mutex
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in `meminfo_number'
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
levels) in '
Thread.exclusive is deprecated, use Thread::Mutex
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in `meminfo_number'
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
levels) in '
Thread.exclusive is deprecated, use Thread::Mutex
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:20:in `meminfo_number'
/opt/puppetlabs/puppet/cache/lib/facter/meminbytes.rb:13:in `block (3 
levels) in '
7

puppet-agent-6.4.0-1.el7.x86_64
puppetserver-6.3.0-1.el7.noarch
puppet6-release-6.0.0-1.el7.noarch

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/038d99f1-8562-40c3-b993-548374913995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] After mcollective update agent does not work anymore

2017-10-23 Thread Andreas Dvorak
thank you that was great help

the rpm puppet-agent bringt the ruby version 2.1

/opt/puppetlabs/puppet/bin/ruby  -e 'p $:' 
["/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0", 
"/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0/x86_64-linux", 
"/opt/puppetlabs/puppet/lib/ruby/site_ruby", 
"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0", 
"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0/x86_64-linux", 
"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby", 
"/opt/puppetlabs/puppet/lib/ruby/2.1.0", 
"/opt/puppetlabs/puppet/lib/ruby/2.1.0/x86_64-linux"]

So the file /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/pr0cess.so can not 
be read and the file is not compatible the version 2.1

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4729fd0d-8628-41f0-9488-73b47f901ce1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] After mcollective update agent does not work anymore

2017-10-20 Thread Andreas Dvorak
pr0cess is installed. The older mcollective works fine with that location.

>rpm -ql ruby-pr0cess
/usr/lib/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux/pr0cess.so

Do you know how to configure the location to the file or should I be it to 
an other place?

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7dff8b8-486b-4fc7-8afe-87027fbbf30a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] After mcollective update agent does not work anymore

2017-10-19 Thread Andreas Dvorak
Hi,

thank you. That is a good tip. The log says:

D, [2017-10-19T12:50:04.972364 #13809] DEBUG -- : agents.rb:104:in `block 
in findagentfile' Found ehyp at 
/usr/libexec/mcollective/mcollective/agent/ehyp.rb
D, [2017-10-19T12:50:04.972530 #13809] DEBUG -- : pluginmanager.rb:167:in 
`loadclass' Loading MCollective::Agent::Ehyp from mcollective/agent/ehyp.rb
D, [2017-10-19T12:50:04.974482 #13809] DEBUG -- : pluginmanager.rb:167:in 
`loadclass' Loading MCollective::Util::UnprivilegedAgent from 
mcollective/util/unprivilegedagent.rb
E, [2017-10-19T12:50:04.976625 #13809] ERROR -- : pluginmanager.rb:171:in 
`rescue in loadclass' Failed to load MCollective::Util::UnprivilegedAgent: 
cannot load such file -- pr0cess
E, [2017-10-19T12:50:04.976730 #13809] ERROR -- : pluginmanager.rb:171:in 
`rescue in loadclass' Failed to load MCollective::Agent::Ehyp: cannot load 
such file -- pr0cess
E, [2017-10-19T12:50:04.976815 #13809] ERROR -- : agents.rb:71:in `rescue 
in loadagent' Loading agent ehyp failed: cannot load such file -- pr0cess
D, [2017-10-19T12:50:04.976978 #13809] DEBUG -- : agents.rb:104:in `block 
in findagentfile' Found ehyp at 
/usr/libexec/mcollective/mcollective/agent/ehyp.rb
D, [2017-10-19T12:50:04.977093 #13809] DEBUG -- : pluginmanager.rb:167:in 
`loadclass' Loading MCollective::Agent::Ehyp from mcollective/agent/ehyp.rb
D, [2017-10-19T12:50:04.978885 #13809] DEBUG -- : pluginmanager.rb:167:in 
`loadclass' Loading MCollective::Util::UnprivilegedAgent from 
mcollective/util/unprivilegedagent.rb
E, [2017-10-19T12:50:04.980883 #13809] ERROR -- : pluginmanager.rb:171:in 
`rescue in loadclass' Failed to load MCollective::Util::UnprivilegedAgent: 
cannot load such file -- pr0cess
E, [2017-10-19T12:50:04.980981 #13809] ERROR -- : pluginmanager.rb:171:in 
`rescue in loadclass' Failed to load MCollective::Agent::Ehyp: cannot load 
such file -- pr0cess
E, [2017-10-19T12:50:04.981084 #13809] ERROR -- : agents.rb:71:in `rescue 
in loadagent' Loading agent ehyp failed: cannot load such file -- pr0cess

It finds the agent, but can not load it.

The first line the the agent is:
MCollective::Util.loadclass("MCollective::Util::UnprivilegedAgent")

What is wrong with that line?

If I remove that line the error is:
E, [2017-10-19T13:17:18.922324 #42703] ERROR -- : pluginmanager.rb:171:in 
`rescue in loadclass' Failed to load MCollective::Agent::Ehyp: cannot load 
such file -- open4

#MCollective::Util.loadclass("MCollective::Util::UnprivilegedAgent")
require 'open4'
require 'rubygems'

>rpm -ql ruby-open4
/usr/local/lib64/ruby/site_ruby
/usr/local/share/ruby/site_ruby
/usr/local/share/ruby/site_ruby/open4.rb

The open4 is installed, but can not be loaded. Why not?

Can you please help me?

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ddcfa5b8-dfac-42f4-a0f8-cbb5171b958a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] After mcollective update agent does not work anymore

2017-10-19 Thread Andreas Dvorak
Dear all,

I have an self written mcollective agent that does nocht work anymore, 
after the Puppet und MCollective update. All other agents are working.
Does anybody has an idea?


The client is running:
mcollective 2.6.0
puppet 3.7.1
Centos 6

locate ehyp.rb
/usr/local/libexec/mcollective/mcollective/agent/ehyp.rb
/usr/local/libexec/mcollective/mcollective/application/ehyp.rb

If the server has
Centos 6
mcollective 2.6.0
puppet 3.7.1
it does work

If server hast
Centos 6
mcollective-package-agent-4.4.0
puppet-agent-1.9.3
it does not work.

mcollective.log
D, [2017-10-19T10:44:27.294257 #122124] DEBUG -- : base.rb:120:in `block (2 
levels) in validate_filter?' Failing based on agent ehyp

server.cfg
/usr/local/libexec/mcollective:/usr/libexec/mcollective:/opt/puppetlabs/mcollective/plugins


Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7c1060b9-dfbb-48f9-a2a8-e68f368a7dd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet 4 logging

2017-01-18 Thread Andreas Dvorak
Dear all,

we are currently updating to Puppet Agent 4 
(puppet-agent-1.8.2-1.el7.x86_64), but we don´t have an agent log.

How do I activate the Agent log?

With Puppet 3 we configured to create the Puppet Agent log 
(/var/log/puppet/puppet_agent.log)
The file is written by the configuration 
>cat /etc/sysconfig/puppet 
PUPPET_LOG=/var/log/puppet/puppet_agent.log

With Puppet 4 we did
>cat /etc/sysconfig/puppet
PUPPET_LOG=/var/log/puppetlabs/puppet/puppet_agent.log
But I am not sure if we still need that.

>rpm -qa | grep puppet
puppetdb-4.3.0-1.el7.noarch
mcollective-puppet-agent-1.11.1-1.el7.noarch
puppetserver-2.7.2-1.el7.noarch
puppet-agent-1.8.2-1.el7.x86_64
mcollective-puppet-common-1.11.1-1.el7.noarch
puppetdb-termini-4.3.0-1.el7.noarch
puppetlabs-release-pc1-1.1.0-5.el7.noarch

If found 
>puppet config print | grep log
logdir = /var/log/puppetlabs/puppet
log_level = notice
static_catalogs = true
syslogfacility = daemon
catalog_terminus = compiler
catalog_cache_terminus = 
masterhttplog = /var/log/puppetlabs/puppet/masterhttp.log
puppetdlog = /var/log/puppetlabs/puppet/puppetd.log
agent_catalog_run_lockfile = 
/opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock
use_cached_catalog = false

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/98bd6786-0efa-4545-977e-5c9fa988f5bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: get one file with all server in puppet (export resource)

2016-06-24 Thread Andreas Dvorak
Thank you for the answer.
That will take some time to understand.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5c80fdc9-61c6-4feb-93f5-8d8f0846b875%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: get one file with all server in puppet (export resource)

2016-06-23 Thread Andreas Dvorak
Hi,

now I have change it a little, but it still does not work.

class check_mk::agent::serverlist {
  @@server_list { "$::hostname":
filename => '/tmp/checkmkhosts',
  }

  define server_list ( $filename ) {
ensure_resource ( 'file', $filename, {} )
  }

}

class check_mk::server::serverlist {
  Server_list <<| |>>
}

Error 400 on SERVER: Resource type server_list doesn't exist

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/76d56d21-bcf4-4610-9851-cab3b27cbf83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] get one file with all server in puppet (export resource)

2016-06-22 Thread Andreas Dvorak
Dear all

I would like to generate one file on a certain server with the hostname of 
all server that have puppet. But the collection of the hosts does not work.

First try with the error duplicate resource
class check_mk::agent::serverlist {
  @@file { '/tmp/checkmkhosts':
  content => "$::hostname|$::operatingsystem\n",
  tag => 'serverlist',
  }
}

class check_mk::server::serverlist {
  Export_server_list <<| |>>
}

Then I found an idea with a define
class check_mk::agent::serverlist {
  @@export_server_list { "$::hostname":
filename => '/tmp/checkmkhosts',
  }
}

define check_mk::agent::export_server_list ( filename ) {
  ensure_resource ( 'file', $filename, {} )
}

class check_mk::server::serverlist {
  check_mk::agent::export_server_list <<| |>>
}

but I get the error Syntax error at '<<|'; expected '|>>' at 
.../check_mk/manifests/server/serverlist.pp:2

Can somebody please help me?

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c77bb768-8898-49ae-8053-a338782491e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Could not find default node or by name with 'vm7012.muc.baag, if not defined in manifests/node.pp

2016-04-01 Thread Andreas Dvorak
Hi Chad,

thank that is the solution.


Andreas 

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1028625b-c8a2-4c59-a3c6-7a2f8e93c8f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Could not find default node or by name with 'vm7012.muc.baag, if not defined in manifests/node.pp

2016-03-31 Thread Andreas Dvorak
Dear all

if I do not list a server in the directory manifests e.g. in nodes.pp the 
agent says:
puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not find default node or by name with 'vm7012.muc.baag, vm7012.muc, 
vm7012' on node vm7012.muc.baag
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I know that is should work, because I have got it on an other Puppet Master 
server.
How can to solve that? It should be ignored that the server is not listed.

cat site.pp
if versioncmp($::puppetversion, '3.6.0') >= 0 {
  Package {
allow_virtual => true,
  }
}
hiera_include('classes')

cat hiera/common.yaml
classes:
  - profiles::base

Puppet 3.7.5

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/84c946c7-1b6b-40ea-8a7c-853596f86f4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] server not listed in manifests, but gets catalog

2016-01-11 Thread Andreas Dvorak
Hi,

after the update of the puppet master from 3.3.1 to 3.6.2 a host gets a 
catalog even if it is not defined in manifests. Is this a new 
funcationality? I did not see anything in the release notes.
It gets a catalog with all the information from profiles::base

manifests/
cat site.pp
node default {
notify { 'Server ist noch nicht in Puppet definiert': }
}

if versioncmp($::puppetversion, '3.6.0') >= 0 {
Package {
  allow_virtual => true,
}
}

hiera_include('classes')

a nodes.pp with server, but not the one 

hiera/
cat common.yaml
classes:
  - profiles::base


Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9377c926-8550-40ef-962b-d036e06bf33f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: server not listed in manifests, but gets catalog

2016-01-11 Thread Andreas Dvorak
Hi,

now I understand. Thank you.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4bf2ea84-059b-4d8d-8cea-39874250f7b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] read dir of classes.txt in ruby script

2015-12-09 Thread Andreas Dvorak
Dear all,

I would like to get the directory of the classfile. But I would like to use 
the puppet config print classfile.

Currently my scripts looks like that.

require 'facter'
Facter.add(:puppet_classes) do
  setcode do
dir = Facter.value('puppet_vardir')
lines_array = IO.readlines("#{dir}/classes.txt")
puppet_classes =  lines_array.sort.join(",")
puppet_classes.delete("\n")
  end
end

I found 

require 'puppet'

puts %x{puppet config print classfile}

But I don´t understand how to insert that in my script.

Can somebody please help me?

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c9f06cde-27ed-478d-a086-f366f2343260%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet with Foreman for reports but noch ENC

2015-10-23 Thread Andreas Dvorak
Hi Toni,

thank you for the tip. That is an eays way to solve my problem.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/32fc1af2-0514-4a68-943d-08deecf2445c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet with Foreman for reports but noch ENC

2015-10-21 Thread Andreas Dvorak
Hi,

thank you I will remove the two lines
   external_nodes = /etc/puppet/node.rb
   node_terminus  = exec
from the puppet.conf file.

Andreas


Am Dienstag, 20. Oktober 2015 18:41:54 UTC+2 schrieb David Schmitt:
>
> Hi Andreas, 
>
> On 20/10/2015 13:48, Andreas Dvorak wrote: 
> > Hello, 
> > 
> > currently I am running a Puppet Master with Foreman for reports and 
> > ENC and I have only one environment. The environment parameter in the 
> > file puppet.conf is not used because Foreman is an ENC. 
> > Now I want to configure different environments and want to set the 
> > environment in the puppet.conf of the Puppet agent. 
> > 
> > What is the best installation method for a new Puppet Master? 
> > - foreman-installer and configure foreman without ENC, but I don't 
> > know the relevant settings. 
> > - Installation of puppet-server without foreman and add foreman later 
> > for the reports 
>
> The master and foreman are connected by two settings in the master's 
> puppet.conf. 
>
> The ENC is described at 
> https://docs.puppetlabs.com/guides/external_nodes.html#connecting-an-enc 
> , the report destination is handled by 
> https://docs.puppetlabs.com/references/latest/configuration.html#report 
>
> Those two settings are independent of each other and can be changed at 
> will (modulo a restart of the master/server). How you do that depends on 
> the way you are managing those settings. 
>
>
> Hope that helped, D. 
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8ba87802-6b83-44a5-92ba-f704f0cb3068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet with Foreman for reports but noch ENC

2015-10-20 Thread Andreas Dvorak
Hello,

currently I am running a Puppet Master with Foreman for reports and ENC and 
I have only one environment. The environment parameter in the file 
puppet.conf is not used because Foreman is an ENC.
Now I want to configure different environments and want to set the 
environment in the puppet.conf of the Puppet agent.

What is the best installation method for a new Puppet Master?
- foreman-installer and configure foreman without ENC, but I don't know the 
relevant settings.
- Installation of puppet-server without foreman and add foreman later for 
the reports 

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/babf75cc-3f74-46f0-bbb8-31a332fa06cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet local environment doesn't match server specified node environment switching agent to

2015-09-22 Thread Andreas Dvorak
Hi,

I have created a new environment for windows server, but the agent does not 
use it. Can somebody please help me?

message on agent run:
puppet local environment windows doesn't match server specified node 
environment switching agent to production

puppet.conf of windows agent

[main]
server=puppet-simu.baag
ca_server=puppet1-simu.baag
autoflush=true

[agent]
environment=windows
pluginsync=true

puppet.conf of master
[main]
autosign= $confdir/autosign.conf { mode = 664 }
environmentpath = $confdir/environments
logdir  = /var/log/puppet
rundir  = /var/run/puppet
ssldir  = $vardir/ssl
privatekeydir   = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }
pluginsync  = true

[agent]
classfile = $vardir/classes.txt
localconfig   = $vardir/localconfig
default_schedules = false
report= true
pluginsync= true
masterport= 8140
environment   = production
certname  = sv2655.muc.baag
dns_alt_names = puppet-simu.baag, puppet1-simu.baag
server= sv2655.muc.baag
listen= false
splay = false
runinterval   = 1800
noop  = false
show_diff = false

[master]
autosign   = $confdir/autosign.conf { mode = 664 }
reports= foreman
external_nodes = /etc/puppet/node.rb
node_terminus  = exec
ca = true
ssldir = /var/lib/puppet/ssl

cat environment.conf 
config_version = /usr/bin/git --git-dir /data/git/windows/.git show --stat 
| head -1| cut -d" " -f2
manifest   = /data/git/windows/manifests
modulepath = /data/git/windows/modules

# pwd
/etc/puppet/environments
# ls -l
total 20
drwxr-xr-x 2 root root 4096 Oct 18  2013 common
drwxr-xr-x 3 root root 4096 Oct 18  2013 development
drwxr-xr-x 4 root root 4096 Sep 21 09:48 example_env
drwxr-xr-x 3 root root 4096 Sep 21 10:09 production
drwxr-xr-x 2 root root 4096 Sep 22 08:48 windows

# pwd
/data/git/windows/manifests

# ls -l
total 4
-rw-rw-r-- 1 gitwin gitwin  23 Sep 22 08:41 nodes.pp
-rw-rw-r-- 1 gitwin gitwin 195 Sep 22 08:41 site.pp
# cat site.pp
node default {
  notify { 'Server ist noch nicht in Puppet definiert': }
}
if versioncmp($::puppetversion, '3.6.0') >= 0 {
  Package {
allow_virtual => true,
  }
}
hiera_include('classes')

# cat nodes.pp
node 'vm7523.baag' {
}

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3b134331-5c38-47b4-bef5-9dd467318b4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet local environment doesn't match server specified node environment switching agent to

2015-09-22 Thread Andreas Dvorak

>
> Hi,
>

I am using Puppet 3.6.2 free version. The node classification is done by 
the node.pp file.
I do not understand the group. Where does the Puppet Master do the 
overwritting of the environment?

Andreas

>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3c8e7d1b-1044-47bf-823e-ac06a8e23e7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet local environment doesn't match server specified node environment switching agent to

2015-09-22 Thread Andreas Dvorak
Hi,

now I found out that I need to create the new windows environment in The 
Foreman. Than I change the server in The Foreman from production to windows.

Thank you.

Andreas



-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/dcc28dce-9744-4045-80ba-e7f5205f9467%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use file resource with source file name unknown

2015-07-08 Thread Andreas Dvorak
Hi,

thank for the help.
I have solved the issue with the generate funktion.
  $redhatfiles = generate(/bin/bash,-c,/bin/ls 
/data/git/${zweig}/modules/networking/files/${::hostname}/network-scripts 
2/dev/null | tr -t '\n' ':')
  $redhat_interfaces = split($redhatfiles, :)
  redhat::create_interface { $redhat_interfaces: }

Unfortunately spaces are not allowed in the generate funktion. But I have 
found a solution.
https://projects.puppetlabs.com/issues/5481

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/17dad4e1-1169-45a5-aeba-db4782a457c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to use file resource with source file name unknown

2015-07-07 Thread Andreas Dvorak
Hello,

I have a module to copy files /etc/hostname.* in Solaris. But the interface 
name can be any.

e.g.
networking/file/vm6742/hostname.e1000g0
networking/file/vm6742/hostname.e1000g1

I do not want to user file with recurse because the files in /etc have 
different permissions.

Is it possible to get a file list of the source to use that in the file 
resource or is there an other solution?


Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1b0199b1-7e9b-47ff-a08a-10ef8ae6c5bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to access fact with host specific name like zone_vm5809_iptype

2015-07-03 Thread Andreas Dvorak
Thank you that is nice

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/809db7e5-4840-4336-8c64-6c8bafd3c7a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to access fact with host specific name like zone_vm5809_iptype

2015-07-03 Thread Andreas Dvorak
Dear all,

I would like to use the fact zone_vm5809_iptype, but vm5809 is specific to 
the host vm5809.
If this fact on any host is excl do something

Can somebody please help me?

I have tried:
if ( $::zone_${::hostname}_iptype == 'excl')
Could not match ${::hostname}_iptype
or
$hostname = $::hostname
if ( $::zone_${hostname}_iptype == 'excl')
Could not match ${hostname}_iptype

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f3f84313-2b35-4c25-9b52-5936700e1ed2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet 3.6.2 puppet parser validate failed pre-receive One or more file(s) specified did not exist

2015-03-26 Thread Andreas Dvorak
Dear all,

after the update of the Pupppet Master from 3.3.1 to 3.6.2 the git push 
with a pre-receive hook does not work. My local check does work. In my 
pre-commit I have the same checks.
Is it possible that the git pre-receive hook does not find the file in 
source?
Why does it work in version 3.3.1?

git push

remote:  Checking modules/monit/manifests/config.pp for syntax errors and 
styleguide compliance... 
remote: 'puppet parser validate' failed on 
modules/monit/manifests/config.pp - push deniend. Run tests locally and 
confirm they pass before pushing. 
remote: Error: One or more file(s) specified did not exist:
remote:2
remote: 
remote: Error: Try 'puppet help parser validate' for usage
To git@rh6-puppet-master:/data/git/test.git
 ! [remote rejected] master - master (pre-receive hook declined)


cat config.pp 
class monit::config{
  file {'/etc/monit.conf':
ensure = present,
owner  = 'root',
group  = 'root',
mode   = '0700',
source = [
puppet:///modules/monit/monit.conf_${hostname},
'puppet:///modules/monit/monit.conf',
],
  }
}


Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/128791b0-0364-4136-8e62-aab35750e65c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: delete line in file with substring xyz

2015-02-27 Thread Andreas Dvorak
Hi,

it is a shame, that file_line is not able to delete line on the basis of a 
substing.
Currently I use this to delete a line 
  exec { /usr/bin/perl -ni -e '/${line}/ or print' '${file}':
onlyif = ${grep} -qF '${line}' '${file}'
  }

Best regards
Andreas

Am Donnerstag, 26. Februar 2015 15:52:22 UTC+1 schrieb jcbollinger:



 On Thursday, February 26, 2015 at 2:39:51 AM UTC-6, Andreas Dvorak wrote:

 Hi,

 I have just tried the stdlib version 4.5.1.
 According to the change log with version 4.5.0 
 Don't require line to match the match parameter
 But my test does not work
   file_line {'test':
 ensure = 'absent',
 path   = '/root/.ssh/authorized_keys',
 match  = 'test',
   }
 Error: Failed to apply catalog: Validation of File_line[test] failed: 
 Both line and path are required attributes at 
 /data/git/test/modules/accounts/manifests/del_key_in_root.pp:204
 Wrapped exception:
 Both line and path are required attributes



 You could solve that issue by providing a 'line' property with a dummy 
 value, as in some of your previous attempts.  Alas, although that should 
 prevent the exception, it will not get you to where you want to be.  
 File_line doesn't do that.

 The key thing to understand here is that File_line represents a *specific* 
 line in a file.  The 'match' parameter is *not* about recognizing that 
 line, it is about how to introduce it into the file if that is necessary.  
 When you ensure a File_line 'absent', you are saying that the file 
 identified by it's 'path' should not contain any line that is an exact, 
 character-for-character match to the 'line' parameter (because *that* is 
 what the resource represents).

 For SSH authorized keys in particular, you should look into the built-in 
 Ssh_authorized_key resource type.  More generally, if there is not 
 already a module or built-in resource type specific to the file you're 
 trying to manage, and you don't want to create one, then the more-or-less 
 universal fallback is an Exec resource.


 John



-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c2b87e1d-dfd4-4073-b934-2c65d257c5a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: delete line in file with substring xyz

2015-02-26 Thread Andreas Dvorak
Dear all

now I tried

  file_line {'test':
ensure = 'absent',
path   = '/root/.ssh/authorized_keys',
line   = 'test',
  }
Line ssh-rsa SNNwKzN/c1JmSlYOy4hK1yYsOJKOK+n5Vivt3DJGwxL3VpU= test@abc is 
still there

With
  file_line {'test':
ensure = 'absent',
path   = '/root/.ssh/authorized_keys',
match  = 'test',
  }

I get the error Error: Failed to apply catalog: Validation of 
File_line[test] failed: Both line and path are required attributes at 
/data/git/test/modules/accounts/manifests/del_key_in_root.pp:204

With this the line is not removed.
  file_line {'test':
ensure = 'absent',
path   = '/root/.ssh/authorized_keys',
line   = 'test',
match  = 'test',
  }

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/effd1d59-703b-4fed-b9f2-ba0d21a17e60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: delete line in file with substring xyz

2015-02-26 Thread Andreas Dvorak
Hi,

I have just tried the stdlib version 4.5.1.
According to the change log with version 4.5.0 
Don't require line to match the match parameter
But my test does not work
  file_line {'test':
ensure = 'absent',
path   = '/root/.ssh/authorized_keys',
match  = 'test',
  }
Error: Failed to apply catalog: Validation of File_line[test] failed: Both 
line and path are required attributes at 
/data/git/test/modules/accounts/manifests/del_key_in_root.pp:204
Wrapped exception:
Both line and path are required attributes

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ec927e8a-21ca-4351-abff-d032a6faae20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] delete line in file with substring xyz

2015-02-25 Thread Andreas Dvorak
Dear all

I would like to use the stdlib Modul with file_line to delete a line that 
matches *xyz*.
But the resource

file_line {'delete line':
  ensure = absent,  
  path = '/etc/file', 
  line = '*xyz*',
}

or 

file_line {'delete line':
  ensure = absent,  
  path = '/etc/file', 
  match = '*xyz*',
}

does not work.

My current solution is with an exec resource but I don't like it.

Does anymbody know how to do it with file_line?

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bd72d951-bcb7-4091-879e-047d65d20407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Solaris package installation unattended does not work

2015-02-20 Thread Andreas Dvorak
Hi John,

thank you for you help. Now it is working.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/48238a12-68ac-4a7a-82f6-0ad3e2025bd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] user ensure absent :No command localdelete defined for provider

2014-11-04 Thread Andreas Dvorak
Hi Nan,

yes it really looks like that.
I have puppet versin 3.3.1, but don't see an information in which version 
it is solved.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b276d482-99ba-4f42-83e2-f68de9c5fcfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Dynamic Environments and Hiera

2014-11-04 Thread Andreas Dvorak
Thank you for the information. Now I have got a solution.

class facts::app_fact(
  $app = hiera('app_fact',undef)
){
  file{'/etc/facter':
ensure = directory,
owner  = 'root',
group  = 'root',
mode   = '0755',
  }
  file{'/etc/facter/facts.d':
ensure  = directory,
owner   = 'root',
group   = 'root',
mode= '0755',
require = File['/etc/facter'],
  }
  if $app != undef {
file{'/etc/facter/facts.d/app.txt':
  ensure  = file,
  owner   = 'root',
  group   = 'root',
  mode= '0644',
  content = template('facts/app.erb'),
}
  }
  else {
file{'/etc/facter/facts.d/app.txt':
  ensure = absent,
}
  }
}

cat app.erb 
app=%= @app %


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0a79c776-7d9f-4a51-ad34-5bdb0cf9dfb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to get notified when puppet fact has some values

2014-11-04 Thread Andreas Dvorak
Hi,

you can check it on the server with facter -p name_of_fact

in a class
 notify{My fact: $::name_of_fact:}

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1c80823f-a973-46bd-a4cb-676aabce1d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] user ensure absent :No command localdelete defined for provider

2014-11-03 Thread Andreas Dvorak
Dear all,

I have a modul accounts to create user. That is working fine. Today I would 
like to remove a user but it does not work.
Unfortunately I don't understand the error. Can you please have a look?

Error: No command localdelete defined for provider 
Error: 
/Stage[main]/Accounts/Accounts::Virtual[testuser]/User[testuser]/ensure: 
change from present to absent failed: No command localdelete defined for 
provider 

cat init.pp
class accounts {
  @accounts::virtual { 'testuser':
ensure = absent,
comment  = 'testuser',
uid  = '1000',
gid  = '1000',
group= 'testuser',
  }

}

define accounts::virtual (
  $ensure= present,
  $comment   = undef,
  $uid   = undef,
  $home  = undef,
  $group = undef,
  $gid   = undef,
  $password  = undef,
  $shell = '/bin/bash',
  $sshkeytype= 'rsa',
  $sshkey= undef,
  $sol10_profile = undef,
  $sol11_profile = undef,
  ) {
  include accounts::groups

  $username = $title

  user { $username:
ensure = $ensure,
comment= $comment,
uid= $uid,
gid= $gid,
shell  = $shell,
home   = $home_dir,
managehome = true,
forcelocal = true,
password   = $password,
  }

}

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3085ee71-0526-452c-840f-330ab3166c29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Dynamic Environments and Hiera

2014-11-03 Thread Andreas Dvorak
Hi,

today I started working with roles in hiera, but somewhere must be 
something wrong. In my test I would like to install a special version of 
facter on the server vm6740 that does belong to my test role, but it is 
installed the version from the common.yaml

cat hiera.yaml 
---
:backends: yaml
:yaml:
  :datadir: /data/git/test/hiera
:hierarchy: 
  - %{hostname}
  - %{role}_role
  - common
:logger: console

cat vm6740.yaml 
---
role: test

cat test_role.yaml 
---
facter::version: 2.3.0-1

cat common.yaml 
---
facter::version: 2.1.0-1

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cb539ce7-daa7-4421-bc26-e772ccdbf3ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: user ensure absent :No command localdelete defined for provider

2014-11-03 Thread Andreas Dvorak
Hi John,

the OS is RedHat 5 and 6.

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/892e26b3-b70d-414e-99e2-87f72919da18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] schedule whole class and not only resources

2014-10-27 Thread Andreas Dvorak
Dear all,

thank you for the responses.
My class has serval different resources types.

If there is no eays solution, it does not matter.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8df3df44-b41e-4e69-893e-262b5a56d030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet agent message: Could not retrieve local facts: Could not find fact 'define_fact'

2014-10-27 Thread Andreas Dvorak
Hi Wil,

thank you. The restart was missing.
So easy but I did not think about that.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f794ab18-14e1-4848-b3a1-5116d1231e70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet agent message: Could not retrieve local facts: Could not find fact 'define_fact'

2014-10-24 Thread Andreas Dvorak
After downgrade facter to 1.7.1 the error is gone.
Then I did the update again and the error was back again.

I have many server that already have the version 2.1, without an update.

I don't understand why the update does not work.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e6383291-1fee-4fe1-abf0-73f9e627e737%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet agent message: Could not retrieve local facts: Could not find fact 'define_fact'

2014-10-24 Thread Andreas Dvorak
Hi,

thank you for the answer.
No I don't have multiple facter installed.
find / -name facter
/usr/bin/facter
/usr/lib/ruby/site_ruby/1.8/facter
/var/lib/puppet/lib/facter

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d33bf49f-334d-4865-a123-7dda09739f38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet agent message: Could not retrieve local facts: Could not find fact 'define_fact'

2014-10-23 Thread Andreas Dvorak
Dear all,

since today the puppet agent does not work anymore if it is executed by 
service.
I prints out:
Could not retrieve local facts: Could not find fact 'define_fact'

If I run puppet agent -t I do not get the message.
I have updated facter from 1.7.1 to 2.1 and hiera from 1.2.1 to 1.3.4

I have
Linux RedHat 5 and 6
puppet 3.3.1
facter 2.1.0
hiera 1.3.4
ruby 1.8.7

Does any have an idea?

Thanks
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8356462c-e2de-42b9-bb51-d57a0f9c6590%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: resource file with option source or content depending if source does exist

2014-10-21 Thread Andreas Dvorak
Hi,

thank you, the line 
content = $a ? { '' = template($template), default = $a }
solves my problem.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c7bf05f6-f0e9-4d3e-8e5c-83254a7ceccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] resource file with option source or content depending if source does exist

2014-10-20 Thread Andreas Dvorak
Hi,

no I habe a puppet master.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b02f382f-2fd8-415a-9ffd-0e8413a8e427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] resource file with option source or content depending if source does exist

2014-10-17 Thread Andreas Dvorak
Dear all,

I would like to use the file resource to supply a host specific file. If it 
does exist choose it and if not create a file from a template.
I tried this, but then /mnt/motd needs to be on all server.

  $a = file(/mnt/motd/motd-${::hostname},'/dev/null')
  if($a != '') {
file {$config_file:
  ensure = 'file',
  owner  = 'root',
  group  = 'root',
  mode   = '0644',
  source = puppet:///motd_files/motd/motd-${::hostname},
}
  }
  else {
file { $config_file:
  ensure  = 'file',
  owner   = 'root',
  group   = 'root',
  mode= '0644',
  content = template($template),
}
  }

If I try this 
 $a = file(puppet:///motd_files/motd/motd-${::hostname},'/dev/null')
I get the error that Files must be fully qualified

Does anybody has a solution for that?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bb44ef68-dcda-4c35-9e47-58008e88480a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to transfer list of interfaces from hiera to class

2014-10-14 Thread Andreas Dvorak
Hi,

I would like to create network interfaces with puppet.
I have
define network_interface::managed_interface(
  $device='',
  $gateway='',
  $hostname='',
  $hwaddr='',
  $ipaddr='',
  $netmask='',
  $network='',
  $up=true,
){

and
class network_interface::create_interface (
  $device = hiera()',
){
  managed_interface { $device:
device  = $device,
ipaddr  = $ipaddr,
netmask = $netmask, 
  }
}

and hiera yaml file:
network_interface:
  eth0:
ipaddr: 10.112.67.40
netmask: 255.255.0.0
  eth1:
ipaddr: 10.15.67.40
netmask: 255.255.0.0

Now I don't know how to read the hiera values in the class 
network_interface::create_interface. The interface names can be different.
Can some please help me?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b3298b5f-0fd0-48fa-9936-eea3a1719add%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to transfer list of interfaces from hiera to class

2014-10-14 Thread Andreas Dvorak
Dear all,

suddenly I found the solution:
network_interface::device_list:
  eth0:
ipaddr: 10.112.67.40
netmask: 255.255.0.0
  eth1:
ipaddr: 10.15.67.40
netmask: 255.255.0.0

class network_interface (
  $device_list={}
){
  create_resources('network_interface::managed_interface',$device_list,{})
}

define network_interface::managed_interface(
  $device=$title,
  $gateway='',
  $hostname='',
  $hwaddr='',
  $ipaddr='',
  $netmask='',
  $network='',
  $up=true,
){

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/602cdbed-b7dc-4879-b80f-99d4f8a8df46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] schedule whole class and not only resources

2014-10-01 Thread Andreas Dvorak
Dear all,

I have a class with many resource that should only run at one certain time. 
I could add a schedule to every resource, but that is the same line at all 
the resources.
Is there a solution to schedule the whole class at one place.

something like this

include abc {
 schedule 
}

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/674857d1-bc31-4de7-ade7-2f51632b4316%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] schedule module according to certain server

2014-07-03 Thread Andreas Dvorak
Dear all,

I have a modul to install the apache webserver and I have server with 
different maintainance time frames.
So I can not create a schedule in the apache modul to install it a a 
certain time.
Is it possible to combine the include apache with a schedule.
For example the profile of server a 
include apache schedule 01:00 - 02:00
and profile of server b
include apache schedule 03:00 - 04:00

Or is it possible to use hiera to provide server specific schedule?

Can somebody please help me?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/06e32159-6cb2-4c79-9192-de3935a56329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] package resource with pkgutil can not resolv dependencies

2014-05-08 Thread Andreas Dvorak
Dear all

I would like to install sudo vom opencsw. I have created one package with 
all the dependencies.
I can install the package on the server without problems, but if I try to 
install the package with puppet it fails. 

Can somebody please help me?

class:
  package {'CSWsudo':
ensure   = installed,
provider = 'pkgutil',
alias= 'sudo',
  }

Error: Execution of '/opt/csw/bin/pkgutil -y -i CSWsudo' returned 1: 
Solving needed dependencies ...
Warning: CSWcas-migrateconf not in catalog.
Warning: CSWcas-preserveconf not in catalog.
Warning: CSWlibz1 not in catalog.
Warning: CSWiconv not in catalog.
Package CSWggettext-data not in catalog. Exiting.

All of them are in the CSWsudo package

pkgadd -d CSWsudo_sparc_1.8.6p8.pkg

The following packages are available:
  1  CSWcas-migrateconf  cas_migrateconf - Class action script 
migrateconf
 (all) 1.47,REV=2012.02.14
  2  CSWcas-preserveconf cas_preserveconf - Class action script 
preserveconf
 (all) 1.49,REV=2013.03.13
  3  CSWcommon   common - common files and dirs for CSW packages
 (sparc) 1.5,REV=2010.12.11
  4  CSWggettext-dataggettext_data - GNU locale utilities, 
translation files
 (all) 0.18.1.1,p,REV=2011.03.15
  5  CSWiconviconv_stub - Transitional package. Content 
moved to CSWlibcharset1 CSWlibiconv2
 (all) 1.14,REV=2011.08.08
  6  CSWlibcharset1  libcharset1 - GNU iconv charset library, 
libcharset.so.1
 (sparc) 1.14,REV=2011.08.07
  7  CSWlibiconv2libiconv2 - GNU iconv library, libiconv.so.2
 (sparc) 1.14,REV=2011.08.07
  8  CSWlibintl8 libintl8 - GNU locale utilities, libintl.so.8
 (sparc) 0.18.1.1,p,REV=2011.03.15
  9  CSWlibz1libz1 - Zlib data compression library, 
libz.so.1
 (sparc) 1.2.7,REV=2012.06.14
 10  CSWsudo sudo - Provides limited super user privileges
 (sparc) 1.8.6p8,REV=2013.04.27

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/728a1aa8-0b5a-4f63-af34-89f1d7ad4e15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] package resource with pkgutil can not resolv dependencies

2014-05-08 Thread Andreas Dvorak
Hi Frederik,

/opt/csw/bin/pkgutil -a   has the correct output 

common   package  catalog
size
libgcc   SMClgcc346   3.4.61.8 
MB
libiconv SMCliconv1.11 2.2 
MB
libiconv2CSWlibiconv2 1.14,REV=2011.08.07  2.0 
MB
libintl  SMClintl 3.4.0  319.5 
KB
libintl8 CSWlibintl8  0.18.1.1,p,REV=2011.03.155.0 
MB
logrotateCSWlogrotate 3.8.1,REV=2011.09.04 2.3 
MB
rsyslog  CSWrsyslog   5.8.13,REV=2012.09.171.5 
MB
sed  SMCsed   4.2.1  429.1 
KB
sudo SMCsudo  1.7.4p6518.7 
KB
zlib_stubCSWzlib  1.2.8,REV=2013.09.2317.8 
MB

the alias is not used.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1c15509a-fb8a-460f-bd6c-9d6bbea94081%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] package resource with pkgutil can not resolv dependencies

2014-05-08 Thread Andreas Dvorak
Hi Frederik,

the packages are all in the CSWsudo package.

I tried /opt/csw/bin/pkgutil -y -i CSWsudo and it has the same dependency 
problem.
But /opt/csw/bin/pkgutil -N -i CSWsudo does work.

So I tried
  package {'CSWsudo':
ensure= installed,
provider  = 'pkgutil',
install_options = '-N',
  }

But again
Error: Execution of '/opt/csw/bin/pkgutil -y -i CSWsudo' returned 1: 
Solving needed dependencies ...
Warning: CSWcas-migrateconf not in catalog.
Warning: CSWcas-preserveconf not in catalog.
Warning: CSWlibz1 not in catalog.
Package CSWiconv not in catalog. Exiting.

It does not use the -N option.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1449dd4c-7700-4c42-a87c-dba243186264%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] package resource with pkgutil can not resolv dependencies

2014-05-08 Thread Andreas Dvorak
Hi Frederik,

my solution is to install all packages separatly.
This time is was not to much work, but with a package with more 
dependencies is is bad.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f6ae9f58-9f9f-48a4-8b75-03d375a224c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] schedule resource user

2014-04-04 Thread Andreas Dvorak
Dear all,

I would like so schedule the resource user.
Sometime spezial user need a locally set password that should be reset hat 
night.

Unfortunately the resouce user does not have the option schedule. Does 
somebody have a solution for that?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2a0157e0-08c1-4786-b05a-5e6eff0ac207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: schedule resource user

2014-04-04 Thread Andreas Dvorak
I have made something wrong, now it does work

Am Freitag, 4. April 2014 10:48:39 UTC+2 schrieb Andreas Dvorak:

 Dear all,

 I would like so schedule the resource user.
 Sometime spezial user need a locally set password that should be reset hat 
 night.

 Unfortunately the resouce user does not have the option schedule. Does 
 somebody have a solution for that?

 Best regards
 Andreas


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c4ef2aa6-92e5-4b5f-aaca-af515a79c8b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: classe uses two defines but second is ignored

2014-02-17 Thread Andreas Dvorak
Hi John,

thank you for your reply. You have found an other issue.
But my main problem is that the second call of replace is ignored.
I still do not understand the reason.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/81a0b91a-d450-4ea3-96db-cb99b8dfd57e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] classe uses two defines but second is ignored

2014-02-12 Thread Andreas Dvorak
Dear all,

ich habe a defined class, that is called two times in on class but only the 
first call is executed.
baader::replace {'access notConfigGroup' is done, but not baader::replace 
{'com2sec notConfigUser':
And baader::replace {'view all included': is done.
Can somebody please explain the reason and how can I solve this?

define baader::replace($file, $old, $new, $ensure = 'replace') {
  $grep='/bin/grep'
  $sed='/bin/sed'
  
  case $ensure {
default : { err ( unknown ensure value ${ensure} ) }
replace : {
  exec { ${sed} -i -e's/${old}/${new}/' '${file}':
unless = ${grep} -qFx '${old}' '${file}',
onlyif = /usr/bin/test -f '${file}',
  }
}
insert_after : {
  exec { ${sed} -i -e's/${old}/\\n${new}/' '${file}':
unless = ${grep} -qFx '${old}' '${file}',
onlyif = /usr/bin/test -f '${file}',
  }
}
  }
}

class snmp::config{
  case $::osfamily {
redhat:{
baader::replace {'access notConfigGroup':
ensure = 'replace',
file   = '/etc/snmp/snmpd.conf',
old= 'access  notConfigGroup \\  any   noauth
exact  systemview none none',
new= 'access  notConfigGroup \\  any   noauth
exact  all none none',
  }

  baader::replace {'com2sec notConfigUser':
ensure = 'replace',
file   = '/etc/snmp/snmpd.conf',
old= 'com2sec notConfigUser  default   public',
new= 'com2sec notConfigUser  default   Baad01',
  }

  baader::replace {'view all included':
ensure = 'insert_after',
file   = '/etc/snmp/snmpd.conf',
old= '#   name   incl\/excl subtree 
mask(optional)',
new= 'viewallincluded  .1',
  }
}

...

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d095eb0d-3167-4e6d-906a-eab9d7783f83%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Pupppet syslog unrecognised escape sequence in string

2014-02-04 Thread Andreas Dvorak
Dear all,

I have several exec resources that work fine, but the puppet master throws 
a syslog message

Unrecognised escape sequence \# in file 
/data/git/simulation/modules/base_modification/manifests/only_solaris.pp at 
line 14

14: exec{ /bin/sed '\#^/home#d' /etc/auto_master  /tmp/sed.tmp.$$  mv 
/tmp/sed.tmp.$$ /etc/auto_master:
15:onlyif = /bin/grep '^/home' /etc/auto_master
16:  }

I do not want to filter that mesage, but how can tell puppet this is fine 
or do I need to change the exec resource.

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/df83f496-54cb-4c65-9382-dd907c0393d9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Pupppet syslog unrecognised escape sequence in string

2014-02-04 Thread Andreas Dvorak
Hi,

thank you I think I do understand it.
Here is my solution
exec{ '/bin/sed \'\#^/home#d\' /etc/auto_master  /tmp/sed.tmp.$$  mv 
/tmp/sed.tmp.$$ /etc/auto_master'
and it works

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9d8072bf-fc8b-4890-901f-38378ada6fbb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Is there any other tool other than mcollective for orchestration..

2014-01-31 Thread Andreas Dvorak
Hi Derek,

can you please explain who to build the Solaris package?

Best regards
Andreas

Am Donnerstag, 7. Februar 2013 22:42:53 UTC+1 schrieb Derek Olsen:

 Rajeev. 

 We run mcollective in a 100% Solaris shop.  We have not encountered 
 any Solaris specific issues.   Email me if you want the steps we use 
 to build the Solaris packages. 

 Thanks. Derek. 


 On Feb 7, 2:01 am, DreamBig rajeev.n.i...@gmail.com wrote: 
  Thanks.. 
  
  On Feb 7, 2:31 pm, kavitha.c.k2...@gmail.com wrote: 
  
  
  
  
  
  
  
   Hi, 
  
   There is a tools called Ansible , I think it works on solaris 
  
   Kavitha 
  
   On Thursday, February 7, 2013 2:28:32 PM UTC+5:30, Rajeev Iyer wrote: 
  
Hi, 
  
I guess mcollective supports only linux and similar OS. It does not 
have a package for Solaris or even a way to create a package from 
standard tar file. Can someone suggest any other tool? 
  
Regards, 
Rajeev 


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0c01c310-8380-491f-b43c-34b1cb04989d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] run or execute only by call with manually running agent

2014-01-30 Thread Andreas Dvorak
Hi all,

I have an install routine that should never be executed by puppet 
automatically.
But I would like to execute it sometimes by running something like this:
puppet agent -t --ignoreschedules --tags never

One idea is to create a schedule 
class never{

 schedule { 'never':
   repeat = 0,
 }

 exec

}

or
class never{

 schedule { 'never':
   periode = never,
 }

 exec

}

What is a good solution?

Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1feb194c-3ebf-41f8-9aff-f743783a2114%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: checking is package is installed ?

2014-01-30 Thread Andreas Dvorak
Hi,

I think the explaination of Gareth is wrong.
absend will uninstall a package

I am using absend to uninstall package and here is a web site about that.
http://www.puppetcookbook.com/posts/remove-package.html

Best regards 
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b93a1321-01ea-4c20-b15e-ac07a35e5bd3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: file resource to provide serveral files

2014-01-27 Thread Andreas Dvorak
Hi,

thank you now it is working.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ba52661e-31c0-49b6-bbe0-8b784057bf8f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] file resource to provide serveral files

2014-01-24 Thread Andreas Dvorak
Dear all,

with my class config.pp I would like to provide config file to 
/etc/logrotate.d.

filename: config.pp
class logrotate::config($conf_file){
  case $::osfamily {
redhat:{
  file { /etc/logrotate.d/${conf_file}:
ensure = 'present',
owner  = 'root',
group  = 'root',
mode   = '0644',
source = puppet://${puppetmaster}/modules/logrotate/${conf_file},
  }
}
solaris:{
  notice('logrotate not available')
}
default:{
  fail(Unsupported platform: ${::osfamily})
}
  }
}

In the nodes.pp I have
  class {'logrotate::config':
conf_file = 'test',
  }

but I get the error
Duplicate declaration: Class[Logrotate::Config]

I also have this in a module
  class {'logrotate::config':
conf_file = 'puppet',
  }

I thought the title of the file resource is different and it should work.
As far as I know this problem can be solved by define or virtual 
resource, but I have no idea what is a good solution.
Can you please help me?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c694b900-60f9-4c7c-bccd-b9c7adf6d689%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: file resource to provide serveral files

2014-01-24 Thread Andreas Dvorak
Hi,

I am trying this. config.pp of module logrotate
define logrotate::config{
  case $::osfamily {
redhat:{
  file { /etc/logrotate.d/${conf_file}:
ensure = 'present',
owner  = 'root',
group  = 'root',
mode   = '0644',
source = puppet://${puppetmaster}/modules/logrotate/${conf_file},
  }
}
solaris:{
  notice('logrotate not available')
}
default:{
  fail(Unsupported platform: ${::osfamily})
}
  }
}

in the nodes.pp
  logrotate::config{'test':}
  logrotate::config{'puppet':}

And it says
Duplicate declaration: File[/etc/logrotate.d/] is already declared in file 
/data/git/test/modules/logrotate/manifests/config.pp:10
It also does not work if I just have on file to provide. The it does 
nothing.

Can you please help me?
Andreas


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7576638c-5157-4df3-a5a4-69c481e644ca%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] custom fact should not run on Solaris

2013-12-19 Thread Andreas Dvorak
Dear all

thank you for helping me.
My solution is this:
require 'facter'
Facter.add(:spacewalk) do
  confine :osfamily = RedHat
f = File.new(/etc/sysconfig/rhn/up2date)
text = f.read
if text =~ /sv2653/ then
  setcode do true end
else
  setcode do false end
end
end

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9f5a8416-960f-470d-84b8-1903c0315f00%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] custom fact should not run on Solaris

2013-12-18 Thread Andreas Dvorak
Dear all

I have a module spacewalk with a custom fact to define if the server has 
been registered to spacewalk.
The module should only run on RedHat server

class profiles::base {
...
  case $::osfamily {
redhat:{
  include spacewalk
  include logrotate
  include postfix
}
solaris:{
  include sendmail
}
default:{
  fail(Unsupported platform: ${::osfamily})
}
  }
}

but the fact of the module spacewalk is run on Solaris.
bash-3.00# /opt/csw/bin/facter osfamily
Solaris
bash-3.00# /opt/csw/bin/puppet agent --test
Info: Retrieving plugin
Notice: /File[/var/opt/csw/puppet/lib/facter/spacewalk.rb]/ensure: defined 
content as '{md5}9aea0fbd79bc329b3685b7cfd22a5809'

I have another custom fact that should only run on certain server but it is 
installed on every server.
Can you please help me?
Are facts always installed on every server even if the module of the fact 
in only installed on certain server?

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/95b66593-0ff9-4ffe-b54c-963bb84f7010%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet agent on Solaris no logging

2013-12-18 Thread Andreas Dvorak
Dear all,

I have RedHat Server with Puppet and logging in /var/log/puppet
But on Solaris it does not work.
I am using the CSWpuppet3 3.3.1

Do you have an idea?

cat /etc/puppet/puppet.conf
# puppet.conf

[main]
logdir = /var/log/puppet
confdir = /etc/opt/csw/puppet
config = $confdir/puppet.conf
vardir = /var/opt/csw/puppet
ssldir = $vardir/ssl
server = rh6-puppet-master.baag
pluginsync = true

[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d8ba5045-49f8-4eb2-b71c-376f13069717%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] puppet parser validate fails

2013-12-11 Thread Andreas Dvorak
Hi Jeff,

thank you for the information.

I think the grep -v '^\s*import' is working. First test are successfully.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ff6db2df-b995-405b-a9a7-dbea1758e95e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] puppet parser validate fails

2013-12-10 Thread Andreas Dvorak
Dear all,

In git I have a pre-receive script to checkt the puppet files. My git push 
comes with an error but if I run the same manually I get no error.
Can anybody please help me?

error message
remote:  Checking manifests/nodes.pp for syntax errors and styleguide 
compliance... 
remote: 'puppet parser validate' failed on manifests/nodes.pp - push 
deniend. Run tests locally and confirm they pass before pushing. 
remote: Error: Could not parse for environment production: No file(s) found 
for import of 'fix.pp' at /tmp/tmp.hujjYZKPpC/manifests/nodes.pp:9
remote: Error: Try 'puppet help parser validate' for usage

pre-receive script
for puppetmodule in `git diff-tree --no-commit-id --name-only -r $newrev`; 
do
echo -e \e[0;36m Checking $puppetmodule for syntax errors and 
styleguide compliance... \e[0m
tmpdir=`mktemp -d`
tmpmodule=$tmpdir/$puppetmodule
tmperror=$tmpdir/errors.txt
mkdir -p $tmpmodule
rmdir $tmpmodule
git show $newrev:$puppetmodule  $tmpmodule
case $puppetmodule in
*.pp )
puppet parser validate $tmpmodule 2 $tmperror
rc=$?
if [[ $rc != 0 ]]; then
echo -e \e[0;31m'puppet parser 
validate' failed on $puppetmodule - push deniend. Run tests locally and 
confirm they pass before pushing. \e[0m
cat $tmperror
rm -rf $tmpdir
exit $rc
fi
 .

this works without error in my local git and on the central git
puppet parser validate nodes.pp

cat nodes.pp 
node base {
  include profiles::base
}

node 'sv2629.muc.baag' inherits base {
}

import 'fix.pp'
import 'puppet_master.pp'
#import 'sunray.pp'

And it does not matter what I change in the file.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e2d78e37-0746-4fed-b590-fd9246d4d605%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet agent does not start in Solaris zone

2013-12-02 Thread Andreas Dvorak
Dear all,

I found the problem.
The package needs to be installed in the global zone. It does not work if 
you install it only in the local zone.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b8931f77-4e03-45d8-8b5b-6f3dfef1df40%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet agent messages with rsyslog

2013-11-27 Thread Andreas Dvorak
Hi,

I solved it with this:
if $programname == 'puppet-agent' and $syslogseverity = '6' then 
/var/log/puppet/agent.log
if $programname == 'puppet-agent' and $syslogseverity  '3' then ~

Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0542244c-633b-4ad5-a7e9-40bdf2298d9d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet agent messages with rsyslog

2013-11-26 Thread Andreas Dvorak
Dear all,

I have Puppet 3.3.1 and rsyslog and RedHat 6.
My problem is that I want to see the message Finished catalog only in the 
file /var/log/puppet/agent.log, but rsyslog sends it to the syslog server 
and than to netcool. It is also shown in /var/log/messages.
I only want to see error message like

Nov 26 13:20:36 vm7239 puppet-agent[19732]: Could not retrieve catalog from 
remote server: Error 400 on SERVER: Could not find class syslog::conf for 
vm7239.muc.baag on node vm7239.muc.baag
Nov 26 13:20:36 vm7239 puppet-agent[19732]: Not using cache on failed 
catalog
Nov 26 13:20:36 vm7239 puppet-agent[19732]: Could not retrieve catalog; 
skipping run

I have created a rsyslog file in rsyslog.d/

if $programname == 'puppet-agent' and $syslogseverity = '6' then 
/var/log/puppet/agent.log
if $programname == 'puppet-agent' and $syslogseverity = '6' then ~

I think the severity of Finished catalog should be low.

Can somebody please help me?

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/aefe6f79-e9bc-4bef-8bf6-68620cfdf657%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet agent messages with rsyslog

2013-11-26 Thread Andreas Dvorak
Hi,

that info was nice to find out what syslogseverity the message Finished 
catalog. It is 5.
But I still do not understand why this message is send to the syslog server.
According to the line
if $programname == 'puppet-agent' and $syslogseverity = '6' then 
/var/log/puppet/agent.log
it should only be writen in the agent.log file.

Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/95b11a2e-cd4b-490e-991f-292bda83e5f5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet agent does not start in Solaris zone

2013-11-18 Thread Andreas Dvorak
Hi Rich,

the package installs CSWruby18 VERSION:  1.8.7p334,REV=2011.03.24 and that 
is supported.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ebcd980b-a6d0-4988-96e9-c04282931e6a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet agent does not start in Solaris zone

2013-11-15 Thread Andreas Dvorak
Hi Rich,

I tried
/opt/csw/bin/puppet agent --test
bash: /opt/csw/bin/puppet: /opt/csw/bin/ruby18: bad interpreter: Invalid 
argument

But unfortunately that does not help me. Have you got any idea?

Regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7e075d33-8137-4986-86d1-bd117b04ee0c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet agent does not start in Solaris zone

2013-11-13 Thread Andreas Dvorak
Dear all

the puppet agent does not want to start on my first Solaris zone. I have 
already Puppet on x86 server running.
Can anybody please help me?

I have created a package for Solaris 10 Sparc to use the puppet agent on a 
Solaris zone.

/opt/csw/bin/pkgutil -a puppet
common   package  catalog
size
puppet   CSWpuppet2.7.23,REV=2013.08.15  728.3 
KB
puppet3  CSWpuppet3   3.3.1,REV=2013.10.22   980.4 
KB
puppetmaster CSWpuppetmaster  2.7.23,REV=2013.08.153.4 
KB
puppetmaster3CSWpuppetmaster3 3.3.1,REV=2013.10.22 2.2 
KB

from http://mirror.opencsw.org/opencsw/unstable

Command to create the package:
/opt/csw/bin/pkgutil --stream --target=sparc:5.10 --output 
CSWpuppet3_agent_sparc_3.3.1.pkg --yes --download CSWpuppet3

But the service cswpuppetd does not want to start:
[ Nov 13 17:28:24 Leaving maintenance because disable requested. ]
[ Nov 13 17:28:24 Disabled. ]
[ Nov 13 17:29:04 Disabled. ]
[ Nov 13 17:29:04 Rereading configuration. ]
[ Nov 13 17:29:04 Enabled. ]
[ Nov 13 17:29:04 Executing start method 
(/var/opt/csw/svc/method/svc-cswpuppetd start) ]
/var/opt/csw/svc/method/svc-cswpuppetd: /opt/csw/bin/puppet: cannot execute
Starting Puppet client services:/var/opt/csw/svc/method/svc-cswpuppetd: 
/opt/csw/bin/puppet: cannot execute
 puppetd
[ Nov 13 17:29:04 Method start exited with status 0 ]
[ Nov 13 17:29:05 Stopping because all processes in service exited. ]
[ Nov 13 17:29:05 Executing stop method 
(/var/opt/csw/svc/method/svc-cswpuppetd stop) ]
/var/opt/csw/svc/method/svc-cswpuppetd: /opt/csw/bin/puppet: cannot execute
Stopping Puppet client services:/var/opt/csw/svc/method/svc-cswpuppetd: 
test: argument expected
[ Nov 13 17:29:05 Method stop exited with status 1 ]

The zone has
cat /etc/release
   Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights 
reserved.
Assembled 17 January 2013



-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/263d54f6-39af-40bd-945b-09196908618e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Puppet agent does not start in Solaris zone

2013-11-13 Thread Andreas Dvorak
Now I have tried the version puppet3  CSWpuppet3   
3.1.1,REV=2013.03.15   780.4 KB from testing branch.
but it has the same problem.

Regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/07376cf9-f161-463a-98ac-a08b2934cab6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Resource file copy files recurse in existing directory with existing files

2013-10-22 Thread Andreas Dvorak
Dear all,

now I have got the solution

   file { /usr/local/nagios/libexec:
  ensure = present,
  owner = nagios,
  group = nagios,
  mode = 755,
  sourceselect = all,
  source = 
[puppet:///extra_files/basisapplikationen/monitoring/nagios/client/custom-plugins,${source}/libexec],
  recurse = true,
  require = File ['/usr/local/nagios'],
  schedule = nagios_client-schedule,
   }

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Resource file copy files recurse in existing directory with existing files

2013-10-21 Thread Andreas Dvorak
Hi,

I have a file resource that brings files in the diretory 
/usr/local/nagios/libexec from source1 and I have a second resource file 
that should bring file in that same directory but from an other source.
But the result is that only the files from   file { 
/usr/local/nagios/libexec: do exit in the directory. I tried remote and 
true. The resource file { /usr/local/nagios/libexec: deletes all the 
files in the directory  /usr/local/nagios/libexec that came with file { 
/usr/local/nagios:
Can somebody please help me?

   file { /usr/local/nagios:
  ensure = directory,
  owner = nagios,
  group = nagios,
  mode = 755,
  source = $source,
  recurse = true,
  require = User ['nagios'],
  schedule = nagios_client-schedule,
   }

   file { /usr/local/nagios/libexec:
  ensure = directory,
  owner = nagios,
  group = nagios,
  mode = 755,
  source = 
puppet:///extra_files/basisapplikationen/monitoring/nagios/client/custom-plugins,
  recurse = remote,
  require = File ['/usr/local/nagios'],
  schedule = nagios_client-schedule,
   }

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Resource file copy files recurse in existing directory with existing files

2013-10-21 Thread Andreas Dvorak
Hi John,

I add purge = false in the file /usr/local/nagios/libexec but it did not 
change anythink.

I need to find out if I can put the files in an other directory.

Thank you
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: user management define once an add if required on server

2013-10-10 Thread Andreas Dvorak
Great, thank you the good example.
Now I am happy

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] user management define once an add if required on server

2013-10-08 Thread Andreas Dvorak
Dear all

I am looking for a solution for a module to define alle possible user and 
then install the one or more user from that module if needed on a server, 
but not all of them.
My idea is something like this. Can I define a user in the nodes.pp at a 
special Server to install that user?

init.pp
class admin_user::group {
   group { group1:
  gid = 888,
  ensure = present,
   }
}

class admin_user {
   include admin_user::group, admin_user::list
}

list.pp with many user like this

class admin_user::list {
   admin_user::useradd { test1:
  comment = test1,
  uid = 1032,
  gid = 888,
  shell = /bin/bash,
  password = '$6$QMhC7iyQ$CeUQnyZRaqzUp1/jkH61SaE7gz/',
  sshkeytype = rsa,
  sshkey = 
B3NzaC1yc2EBIwAAA4gZcD7cxU7Yu2Gs4iL5bycu1nSb0/U4rGLe5OipRtqkwkfk93KX/i6N8=,
   }

   admin_user::useradd { test2:
  comment = test2,
  uid = 2012,
  gid = 888,
  shell = /bin/bash,
  password = '$6$0vY.Ob.b$uF0JMxjptxEq9gj72KrU7CqB7ez0gCt6fAB1',
  sshkeytype = rsa,
  sshkey = 
B3NzaC1yc2EAA/QtjZcPsaAhdZMsNU9xJ0Hb1VX3+vaAX1pA4F1Lq87ZBrZxrTS2F0G7hHJDffhqwlYoWfl1755hWeNeNZWQBcF
   }
}

and useradd.pp
define admin_user::useradd ( $comment, $uid, $group, $gid, $password, 
$shell, $sshkeytype, $sshkey) {
   include admin_user::group
   $username = $title

   user { $username:
  ensure = present,
  comment = $comment,
  uid = $uid,
  gid = $gid,
  shell = $shell,
  home = /home/$username,
  managehome = true,
  forcelocal = true,
  password = $password,
  require = Group[baaderadm],
   }

   ssh_authorized_key { $username:
  user = $username,
  type = $sshkeytype,
  key = $sshkey,
  require = User[$username],
   }
}

nodes.pp

node 'vm6742.muc.baag' inherits base {
   $user = test1
   include jre17_32bit
}

Maybe I need to split the list.pp in separate files for every user, but I 
do not know how to request a specific user.
Maybe something like that: include addmin_user::test1

I could create a modul for every user and add it to a server, but I think 
that is not a good solution.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] user management define once an add if required on server

2013-10-08 Thread Andreas Dvorak
Hi Johan,

thank you for the hint with virtual resources.
Here is my solution

cat init.pp 
class accounts {
   @accounts::virtual {'test1': 
  comment = test1,
  uid = 1056,
  gid = 880,
  group = baader,
  shell = /bin/bash,
  password = '$1$6hsRON8i7w5JncJDROnjh51',
  sshkeytype = rsa,
  sshkey = ,
   }

   @accounts::virtual {'test2':
  comment = test2,
  uid = 1058,
  gid = 880,
  group = baader,
  shell = /bin/bash,
  password = '$1$RuV4YCYT$KXDWuNtU9B1',
  sshkeytype = rsa,
  sshkey = ,
   }
}

cat virtual.pp 
define accounts::virtual ( $comment, $uid, $group, $gid, $password, $shell, 
$sshkeytype, $sshkey) {
   $username = $title

   group { $group:
  gid = $gid,
  ensure = present,
   }

   user { $username:
  ensure = present,
  comment = $comment,
  uid = $uid,
  gid = $gid,
  shell = $shell,
  home = /home/$username,
  managehome = true,
  forcelocal = true,
  password = $password,
  require = Group[$group],
   }

   ssh_authorized_key { $username:
  user = $username,
  type = $sshkeytype,
  key = $sshkey,
  require = User[$username],
   }
}

node 'vm6741.muc.baag' inherits base {
   include accounts
   realize (Accounts::Virtual['test2'])
}

Best regards
Andreas


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: user management define once an add if required on server

2013-10-08 Thread Andreas Dvorak
Hi,

there is a problem

If I want to add a second user with the same group to the same server I get 
this error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate declaration: Group[baader] is already declared in file 
/etc/puppet/git/modules/accounts/manifests/virtual.pp at line 7; cannot 
redeclare on node vm6741.muc.baag
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

How can I solve this?

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Solaris useradd uses /export/home and not /home

2013-09-16 Thread Andreas Dvorak
Many thanks John. Now it is solved.

Here is the solution.

init.pp
class admin_user::group {
   group { baaderadm:
  gid = 888,
  ensure = present,
   }
}

class admin_user {
   include admin_user::group, admin_user::list
}

list.pp
class admin_user::list {
   admin_user::useradd { user1:
  comment = user1,
  uid = 1032,
  gid = 888,
  group = baaderadm,
  shell = /bin/bash,
  password = '$6$QMhC7iyQ$CeUQnyZR1/jkH61SaE7gz/',
  sshkeytype = rsa,
  sshkey = 
B3NzaC1yc2EBIwAAAIEAs+EjM0/U4rGLe5OipRtqkwkfk93KX/i6N8=,
   }
 admin_user::useradd { user2:
  comment = user2,
  uid = 1033,
  gid = 888,
  group = baaderadm,
  shell = /bin/bash,
  password = '$6$QMhC7iyQ$CeUQnyZR1/jkH61SaE7gz/',
  sshkeytype = rsa,
  sshkey = 
B3NzaC1yc2EBIwAAAIEAs+EjM0/U4rGLe5OipRtqkwkfk93KX/i6N8=,
   }
}

useradd.pp
define admin_user::useradd ( $comment, $uid, $group, $gid, $password, 
$shell, $sshkeytype, $sshkey) {
   include admin_user::group
   $username = $title

   user { $username:
  ensure = present,
  comment = $comment,
  uid = $uid,
  gid = $gid,
  shell = $shell,
  home = /home/$username,
  managehome = true,
  forcelocal = true,
  password = $password,
  require = Group[baaderadm],
   }

   ssh_authorized_key { $username:
  user = $username,
  type = $sshkeytype,
  key = $sshkey,
  require = User[$username],
   }
}


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Solaris useradd uses /export/home and not /home

2013-09-13 Thread Andreas Dvorak
Hi John,

I can see that it does use the provider user_role_add, but there seems to 
be a problem.

Debug: /User[user1]: Provider user_role_add does not support features 
libuser; not managing attribute forcelocal

I get the same message when I run it on RedHat 6.

In the catalog file I find this
{exported:false,line:18,title:user1,parameters:{uid:2012,password:$6$0vY.Ob.b$uOClxMYJohHBH46X/ESzliv.Jxt1XoWXjbLXtnf5JzqL5pP.caiF0JMxjptxEq9gj72KrU7CqB7ez0gCt6fAB1,shell:/bin/bash,gid:888,home:
*/export/home/user1*
,managehome:true,comment:user1,ensure:present},tags:[user,user1,useradd,class,admin_user::list,admin_user,list,node,base],type:User

It is already wrong in the catalog file.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Solaris useradd uses /export/home and not /home

2013-09-13 Thread Andreas Dvorak
I forgot: Yes the init.pp file is the one I use.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: run module although with time condition, but also possibilty execute even so not in that time frame

2013-09-13 Thread Andreas Dvorak
Hi,

now I have used the schedule successfully.
But I don't understand the method to override the schedule completely. Is 
it true that I have to change vom node.pp file from 
node 'vm6741.muc.baag' inherits base {
   $motd_function = Puppet Agent
   $motd_environment = Test
   $motd_description = RedHat 5 Test
   include motd
   *include copy_file*
}

to 
node 'vm6741.muc.baag' inherits base {
   $motd_function = Puppet Agent
   $motd_environment = Test
   $motd_description = RedHat 5 Test
   include motd
   *include copy_file::now*
}

That would not be nice because I need to change a file.

There is no option to run the puppet agent like this:
puppet agent --class copy_file::now
or
puppet agent --ignore_schedule

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Solaris useradd uses /export/home and not /home

2013-09-13 Thread Andreas Dvorak
Hi John,

the catalog file in RH6 is fine with home:/home/user1 and the user is 
created in /home/user1

That problem seems to be complicate.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: run module although with time condition, but also possibilty execute even so not in that time frame

2013-09-13 Thread Andreas Dvorak
Great John,

the command
puppet agent --ignoreschedules --tags copy_file
is working and exactly what I need.

Thank you very much.

Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Solaris useradd uses /export/home and not /home

2013-09-06 Thread Andreas Dvorak
Dear all

I have puppet 3.2 running and have a module to install user. On Linx user 
are created in /home but on Solaris it wants to create them in 
/export/home. I don't understand why.

class admin_user::group {
   group { baaderadm:
  gid = 888,
  ensure = present,
   }
}

class admin_user::add {
   define useradd ( $name, $uid, $group, $gid, $password, $shell, 
$sshkeytype, $sshkey) {
  $homedir = /home
  $username = $title

  user { $username:
 ensure = present,
 comment = $name,
 uid = $uid,
 gid = $gid,
 shell = $shell,
 home = /home/$username,
 managehome = true,
 password = $password,
 require = Group[baaderadm],
  }

  ssh_authorized_key { $username:
 user = $username,
 type = $sshkeytype,
 key = $sshkey,
 require = user[$username],
  }
   }
}

class admin_user {
   include admin_user::group, admin_user::list, admin_user::add
}

The error message:
Error: Could not create user user1: Execution of '/usr/sbin/useradd -u 1059 
-s /bin/bash -g 888 -d /export/home/user1 -c user1 -m user1' returned 12: 
UX: /usr/sbin/useradd: ERROR: Unable to create the home directory: No such 
file or directory.

Error: /User[user1]/ensure: change from absent to present failed: Could not 
create user user1: Execution of '/usr/sbin/useradd -u 1059 -s /bin/bash -g 
888 -d /export/home/user1 -c user1 -m user1' returned 12: UX: 
/usr/sbin/useradd: ERROR: Unable to create the home directory: No such file 
or directory.

If i execute:
/usr/sbin/useradd -u 1059 -s /bin/bash -g 888 -d /home/user1 -c user1 -m 
user1
it does work.

Does somebody have an idea?

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Solaris useradd uses /export/home and not /home

2013-09-06 Thread Andreas Dvorak
Hi Dick,

thank you for the help, but it did not change anythink. The error mesage 
stays exactly the same.

Puppet ignores the setting of the home variable.

Now I have created the missing home directory in /export and the user is 
created, but in the wrong directory.

Best regards
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: run module although with time condition, but also possibilty execute even so not in that time frame

2013-09-05 Thread Andreas Dvorak
Hi John,

many thanks for this full description.
After my holiday next week I will try to set this up.

Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] run module although with time condition, but also possibilty execute even so not in that time frame

2013-09-04 Thread Andreas Dvorak
Hi,
 
I need an idea to write modules that have a time condition, so software 
should only be installed between 1 and 2 o'clock.
But in special situations I need to run the software installation right now 
and can not wait for the time frame.
 
Here is my idea for the time frame condition. Is that a good method?
if $timestamp  01:00:00  $timestamp  02:00:00 {
   # exec resource
}
 
In cfengine I can define time conditions with (run in hour 1
Hr01::
 # exec resource
I did not find anything like this in puppet.
 
And then I could do in cfengine (run in hour 1 or if agent is call with the 
condition go
 Hr01|go::
 # exec resource
Is there something like this in puppet?
 
Best regards,
Andreas

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


  1   2   >