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

    Brian Schonecker

    07/14/2022, 8:27 PM
    Typically I take the attitude of "manage the whole file" and avoid augeas and ini-style edits.
  • n

    natemccurdy

    07/14/2022, 8:28 PM
    Oh… do you mean the config file takes multiple options? Possibly more than one line of options? Like this?:
    Copy code
    FOO=hello
    BAR=one two three
    BAZ=world
  • b

    Brian Schonecker

    07/14/2022, 8:28 PM
    I think the chrony file is only a one-liner: OPTIONS='-u chrony -l -L'
  • b

    Brian Schonecker

    07/14/2022, 8:28 PM
    Let me verify.
  • b

    Brian Schonecker

    07/14/2022, 8:31 PM
    Yeah, /etc/sysconfig/chronyd is a one-liner.
  • d

    Dr Bunsen Honeydew

    07/14/2022, 8:45 PM
    beaker 🧑‍🏫PE Console is about to start up in #CFD8Z9A4T
  • s

    smortex

    07/14/2022, 10:22 PM
    I have a trick though…
  • v

    vchepkov

    07/14/2022, 10:24 PM
    You can do as many lines there as you want, but service only uses OPTIONS variable
  • g

    gary

    07/15/2022, 5:55 AM
    There any modules out there that supports pulling secrets from google's secret manager service? I've only found ones for aws or vault.
  • j

    Jayakrishnan Mukundan

    07/15/2022, 10:32 AM
    We have a puppet module to update postgressql and each and every puppet pull cycle in the client side creating few files with extention .pref under /etc/apt/preferences.d. After that file creation , using puppet we could not update anyting until and unless we clear those file which are generated.
  • s

    Slackbot

    07/15/2022, 12:25 PM
    This message was deleted.
    j
    b
    • 3
    • 3
  • b

    Brian Schonecker

    07/15/2022, 12:27 PM
    Run your manifest until it "fails" in not doing what you want and then do "echo test >> /etc/pat/preferences.d/<file.pref> " and re-run Puppet. I'd be willing to bet that your manifest then makes the changes you expect because the .pref files will be recreated and the dependency (or "subscribe or "notify") section kicks off.
  • b

    Brian Schonecker

    07/15/2022, 12:27 PM
    It sounds like you have a dependency on the .pref files changing and once those .pref files are deleted and (puppet) recreated, then you get your updates.
  • b

    Brian Schonecker

    07/15/2022, 12:28 PM
    Run your manifest until it "fails" in not doing what you want and then do "echo test >> /etc/pat/preferences.d/<file.pref> " and re-run Puppet. I'd be willing to bet that your manifest then makes the changes you expect because the .pref files will be recreated and the dependency (or "subscribe or "notify") section kicks off.
  • j

    John Ratliff

    07/15/2022, 2:00 PM
    What's a good way to apply a value in hiera to a group of unrelated (but deliberately chosen) servers? The only thing they share in common is that they all run apache. I have a new apache config I want to test on a handful of my servers. I have a variable which if set to true, will use the new apache config. I want to set that value in hiera for about 20 different servers. My first thought is to create a custom fact and then modify the hiera config to apply a yaml file to these servers based on the setting of that fact, but is there a better way? P.S. We are using puppet 4.10. I know it's EOL. We're upgrading to 7, but that's not going to happen before I need to make these changes.
  • v

    vchepkov

    07/15/2022, 2:06 PM
    you can set apache hiera in common
  • b

    Brian Schonecker

    07/15/2022, 2:08 PM
    @John Ratliff, are the server names similar enough that you could write a hackish IF check?
  • j

    John Ratliff

    07/15/2022, 2:09 PM
    No, there is no good fact that applies to just the subset of servers I want. Server names are all over the map. We just have a lot of apache servers.
  • b

    Brian Schonecker

    07/15/2022, 2:10 PM
    You could create a single "nodes/%{trusted.certname}.yaml" file in your hiera hierarchy and then symlink each server's name to the nodes/%{trusted.certname}.yaml file.
  • b

    Brian Schonecker

    07/15/2022, 2:10 PM
    That's kinda hackish.
  • v

    vchepkov

    07/15/2022, 2:10 PM
    You can create a new hierarchy level for just two groups of servers to reflect that common setting if you like
  • j

    John Ratliff

    07/15/2022, 2:11 PM
    Yeah, that's what I was thinking. A new hierarchy level and set a custom fact in site_facts/lib/facter where the hiera level would match.
  • v

    vchepkov

    07/15/2022, 2:12 PM
    yep, I use
    application
    to join dns and dhcp servers
  • v

    vchepkov

    07/15/2022, 2:13 PM
    some folks use %alias function to avoid copy/paste
  • v

    vchepkov

    07/15/2022, 2:14 PM
    define some
    common::apache::stuff
    and reference it in real
    apache::
  • l

    Lumiere

    07/15/2022, 2:49 PM
    if it's a one time thing, I'd do the nodes/trusted certname thing
  • l

    Lumiere

    07/15/2022, 2:50 PM
    if it's a thing you want to be able to repeat, I'd make a fact called like... canary_node that looks for a file on the filesystem and either returns its content or "true" if it exists
  • j

    Jason Grammenos

    07/15/2022, 4:06 PM
    what is the current method of doing
    Copy code
    lookup('ntp::service_name')
    in a erb template? is it
    Copy code
    scope.call_function('lookup',[ntp::service_name'])
    or
    Copy code
    scope['ntp::service_name']
    or somethign else?
  • v

    vchepkov

    07/15/2022, 4:10 PM
    none of it 🙂
  • v

    vchepkov

    07/15/2022, 4:10 PM
    do APL in the code and pass it to epp template
1...969798...428Latest