https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • c

    Christian Michael Tan

    08/07/2023, 1:02 PM
    How do I enter a bash command with curly braces inside an exec?
    command  => 'var=$(awk -F: '($2 == "" ) { print $1 }' /etc/shadow)',
    this is giving me an error : syntax error at line 58 '{'
  • r

    Robert Vincent

    08/07/2023, 1:10 PM
    @Christian Michael Tan It's definitely a syntax error. Your single-quotes are mismatched.
  • r

    Robert Vincent

    08/07/2023, 1:12 PM
    Try
    command  => "var=\$(awk -F: '($2 == \"\" )' { print \$1 }" /etc/shadow)',
  • c

    Christian Michael Tan

    08/07/2023, 1:15 PM
    tried to run that, its giving me this error :
    Syntax error at ')' (file: /home/ccpro/env_var_test.pp, line: 3, column: 87
  • c

    Christian Michael Tan

    08/07/2023, 1:16 PM
    I'm thinking the curly braces need to be escaped or some sort?
  • r

    Robert Vincent

    08/07/2023, 1:16 PM
    Sorry; I mis-parsed your intent. End-of-string is just before the comma.
  • r

    Robert Vincent

    08/07/2023, 1:17 PM
    command  => "var=\$(awk -F: '(\$2 == \"\" )' { print \$1 } /etc/shadow)"
  • r

    Robert Vincent

    08/07/2023, 1:18 PM
    The curly-braces are not your problem.
  • r

    Robert Vincent

    08/07/2023, 1:19 PM
    dollar-signs and quotes are your problem.
  • b

    bastelfreak

    08/07/2023, 1:23 PM
    don't do that
  • s

    Slackbot

    08/07/2023, 1:23 PM
    This message was deleted.
    r
    b
    • 3
    • 4
  • c

    Christian Michael Tan

    08/07/2023, 1:23 PM
    will do some testing, thank you for the help! Much appreciated! @Robert Vincent
  • r

    Robert Vincent

    08/07/2023, 1:29 PM
    @Christian Michael Tan As @bastelfreak pointed out, calling
    awk
    from a Puppet
    exec
    is probably a bad idea, regardless. I was assuming that you were just playing around for educational purposes, but setting a
    var
    environment variable within a Puppet
    exec
    resource will have zero net effect.
  • m

    matt

    08/07/2023, 1:39 PM
    where does the puppet master write it’s performance/telemetry if you’ve not to puppetdb installed ?
  • b

    bastelfreak

    08/07/2023, 1:42 PM
    what kind of performance/telemetry do you have in mind
  • b

    bastelfreak

    08/07/2023, 1:42 PM
    for the actual puppetserver that's never written to puppetdb
  • m

    matt

    08/07/2023, 1:42 PM
    ahhhhhhh
  • b

    bastelfreak

    08/07/2023, 1:42 PM
    puppet agent reports contain some information about the catalog application, those can be written to puppetdb
  • m

    matt

    08/07/2023, 1:42 PM
    (I’m reading the operational_dashboard module) and it looked like it was trying to query puppetdb
  • m

    matt

    08/07/2023, 1:43 PM
    right, they are stored in postgres on my setup, and I see that in the module
  • m

    matt

    08/07/2023, 1:43 PM
    ok, user error on my part
  • b

    bastelfreak

    08/07/2023, 1:43 PM
    it queries puppetdb to get puppetdb performance data
  • m

    matt

    08/07/2023, 1:43 PM
    right, I see what you’re saying, I’m not using puppetdb so I don’t need that
  • m

    matt

    08/07/2023, 1:44 PM
    I’d missread it
  • s

    Slackbot

    08/07/2023, 2:54 PM
    This message was deleted.
    Untitled
    b
    a
    +3
    • 6
    • 29
  • j

    jhoblitt

    08/07/2023, 5:27 PM
    does anyone have a one liner to run
    puppet agent -t
    in a loop until the node fully converges?
  • s

    Slackbot

    08/07/2023, 5:31 PM
    This message was deleted.
    j
    v
    +2
    • 5
    • 35
  • v

    vchepkov

    08/07/2023, 5:32 PM
    I found that for our catalog 4 is the max
  • s

    Sushant Karpe

    08/07/2023, 5:45 PM
    👋 Hello, team!
  • b

    bastelfreak

    08/07/2023, 5:50 PM
    o/
1...405406407...428Latest