FAQ
Hello

Can someone please help or explain why this isn't working

as read http://docs.puppetlabs.com/guides/language_guide.html

It keeps adding the file NOT_present.txt

i've played around with == and != and True / false etc, and its not giving
me the correct outcome telling if folder exists or not


$confdir = 'C:/windows'

if $confdir == 'True' {

file { 'C:/folder_present.txt': ensure => present }
} else {
file { 'C:/NOT_present.txt': ensure => present }
}


regards

james

--
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+unsubscribe@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Gary Larizza at Feb 9, 2013 at 1:38 am
    The reason this is happening is because you're not testing the presence of
    that folder, you're actually testing whether the variable $confdir == the
    string of 'True', which it does not (it holds the value of the string
    "C:/windows")

    What ultimately are you looking to do here? Puppet is a declarative
    language that works by specifying the end-state of your node. If you want
    C:\Windows to exist, and C:\folder_present.txt to exist, then you have to
    declare them and let Puppet ensure their presence.

    On Fri, Feb 8, 2013 at 8:22 AM, jim wrote:

    Hello

    Can someone please help or explain why this isn't working

    as read http://docs.puppetlabs.com/guides/language_guide.html

    It keeps adding the file NOT_present.txt

    i've played around with == and != and True / false etc, and its not giving
    me the correct outcome telling if folder exists or not


    $confdir = 'C:/windows'

    if $confdir == 'True' {

    file { 'C:/folder_present.txt': ensure => present }
    } else {
    file { 'C:/NOT_present.txt': ensure => present }
    }


    regards

    james

    --
    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+unsubscribe@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?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Gary Larizza
    Professional Services Engineer

    --
    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+unsubscribe@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?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 8, '13 at 8:12p
activeFeb 9, '13 at 1:38a
posts2
users2
websitepuppetlabs.com

2 users in discussion

Gary Larizza: 1 post Jim: 1 post

People

Translate

site design / logo © 2022 Grokbase