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

    bastelfreak

    09/14/2022, 5:29 PM
    touch the file maybe? (with correct permissions)
  • b

    bastelfreak

    09/14/2022, 5:30 PM
    I know I had the problem in the past, but I'm not really sure how we fixed it. I think we just truncated the file
  • p

    professoruss

    09/14/2022, 5:31 PM
    yeah, i vaguely remember dealing with this at some point in the past decade
  • b

    bastelfreak

    09/14/2022, 5:35 PM
    also if you're on puppetserver 6 or newer, you can enable the infra_inventory.txt and then agent's should only download that, not the whole file
  • p

    professoruss

    09/14/2022, 5:38 PM
    oh cool, i’ll look into that
  • p

    professoruss

    09/14/2022, 5:38 PM
    also, looks like moving it out of the way and touching with the correct perms worked
  • b

    bastelfreak

    09/14/2022, 5:39 PM
    https://puppet.com/docs/puppet/6/server/infrastructure_crl.html
    👍 1
  • j

    John Ratliff

    09/14/2022, 6:44 PM
    How can I use the urlescape puppetlabs/stdlib function in an epp template?
    $idp = urlescape($whitelists['InCommon'][$whitelist])
    This is what I'm trying, but it says there is no such function urlescape.
  • d

    Dr Bunsen Honeydew

    09/14/2022, 6:44 PM
    See the
    puppetlabs-stdlib
    module at https://forge.puppet.com/puppetlabs/stdlib?src=slack&channel=puppet
  • j

    John Ratliff

    09/14/2022, 6:46 PM
    looks like maybe it's uriescape, not urlescape. Never mind.
  • j

    John Ratliff

    09/14/2022, 7:01 PM
    uriescape doesn't do what I expect. Am I using it wrong? $v = uriescape('https://website.com/path/with/slashes") I expect $v to have the path with the slashes replaced with %2F, but instead I get the same thing back.
  • n

    natemccurdy

    09/14/2022, 7:04 PM
    `/`’s don’t need to be uriescaped since they’re valid characters for a URI.
  • n

    natemccurdy

    09/14/2022, 7:05 PM
    Why do you need to convert those to
    %2F
    ?
  • n

    natemccurdy

    09/14/2022, 7:05 PM
    `/`’s don’t need to be uriescaped since they’re valid characters for a URI.
  • j

    John Ratliff

    09/14/2022, 7:08 PM
    <https://mdq.incommon.org/entities/https://idp.login.iu.edu/idp/shibboleth>
    The above URL is wrong. The below one is correct.
    <https://mdq.incommon.org/entities/https:%2F%2Fidp.login.iu.edu%2Fidp%2Fshibboleth>
    But I guess you're right, slashes are valid in a URI. I'll try just replacing the slashes in the last part.
  • n

    natemccurdy

    09/14/2022, 7:09 PM
    Yeah, it’s not going to be able to differentiate between an actual path delimiter and the the value of a path.
  • v

    vchepkov

    09/14/2022, 7:22 PM
    you can wrap CGI function into puppet's
    Copy code
    irb(main):001:0> require 'cgi'
    => true
    irb(main):002:0> CGI.escape('<https://mdq.incommon.org/entities/https://idp.login.iu.edu/idp/shibboleth>')
    => "https%3A%2F%2Fmdq.incommon.org%2Fentities%2Fhttps%3A%2F%2Fidp.login.iu.edu%2Fidp%2Fshibboleth"
  • v

    vchepkov

    09/14/2022, 7:24 PM
    Something like this
    Copy code
    require 'cgi'
    Puppet::Functions.create_function('urlencode') do
      dispatch :urlencode do
        param 'String', :url
      end
    
      def urlencode(url)
        CGI.escape(url)
      end
    end
  • v

    vchepkov

    09/14/2022, 7:24 PM
    I swear
    url_encode
    was part of stdlib at some point, I could be wrong
  • s

    Slackbot

    09/14/2022, 7:52 PM
    This message was deleted.
    f
    • 2
    • 2
  • v

    vchepkov

    09/14/2022, 7:54 PM
    Steve, that approach is considered anti-pattern in puppet. You, not something else, define desired state. so no guessing involved
  • v

    vchepkov

    09/14/2022, 7:54 PM
    if you need two packages, install two
  • v

    vchepkov

    09/14/2022, 7:55 PM
    also, puppet code is called 'manifest'
  • t

    Tom Hilburn

    09/14/2022, 9:35 PM
    Hello, We are getting this error on all machines that update to the latest version Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template **.erb: Filepath: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb Line: 93 Detail: undefined method `create_erb' for Puppet:UtilModule (file: **, line: 8, column: 16) on node *****
  • t

    Tom Hilburn

    09/14/2022, 9:36 PM
    Hello, We are getting this error on all machines that update to the latest version Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template **.erb: Filepath: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb Line: 93 Detail: undefined method `create_erb' for Puppet:UtilModule (file: **, line: 8, column: 16) on node *****
  • t

    Tom Hilburn

    09/14/2022, 9:36 PM
    I've tried doing a full reinstall of the agent on one of the boxes
  • t

    Tom Hilburn

    09/14/2022, 9:36 PM
    OH, Ubuntu 22.04.01 Jammy is the node
  • t

    Tom Hilburn

    09/14/2022, 9:37 PM
    *****:~# puppet --version 7.19.0 puppet-agent/jammy,now 7.19.0-1jammy amd64
  • n

    natemccurdy

    09/14/2022, 9:42 PM
    templatewrapper
    ? What’s that? Is that a custom function?
  • t

    Tom Hilburn

    09/14/2022, 9:43 PM
    *****:~# puppet --version 7.19.0 puppet-agent/jammy,now 7.19.0-1jammy amd64
1...162163164...428Latest