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

    hbui

    08/11/2022, 4:36 PM
    but doing something like iterating over
    keys($facts)
    ?
  • j

    Joel Wilson

    08/11/2022, 4:37 PM
    That’s what I’m thinking, yes
  • h

    hbui

    08/11/2022, 4:37 PM
    or
    $facts.keys()
  • j

    Joel Wilson

    08/11/2022, 4:37 PM
    I think it’s part of stdlib
  • h

    hbui

    08/11/2022, 4:39 PM
    that particular function seems to be builtin
  • j

    Joel Wilson

    08/11/2022, 4:53 PM
    Can’t remember if there are ruby-isms available in PP, like
    $facts.keys().collect()
  • n

    natemccurdy

    08/11/2022, 4:54 PM
    `map()`: https://puppet.com/docs/puppet/7/function.html#map
  • s

    Slackbot

    08/11/2022, 4:56 PM
    This message was deleted.
    h
    • 2
    • 1
  • n

    natemccurdy

    08/11/2022, 5:03 PM
    Not necessarily, since you can remove the
    undef
    values from the array afterwards. But also, there’s `filter()`: https://puppet.com/docs/puppet/7/function.html#filter
  • k

    Kyle Vandoremalen

    08/11/2022, 5:23 PM
    Hi puppet! I'm trying to set up a new puppet7 server with puppetdb, but so far I'm unable to query 'pdb/query/v4/resources/Node' correctly, as it returns no output. - I can query 'pdb/query/v4/resources', minus the /Node portion, but the output looks incorrect - The goal is to query based on node tags during code deployments - This lives on a Foreman server, and I had it working at one point but it's since been broken after an accidental puppet.conf config rewrite, with no luck reproducing it. - puppetdb logs show it storing reports, catalogs and facts, but clearly somethings not communicating I'm thinking I must have SSL certs or permissions broken somewhere? I tried re-running ' puppetdb ssl-setup -f' but that didn't help either. Any help or pointers would mean a lot to me. Thanks all
    👍 1
  • j

    Joel Wilson

    08/11/2022, 6:55 PM
    Is there a way to get certname dumped into the puppetserver-access.log ? I’m getting 403s that I’m trying to understand.
  • j

    Joel Wilson

    08/11/2022, 7:18 PM
    Ugh. Getting permission denied on many of my endpoints
  • b

    bastelfreak

    08/11/2022, 7:21 PM
    is your auth.conf still broken?
  • j

    Joel Wilson

    08/11/2022, 7:32 PM
    I mean. I guess. I can’t tell what’s wrong with it, though. I enabled the cert headers in the log and they say SUCCESS, so I’m guessing it’s not a client cert issue.
  • j

    Joel Wilson

    08/11/2022, 7:33 PM
    I even changed the endpoint to a straight path endpoint with
    allow: "*"
    and it’s still getting 403s.
  • b

    bastelfreak

    08/11/2022, 7:34 PM
    who is getting that error on which endpoint? agents when requesting a catalog?
  • l

    Lumiere

    08/11/2022, 7:35 PM
    a default auth.conf is in the rpm/deb packages
  • l

    Lumiere

    08/11/2022, 7:35 PM
    you might be able to grab it from there and diff
  • j

    Joel Wilson

    08/11/2022, 7:35 PM
    agents requesting a catalog and trying to send a report after that.
  • c

    CVQuesty

    08/11/2022, 8:06 PM
    I think @Lumiere got the joy here. Go get a default and work up from there.
  • j

    Joel Wilson

    08/11/2022, 8:08 PM
    I think the name is coming in as IP address.
  • j

    Joel Wilson

    08/11/2022, 8:11 PM
    I’ve got an lb in front of some of my masters, so I guess I need
    allow-header-cert-info: true
    on for those.
  • n

    natemccurdy

    08/11/2022, 8:19 PM
    Are you doing SSL termination on your own? You usually don’t need
    allow-header-cert-info: true
    unless you are.
  • j

    Joel Wilson

    08/11/2022, 8:20 PM
    I need to go look at that config. Possibly.
  • n

    natemccurdy

    08/11/2022, 8:20 PM
    And if you are doing SSL termination on your own, you’ll need to make sure you’re adding certain headers. For example, I terminate SSL via nginx in front of the puppetservers, and use this in my Nginx config:
    Copy code
    # Puppet expects the X-Client-Verify, X-Client-DN, and X-Client-Cert
    # headers for authentication and trusted facts.
    proxy_set_header    X-Client-Verify  $ssl_client_verify;
    proxy_set_header    X-Client-DN      $ssl_client_s_dn;
    proxy_set_header    X-Client-Cert    $ssl_client_escaped_cert;
  • n

    natemccurdy

    08/11/2022, 8:21 PM
    And if you are doing SSL termination on your own, you’ll need to make sure you’re adding certain headers. For example, I terminal SSL via nginx in front of the puppetservers, and use this in my Nginx config:
    Copy code
    # Puppet expects the X-Client-Verify, X-Client-DN, and X-Client-Cert
    # headers for authentication and trusted facts.
    proxy_set_header    X-Client-Verify  $ssl_client_verify;
    proxy_set_header    X-Client-DN      $ssl_client_s_dn;
    proxy_set_header    X-Client-Cert    $ssl_client_escaped_cert;
  • j

    Joel Wilson

    08/11/2022, 8:24 PM
    Right. My module refactor wasn’t factoring in that some of our masters are behind balancers and some are not. The ones which aren’t work fine with that header set to false, but the ones behind balancers need it set to true.
  • n

    natemccurdy

    08/11/2022, 8:25 PM
    And if you are doing SSL termination on your own, you’ll need to make sure you’re adding certain headers. For example, I terminate SSL via nginx in front of the puppetservers, and use this in my Nginx config:
    Copy code
    # Puppet expects the X-Client-Verify, X-Client-DN, and X-Client-Cert
    # headers for authentication and trusted facts.
    proxy_set_header    X-Client-Verify  $ssl_client_verify;
    proxy_set_header    X-Client-DN      $ssl_client_s_dn;
    proxy_set_header    X-Client-Cert    $ssl_client_escaped_cert;
  • s

    Slackbot

    08/12/2022, 4:50 PM
    This message was deleted.
    y
    • 2
    • 3
  • v

    vchepkov

    08/13/2022, 3:11 PM
    Seems #C017HDDUQKX channel pretty much dead, so I'll ask here. I have trouble to use
    include STRING
    match
    Copy code
    augtool> context /files/etc/httpd/conf.d/05-foreman-ssl.conf/
    augtool> match VirtualHost/directive[. = 'ProxyPassReverse']
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[18] = ProxyPassReverse
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[20] = ProxyPassReverse
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[23] = ProxyPassReverse
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[33] = ProxyPassReverse
    How do I match entry with
    arg[2]
    including
    foreman.sock
    ?
    Copy code
    augtool> print /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[33]
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[33] = "ProxyPassReverse"
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[33]/arg[1] = "/"
    /files/etc/httpd/conf.d/05-foreman-ssl.conf/VirtualHost/directive[33]/arg[2] = "unix:///run/foreman.sock|<http://foreman/>"
1...129130131...428Latest