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

    bastelfreak

    03/02/2023, 11:02 AM
    do you have anything that provides
    network-online.target
    ? If your agen't doesn't set that in
    After=
    in it's systemd unit, add that
    👀 1
  • j

    James Paton-Smith

    03/02/2023, 11:06 AM
    Yup, we have network-online.target and puppet agent service has been configured to wait for it.
    Copy code
    # /lib/systemd/system/puppet.service
    #
    # Local settings can be configured without being overwritten by package upgrades, for example
    # if you want to increase puppet open-files-limit to 10000,
    # you need to increase systemd's LimitNOFILE setting, so create a file named
    # "/etc/systemd/system/puppet.service.d/limits.conf" containing:
    # [Service]
    # LimitNOFILE=10000
    # You can confirm it worked by running systemctl daemon-reload
    # then running systemctl show puppet | grep LimitNOFILE
    #
    [Unit]
    Description=Puppet agent
    Wants=basic.target
    After=basic.target network.target
    
    [Service]
    EnvironmentFile=-/etc/sysconfig/puppetagent
    EnvironmentFile=-/etc/sysconfig/puppet
    EnvironmentFile=-/etc/default/puppet
    ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
    ExecReload=/bin/kill -HUP $MAINPID
    KillMode=process
    
    [Install]
    WantedBy=multi-user.target
    
    # /etc/systemd/system/puppet.service.d/puppet.service.conf
    [Unit]
    Description=Puppet agent
    Wants=basic.target
    After=basic.target network.target network-online.target
  • j

    James Paton-Smith

    03/02/2023, 11:06 AM
    I've also tried adding
    After=nss-lookup.target
    but get the same issue
  • b

    bastelfreak

    03/02/2023, 11:12 AM
    do you have
    systemd-networkd-wait-online.service
    and is it enabled?
  • j

    James Paton-Smith

    03/02/2023, 11:14 AM
    We do but it's disabled. We're using NetworkManager for these devices since they're laptop/desktop machines. We do have the
    NetworkManager-wait-online.service
    instead though
  • b

    bastelfreak

    03/02/2023, 11:18 AM
    ah okay. that should provide network-online.target as well
  • b

    bastelfreak

    03/02/2023, 11:19 AM
    any unit provides name resolution for you, that you can depend on? systemd-resolvd?
  • b

    bastelfreak

    03/02/2023, 11:19 AM
    or hack an execstartpre that sleeps until name resolution works
  • j

    James Paton-Smith

    03/02/2023, 11:37 AM
    I'll give those options a go and see what happens 👍 thanks for the suggestions.
  • s

    Slackbot

    03/02/2023, 12:35 PM
    This message was deleted.
    c
    • 2
    • 1
  • m

    Massimiliano (Max)

    03/02/2023, 12:53 PM
    I noticed a small weird bug. I accidentally wrote the following in a manifest:
    Copy code
    "somestring-${$variable_name}-blahblah"
    and it works, despite there is typo (can you see the dollar symbol before and after the curly bracket?) It can be easily reproduced with puppet-debugger:
  • m

    Massimiliano (Max)

    03/02/2023, 12:54 PM
    this is puppet 7
  • y

    Yury Bushmelev

    03/02/2023, 12:56 PM
    I believe it’s feature :) though I know @helindbe can explain it better
  • m

    Massimiliano (Max)

    03/02/2023, 12:59 PM
    aah.... it's not even an unescaped special character.... if I use
    ^
    or I put
    $
    at the end it throws an error. And if I use only the dollar inside the curly bracket it does not interpolate the variable. Let's wait for @helindbe
  • h

    helindbe

    03/02/2023, 1:00 PM
    Without the $ is the special case actually (for interpolating a variable).
  • m

    Massimiliano (Max)

    03/02/2023, 1:01 PM
    this is what I can see:
  • h

    helindbe

    03/02/2023, 1:03 PM
    Yes, works as it should
  • y

    Yury Bushmelev

    03/02/2023, 1:03 PM
    ${} interpolates and substitutes what is inside. That’s why it works this way (from my understanding)
  • y

    Yury Bushmelev

    03/02/2023, 1:03 PM
    Ah, so skipping $ inside is THE feature :)
  • m

    Massimiliano (Max)

    03/02/2023, 1:03 PM
    and this is ignored =>
    {$...
  • m

    Massimiliano (Max)

    03/02/2023, 1:04 PM
    but this one fails =>
    {...$
    😵‍💫
  • h

    helindbe

    03/02/2023, 1:04 PM
    The braced contents is a puppet expression, plus special case that an initial bare word is taken as the name of a variable.
    👍 1
  • m

    Massimiliano (Max)

    03/02/2023, 1:06 PM
    🧩 I am puzzled... I take a coffee
  • y

    Yury Bushmelev

    03/02/2023, 1:11 PM
    It’s not a regular expression :) it’s puppet language expression (https://puppet.com/docs/puppet/7/lang_expressions.html).. e.g. you can write ${mylist.join(‘,’)}
    💯 1
  • y

    Yury Bushmelev

    03/02/2023, 1:12 PM
    Or maybe ${$a + $b}
  • n

    Neeloj

    03/03/2023, 10:14 AM
    message has been deleted
  • s

    Slackbot

    03/03/2023, 1:24 PM
    This message was deleted.
    ❤️ 1
    👍 3
    👍🏻 1
    v
    d
    c
    • 4
    • 37
  • n

    Neeloj

    03/03/2023, 2:04 PM
    message has been deleted
  • s

    Slackbot

    03/03/2023, 4:31 PM
    This message was deleted.
    c
    • 2
    • 1
  • s

    Slackbot

    03/03/2023, 4:34 PM
    This message was deleted.
    b
    o
    • 3
    • 26
1...317318319...428Latest