Displaying 20 results from an estimated 70000 matches similar to: "Condition based on environment"
2011 Nov 18
2
Are tildes actually valid in templates or is this a bug?
Hi all,
First off, we''re running Puppet 2.7.6 with Ruby 1.8.7 on CentOS 6.0.
Now, I''m using tildes in a template to prevent newlines from appearing but
ruby/puppet is choking on them.
*/tmp/puppet$ cat test.erb*
Line 1: Line 2 will exist if running on CentOS.
<% if operatingsystem == "CentOS" ~%>
Line 2: Yay, we''re running CentOS.
<% end ~%>
2010 Sep 13
2
Puppet trying to start service before package is installed
Hi,
This one is driving me crazy. Problem is Puppet try to start some
services (in this case zabbix-agent) before it is installed.
My puppet-master is Debian 5.05 with Puppet 2.6.0 (from squeeze).
Target system is FreeBSD 8.1 with Puppet 2.6.1 (from packages-8-
stable).
When I run puppet manually in debug-mode I get:
MASTER:
debug: Adding relationship from Package[zabbix-agent] to File[zabbix-
2011 Oct 18
2
Puppet node fails to pass facts to master
Hello Puppet list,
I am taking over the puppet configuration of a sysadmin who left, and
am having troubles deploying puppet to a new node. We are using puppet
v2.7.3 both on the client and the puppetmaster, on Ubuntu 10.10.
The node asks for a certificate fine, and I signed it on the
puppetmaster.
For the following logs extract I ve replaced the FQDN of my node by
puppet.example.com.
When doing
2011 Nov 29
2
template does not print variables
Hello list,
 I am having a  problem with template file. Why are variables not interpolated?
[root@puppet manifests]# cat /etc/motd
memory free = <%= memoryfree %>
domain = <%= domain %>
operating system = <%= operatingsystem %>
 This is the template file
[root@puppet manifests]# cat ../templates/motd.erb
memory free = <%= memoryfree %>
domain = <% domain %>
2010 Jun 17
5
Could not find class, code-blind
I''m troubled with a node-definition not able to resolve a class:
 Could not find class rhnsd::common at /etc/puppet/manifests/nodes.pp:
8 on node X
Content of manifest/site.pp:
import "nodes.pp"
[...]
The layout of modules/rhnsd/ is:
|-- files
|   `-- up2date-rhn
|-- manifests
|   |-- client.pp
|   |-- common.pp
|   |-- init.pp
|   `-- rhn.pp
A `cat'' from each
2012 Jun 18
8
Conditional with variable from facter
Hi.
I have the following facts available:
# facter | grep oper
operatingsystem => CentOS
operatingsystemrelease => 6.2
Now, if I wish to use conditionals on these facts, I have to do it like
this:
case $operatingsystem {}
case $::operatingsystemrelease {}
I''m puzzled as to why can''t I just use $operatingsystemrelease, and what
do these two semicolons mean?
Thank
2012 Aug 27
1
Fact based variables sowing up empty
I''ve got a single puppet master (2.7.19 + facter 1.6.11) controlling a 
number of nodes (2.7.17 + facter 1.6.8-10). On all of thse, fact absed 
variables work as expected (such as $::operatingsystem and $::fqdn).
However, on my puppet master, when I run ''puppet agent --test'' all fact 
based variables are combing back as empty strings.
For example. I have a line in a
2012 Mar 28
4
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Hello,
I''m having some trouble.  I keep getting the following warnings when
trying to run:
$ puppet master --no-daemonize
/usr/local/build/puppet-bundle/vendor/gems/ruby/1.9.1/gems/
puppet-2.7.12/lib/puppet/external/pson/pure.rb:7:in `<module:PSON>'':
iconv will be deprecated in the future, use String#encode instead.
Could not load confine test
2012 Jun 15
3
Unsupported osfamily: Linux operatingsystem: Amazon
Hi all,
just installed the puppetlabs-mysql module for puppet on my Puppet server 
which is an Amazon Linux (based on RedHat), but I get this error when I run 
puppet agent --test :
*err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Unsupported osfamily: Linux operatingsystem: Amazon, module mysql only 
support osfamily RedHat and Debian at 
2012 Apr 06
2
define function problem
Hi All,
Hope you people are doing good.
I have a manifest file :
lass profile {
# setup profile parms. We dont handle non Ubuntu OS yet
    if ("$operatingsystem" == "Ubuntu") {
        file {
            "/etc/profile.d":
                ensure  => directory,
                purge   => true,
                force   => true,
                recurse =>
2012 Aug 06
4
Could not evaluate: Could not retrieve information from environment production source(s) for one module, for other is ok
Hi,
I have been fighting this issue without success for several days. I am
sure some of you have dealt with something similar:
I have 2 manifest one for vim which works like a charm :
class vim {
        if $operatingsystem == "Debian" {
                package {"vim":
                        ensure => present,
                }
                package
2013 Oct 24
2
SSH Module with multiple conditions
I''ve written and deployed a simple Linux SSH module.  But I need to modify 
to include support for FreeBSD and AIX.  On top of that, I need to include 
some conditionals in there that (for example)
if (/etc/file1 contains string abc) ; then
  install sshd-config-x & ssh-config-x
elsif (/etc/file1 contains string xyz); then 
  install sshd_config-y & ssh_config-y
else install
2013 Feb 21
8
Facter & Puppet disagree on RHEL 6?
I''ve run into an odd one on one of my new RHEL 6 boxes.  Puppet and Facter
seem to disagree about the value of a fact.
Puppet version: 2.7.9
Facter version: 1.6.4
Module: puppetlabs-apache
apache::params falls through its if structure:
 if $::osfamily == ''redhat'' or $::operatingsystem == ''amazon'' {
...
 } elsif $::osfamily ==
2013 Jun 18
1
undefined method `[]' for nil:NilClass
I upgrade our infrastructure (mostly RHEL5, some RHEL6) from 3.1 to
puppet-3.2.1-1.el5.  Ruby sits at ruby-1.8.7.370-1.el5.  I ran some
tests and everything seemed good so I pushed it out.
Since then, all my puppet clients are failing with this:
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: undefined method `[]'' for nil:NilClass at
2011 Apr 07
4
$environment in File source not working
am I doing something wrong?
this seems to never find my .$env file:
source => [
            "puppet:///modules/gu_puppet/puppet.conf.$fqdn",
            "puppet:///modules/gu_puppet/puppet.conf.$environment",
            "puppet:///modules/gu_puppet/puppet.conf.$operatingsystem",
            "puppet:///modules/gu_puppet/puppet.conf"
            ]
It
2013 Sep 18
4
Not able to capture node info via browser
If I run below command on puppet master. I am able to get output pasted 
here.
But the same information, I am trying to capture via browser using 
http://puppetdb:8080/v2/facts/operatingsystem    but not working
 
 
 
[root@puppetmaster ~]curl -X GET 
http://puppetdb:8080/v2/facts/operatingsystem
curl: (6) Couldn''t resolve host ''puppetdb''
[root@puppetmaster ~]# curl -X
2012 Jul 17
8
How to override $::operatingsystem fact
Hi,
I want to introduce "Proxmox" as new value in $::operatingsystem.
"Proxmox" is based on Debian, so the normal value is currently "Debian".
To change that, I just write a custom fact based on the facter fact 
"operatingsystem"
Facter.add(:operatingsystem) do
>  ...
>    setcode do
>    ...
>    elsif
2008 Dec 24
3
Conditionals allowed within types?
Hello,
I''m trying to do this:
   service { monit:
      ensure => running,
      enable => true,
      hasrestart => true,
      if ($operatingsystem == ''centos'') {
         hasstatus => true,
      },
      require => Package[''monit''],
      subscribe => File[''monit.conf''],
   }
And it doesn''t work in
2008 May 13
6
variable name containing variable name
Hello, i''m new to puppet (and ruby).
I have a problem when using a variable name containing a variable name
and containing a reserved variable name :
I have a class :
class kernel-Linux-binary {
	$test = $operatingsystem ? {
                Fedora => "/usr/bin/test",
                default => undef
        }
}
and i want to call "test" and replace Linux by
2013 Mar 01
2
Puppet newbie
Hi 
I am new in Puppet and i have one error when i test Postgresql module in 
infrastructure mode.
I''m using Puppet 3.1.0 in Debian squeeze or 6.0.7
i tape the next command puppetd -t -v  and this is the error
info: Retrieving plugin
info: Loading facts in pe_version
info: Loading facts in postgres_default_version
info: Loading facts in iptables
info: Loading facts in puppet_vardir