FAQ
Am I missing something or is this behavior broken:

$ puppet -V
3.2.3
$ grep environment /etc/puppet/puppet.conf
     environment = bmetcalf
$ puppet config print environment
production

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.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Rahul Khengare at Sep 23, 2013 at 9:47 am
    Hi Brandon,
         puppet config print option print the environment variable of [main]
    section only it is not overridden by another config block.
    Check the config block of environment variable present in puppet.conf file.

    Read following documentation of puppet on environment,
    http://docs.puppetlabs.com/guides/environment.html

    Thanks and Regards,
    Rahul Khengare,
    NTT DATA OSS Center, Pune, India.

    On Saturday, September 21, 2013 2:44:41 AM UTC+5:30, Brandon Metcalf wrote:

    Am I missing something or is this behavior broken:

    $ puppet -V
    3.2.3
    $ grep environment /etc/puppet/puppet.conf
    environment = bmetcalf
    $ puppet config print environment
    production

    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.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Brandon Metcalf at Sep 23, 2013 at 3:21 pm
    OK, thanks. Based on the doc, it looks like if I have a host that acts as
    a master and agent and the [master] and [agent] sections contain different
    values for environment, then there is no way to get "puppet config print
    environment" to print the value from the [agent] section.

    On Monday, September 23, 2013 4:47:45 AM UTC-5, Rahul Khengare wrote:

    Hi Brandon,
    puppet config print option print the environment variable of [main]
    section only it is not overridden by another config block.
    Check the config block of environment variable present in puppet.conf file.

    Read following documentation of puppet on environment,
    http://docs.puppetlabs.com/guides/environment.html

    Thanks and Regards,
    Rahul Khengare,
    NTT DATA OSS Center, Pune, India.

    On Saturday, September 21, 2013 2:44:41 AM UTC+5:30, Brandon Metcalf wrote:

    Am I missing something or is this behavior broken:

    $ puppet -V
    3.2.3
    $ grep environment /etc/puppet/puppet.conf
    environment = bmetcalf
    $ puppet config print environment
    production

    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.
    For more options, visit https://groups.google.com/groups/opt_out.
  • John Julien at Sep 23, 2013 at 4:21 pm

    On Monday, September 23, 2013 10:02:18 AM UTC-5, Brandon Metcalf wrote:
    OK, thanks. Based on the doc, it looks like if I have a host that acts as
    a master and agent and the [master] and [agent] sections contain different
    values for environment, then there is no way to get "puppet config print
    environment" to print the value from the [agent] section.


    This actually used to works in 2.7.x by running "puppet config print
    environment --mode agent"

    The --mode option was removed and replaced with --run_mode in 3.x
    https://github.com/jjulien/puppet/commit/f4e229ee5a0a1d6a62735eb434eb2c284b7f517d#diff-022bd17388c88fcad57e6f36fff407fb
    as a result of some concerns expressed in
    https://projects.puppetlabs.com/issues/16189

    This does not appear to be working though, as an error is thrown when
    --run_mode is being specified and the bootstrapping of the run to a default
    of "agent" also does not appear to be functioning properly.

    You may want to use an iniparser to gather this info until the bug can be
    fixed. Another option is to use the following ruby code:

    require 'puppet'
    app = Puppet::Application::Agent.new()
    app.preinit
    Puppet.settings.parse
    Puppet[:daemonize] = false
    app.setup

    # You can now access your [agent] config settings like so:
    puts "Agent environment: #{Puppet[:environment]}"

    This works fine on a normal functioning puppet client. One bug that will
    cause an endless loop for you is if your certificate and private key don't
    match. Probably quite the corner case for most, but I'm in the middle of
    some rigorous testing around Puppet monitoring and have come across that
    situation.



    --
    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.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dan White at Sep 23, 2013 at 4:50 pm
    It still works this way:

    [root ~]# puppet agent --configprint ssldir
    /var/lib/puppet/ssl
    [root ~]# puppet master --configprint ssldir
    /var/lib/puppet-master/ssl

    as opposed to:

    [root ~]# puppet config print ssldir
    /var/lib/puppet/ssl


    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "John Julien" <john@julienfamily.com>
    To: puppet-users@googlegroups.com
    Sent: Monday, September 23, 2013 12:03:08 PM
    Subject: [Puppet Users] Re: config print seems to be broken




    On Monday, September 23, 2013 10:02:18 AM UTC-5, Brandon Metcalf wrote:


    OK, thanks. Based on the doc, it looks like if I have a host that acts as a master and agent and the [master] and [agent] sections contain different values for environment, then there is no way to get "puppet config print environment" to print the value from the [agent] section.






    This actually used to works in 2.7.x by running "puppet config print environment --mode agent"

    The --mode option was removed and replaced with --run_mode in 3.x

    https://github.com/jjulien/puppet/commit/f4e229ee5a0a1d6a62735eb434eb2c284b7f517d#diff-022bd17388c88fcad57e6f36fff407fb
    as a result of some concerns expressed in https://projects.puppetlabs.com/issues/16189

    This does not appear to be working though, as an error is thrown when --run_mode is being specified and the bootstrapping of the run to a default of "agent" also does not appear to be functioning properly.

    You may want to use an iniparser to gather this info until the bug can be fixed. Another option is to use the following ruby code:

    require 'puppet'
    app = Puppet::Application::Agent.new()
    app.preinit
    Puppet.settings.parse
    Puppet[:daemonize] = false
    app.setup

    # You can now access your [agent] config settings like so:
    puts "Agent environment: #{Puppet[:environment]}"

    This works fine on a normal functioning puppet client. One bug that will cause an endless loop for you is if your certificate and private key don't match. Probably quite the corner case for most, but I'm in the middle of some rigorous testing around Puppet monitoring and have come across that situation.





    --
    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 .
    For more options, visit https://groups.google.com/groups/opt_out .

    --
    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.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Josh Cooper at Oct 31, 2013 at 5:06 am

    On Mon, Sep 23, 2013 at 9:19 AM, Dan White wrote:

    It still works this way:

    [root ~]# puppet agent --configprint ssldir
    /var/lib/puppet/ssl
    [root ~]# puppet master --configprint ssldir
    /var/lib/puppet-master/ssl
    You are better off specifying the application, e.g. master, and the
    --configprint option to obtain the "correct" answer.

    as opposed to:
    [root ~]# puppet config print ssldir
    /var/lib/puppet/ssl
    This invokes the `config` face-based application, which has issues...

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2Bu97umE61%2BEEVSRjSKgn_-gtyjJKBAbJ9DTxKn8Xi6ojcB2ZQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dan White at Oct 31, 2013 at 12:49 pm
    Makes perfect sense.
    Is there an open issue on this ?
    if not, I would be glad to do the honors


    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Josh Cooper" <josh@puppetlabs.com>
    To: puppet-users@googlegroups.com
    Sent: Thursday, October 31, 2013 1:06:35 AM
    Subject: Re: [Puppet Users] Re: config print seems to be broken


    On Mon, Sep 23, 2013 at 9:19 AM, Dan White wrote:






    It still works this way:

    [root ~]# puppet agent --configprint ssldir
    /var/lib/puppet/ssl
    [root ~]# puppet master --configprint ssldir
    /var/lib/puppet-master/ssl






    You are better off specifying the application, e.g. master, and the --configprint option to obtain the "correct" answer.


    <blockquote>


    as opposed to:

    [root ~]# puppet config print ssldir
    /var/lib/puppet/ssl

    </blockquote>



    This invokes the `config` face-based application, which has issues...


    Josh

    --

    Josh Cooper
    Developer, Puppet Labs

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2Bu97umE61%2BEEVSRjSKgn_-gtyjJKBAbJ9DTxKn8Xi6ojcB2ZQ%40mail.gmail.com .
    For more options, visit https://groups.google.com/groups/opt_out .

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1173685265.4299246.1383223759400.JavaMail.root%40sz0126a.westchester.pa.mail.comcast.net.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 22, '13 at 6:21p
activeOct 31, '13 at 12:49p
posts7
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase