FAQ
I would like to use condition in a template with puppet 3.x.

In my params.pp :

$domain=test.org

$use_app = True

In my manifest :

class myapp::config {
    require params

     file { "/opt/myapp/config/app.conf":
         mode => '0644',
         content => template("myapp/app.conf.erb"),
     }
}

In my template file :

<% if $use_app = "False" %>
--domain=<%= scope['myapp::params::domain'] %>
<% end %>

The condition desn't work. My config file app.conf always have the line
--domain inserted when I run puppet.

Any ideas ?

Thanks

--
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

  • Johan De Wit at Jun 4, 2013 at 11:59 am
    <% if $use_app == "False" %>

    Be aware of the double equal signs



    On 06/04/2013 12:58 PM, AVE1810 wrote:
    I would like to use condition in a template with puppet 3.x.

    In my params.pp :

    $domain=test.org

    $use_app = True

    In my manifest :

    class myapp::config {
    require params

    file { "/opt/myapp/config/app.conf":
    mode => '0644',
    content => template("myapp/app.conf.erb"),
    }
    }

    In my template file :

    <% if $use_app = "False" %>
    --domain=<%= scope['myapp::params::domain'] %>
    <% end %>

    The condition desn't work. My config file app.conf always have the
    line --domain inserted when I run puppet.

    Any ideas ?

    Thanks
    --
    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.

    --
    Johan De Wit

    Open Source Consultant

    Red Hat Certified Engineer (805008667232363)
    Puppet Certified Professional 2013 (PCP0000006)
    _________________________________________________________

    Open-Future Phone +32 (0)2/255 70 70
    Zavelstraat 72 Fax +32 (0)2/255 70 71
    3071 KORTENBERG Mobile +32 (0)474/42 40 73
    BELGIUM http://www.open-future.be
    _________________________________________________________


    --
    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.
  • AVE1810 at Jun 4, 2013 at 12:24 pm
    It works now. Thank you for the answer !

    Le mardi 4 juin 2013 13:59:57 UTC+2, Johan De Wit a écrit :
    <% if $use_app == "False" %>

    Be aware of the double equal signs




    On 06/04/2013 12:58 PM, AVE1810 wrote:

    I would like to use condition in a template with puppet 3.x.

    In my params.pp :

    $domain=test.org

    $use_app = True

    In my manifest :

    class myapp::config {
    require params

    file { "/opt/myapp/config/app.conf":
    mode => '0644',
    content => template("myapp/app.conf.erb"),
    }
    }

    In my template file :

    <% if $use_app = "False" %>
    --domain=<%= scope['myapp::params::domain'] %>
    <% end %>

    The condition desn't work. My config file app.conf always have the line
    --domain inserted when I run puppet.

    Any ideas ?

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





    --
    Johan De Wit

    Open Source Consultant

    Red Hat Certified Engineer (805008667232363)
    Puppet Certified Professional 2013 (PCP0000006)
    _________________________________________________________

    Open-Future Phone +32 (0)2/255 70 70
    Zavelstraat 72 Fax +32 (0)2/255 70 71
    3071 KORTENBERG Mobile +32 (0)474/42 40 73
    BELGIUM http://www.open-future.be
    _________________________________________________________

    --
    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
postedJun 4, '13 at 11:46a
activeJun 4, '13 at 12:24p
posts3
users2
websitepuppetlabs.com

2 users in discussion

AVE1810: 2 posts Johan De Wit: 1 post

People

Translate

site design / logo © 2022 Grokbase