FAQ
A friend of mine ask me this question and I stated puppet was only good for sending commands and not interacting with the command line. I told him to look for answer file support or a quite mode.
However, I suppose he could also run a expect script that could answer the installer questions but this would be kinda complex for a beginner and not the right approach in my opinion.

Is there a puppet resource or function that could automate this solution? Does puppet provide any expect like behavior?

Question:

I want to run and installer through an exec resource in Puppet. The problem is that the installer prompts you for a yes or no to choose the default path:

Default directory for installation of products - /opt/ibm/db2/V10.1

***********************************************************
Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no]

If I run this command through puppet, puppet never sends a yes and the prompt ends up in a loop and never runs the installer. You know how to make the exec resource send "yes" to the command line?


Thanks,

Corey Osman
corey@logicminds.biz

Green IT and Data Center Automation Specialist






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

  • Trevor Vaughan at Feb 27, 2013 at 7:58 pm
    file { '/tmp/something/relevant': content => "yes\n" }

    exec { 'my_command << /tmp/something/relevant': require =>
    File['/tmp/something/relevant'] }

    This *should* work, but I haven't tested it.

    Trevor
    On Wed, Feb 27, 2013 at 2:23 PM, Corey Osman wrote:

    A friend of mine ask me this question and I stated puppet was only good
    for sending commands and not interacting with the command line. I told him
    to look for answer file support or a quite mode.
    However, I suppose he could also run a expect script that could answer the
    installer questions but this would be kinda complex for a beginner and not
    the right approach in my opinion.

    Is there a puppet resource or function that could automate this solution?
    Does puppet provide any expect like behavior?

    Question:

    I want to run and installer through an exec resource in Puppet. The
    problem is that the installer prompts you for a yes or no to choose the
    default path:

    Default directory for installation of products - /opt/ibm/db2/V10.1

    ***********************************************************
    Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no]

    If I run this command through puppet, puppet never sends a yes and the
    prompt ends up in a loop and never runs the installer. You know how to make
    the exec resource send "yes" to the command line?


    Thanks,

    Corey Osman
    corey@logicminds.biz

    Green IT and Data Center Automation Specialist






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



    --
    Trevor Vaughan
    Vice President, Onyx Point, Inc
    (410) 541-6699
    tvaughan@onyxpoint.com

    -- This account not approved for unencrypted proprietary information --

    --
    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.
  • Liu.cy at Feb 28, 2013 at 1:33 am
    1. try /bin/true or /usr/bin/yes
    2. if you want to use it to install software like oracle or db2 or
    something, many of these have silence mode or response file, you should try
    this way first.
    3. if the software you are going to install have rpm/deb packages, that
    would be better than others.
    On Thursday, February 28, 2013 3:23:59 AM UTC+8, Corey Osman wrote:

    A friend of mine ask me this question and I stated puppet was only good
    for sending commands and not interacting with the command line. I told him
    to look for answer file support or a quite mode.
    However, I suppose he could also run a expect script that could answer the
    installer questions but this would be kinda complex for a beginner and not
    the right approach in my opinion.

    Is there a puppet resource or function that could automate this solution?
    Does puppet provide any expect like behavior?

    Question:

    I want to run and installer through an exec resource in Puppet. The
    problem is that the installer prompts you for a yes or no to choose the
    default path:

    Default directory for installation of products - /opt/ibm/db2/V10.1

    ***********************************************************
    Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no]

    If I run this command through puppet, puppet never sends a yes and the
    prompt ends up in a loop and never runs the installer. You know how to make
    the exec resource send "yes" to the command line?


    Thanks,

    Corey Osman
    co...@logicminds.biz <javascript:>

    Green IT and Data Center Automation Specialist





    --
    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.
  • Felix Frank at Mar 1, 2013 at 9:36 am
    Hi,
    On 02/28/2013 02:33 AM, liu.cy wrote:
    1. try /bin/true or /usr/bin/yes
    I see where you're coming from and I concur with 'yes', but 'true' is a
    different beast entirely. It will not be helpful in this particular
    situation.

    yes can also be a little heavyweighed - if this is a single question
    asked, you may well get away with 'echo yes | <command>'.
    2. if you want to use it to install software like oracle or db2 or
    something, many of these have silence mode or response file, you should
    try this way first.
    3. if the software you are going to install have rpm/deb packages, that
    would be better than others.
    --
    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.
  • Corey Osman at Mar 1, 2013 at 7:10 pm
    Wow, I have never even heard of true or yes programs. Echo "Y" is also a
    good solution.

    My friend also noted there was a quite mode available.

    If your curious here are all the suggestions I and the forum came up with:

    1. Look for a quiet mode
    2. Look for a "answer file" option
    3. Modify the installer to accept 1 and 2
    4. Echo "Y"
    5. Use /bin/true or /bin/yes

    I think the most "dump" installers can be automated using these solutions
    before reverting to expect.
    On Wednesday, February 27, 2013 11:23:59 AM UTC-8, Corey Osman wrote:

    A friend of mine ask me this question and I stated puppet was only good
    for sending commands and not interacting with the command line. I told him
    to look for answer file support or a quite mode.
    However, I suppose he could also run a expect script that could answer the
    installer questions but this would be kinda complex for a beginner and not
    the right approach in my opinion.

    Is there a puppet resource or function that could automate this solution?
    Does puppet provide any expect like behavior?

    Question:

    I want to run and installer through an exec resource in Puppet. The
    problem is that the installer prompts you for a yes or no to choose the
    default path:

    Default directory for installation of products - /opt/ibm/db2/V10.1

    ***********************************************************
    Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no]

    If I run this command through puppet, puppet never sends a yes and the
    prompt ends up in a loop and never runs the installer. You know how to make
    the exec resource send "yes" to the command line?


    Thanks,

    Corey Osman
    corey@logicminds.biz

    Green IT and Data Center Automation Specialist





    --
    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.
  • Felix Frank at Mar 4, 2013 at 11:27 am

    On 03/01/2013 08:10 PM, Corey Osman wrote:
    5. Use /bin/true or /bin/yes
    Again, please don't even bother with /bin/true.

    Cheers,
    Felix

    --
    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 27, '13 at 7:24p
activeMar 4, '13 at 11:27a
posts6
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase