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

    bastelfreak

    07/07/2023, 11:15 AM
    try
    SPEC_FACTS_OS='ubuntu-22' bundle exec rake spec
    ๐Ÿ˜ฒ 1
    ๐Ÿ‘๐Ÿป 1
  • y

    Yury Bushmelev

    07/07/2023, 1:14 PM
    just found an issue accidentally with
    mailhost
    resource config in a nginx module.. I guess itโ€™s related to nginx version detection
  • y

    Yury Bushmelev

    07/07/2023, 1:15 PM
    when first applied it makes a config which is different from what is made on 2nd run
  • y

    Yury Bushmelev

    07/07/2023, 1:15 PM
    though Iโ€™m not sure how to work this around in a better way..
  • y

    Yury Bushmelev

    07/07/2023, 1:32 PM
    just curious.. can I call
    epp()
    from an epp template? ๐Ÿ™‚
  • b

    bastelfreak

    07/07/2023, 1:33 PM
    since that's just a puppet function that should work
  • y

    Yury Bushmelev

    07/07/2023, 1:34 PM
    I guess so as well.. though Iโ€™m not sure if I should follow erb as-is.. maybe itโ€™s better to render them separately and pass as a strings.. need to recheck for the contents
  • v

    VoxBot

    07/07/2023, 1:35 PM
    Yury: did you see my comment about the erb2epp script I wrote?
  • y

    Yury Bushmelev

    07/07/2023, 1:37 PM
    Hi ewoud! Yes, I saw and used it to batch-convert the mailhost templates Iโ€™m working on atm ๐Ÿ™‚
  • y

    Yury Bushmelev

    07/07/2023, 1:37 PM
    had no deep look into the results though
  • v

    VoxBot

    07/07/2023, 1:37 PM
    great! let me know if we should turn it into a real project
  • y

    Yury Bushmelev

    07/07/2023, 1:38 PM
    if we can guess somehow where to put the
    {
    we definitely should
  • v

    VoxBot

    07/07/2023, 1:38 PM
    I also like the || โ†’ or and && โ†’ and rewrite I could detect
  • y

    Yury Bushmelev

    07/07/2023, 1:38 PM
    maybe our friends from the CAT team should take it over though ๐Ÿ™‚
  • y

    Yury Bushmelev

    07/07/2023, 1:39 PM
    this matches their scope really well ๐Ÿ™‚
  • v

    VoxBot

    07/07/2023, 1:39 PM
    the problem is that you just have tokens and I wasn't quite sure where to inject the {
  • v

    VoxBot

    07/07/2023, 1:39 PM
    perhaps just at the end of the token steam
  • v

    VoxBot

    07/07/2023, 1:39 PM
    and you can't use a real parser because the snippets are invalid Ruby
  • y

    Yury Bushmelev

    07/07/2023, 1:39 PM
    easy fix is to put { in the end of the
    if
    line
  • v

    VoxBot

    07/07/2023, 1:39 PM
    just "if @x" is valid in <% if @x %> but it's not a valid Ruby script
  • y

    Yury Bushmelev

    07/07/2023, 1:39 PM
    though this can produce wrong result in some cases (multiline conditions)
  • y

    Yury Bushmelev

    07/07/2023, 1:40 PM
    but better than nothing anyway
  • y

    Yury Bushmelev

    07/07/2023, 1:40 PM
    most of my `if`s have single-line conditions
  • v

    VoxBot

    07/07/2023, 1:40 PM
    so you probably need to look for the next newline character, check if it was preceded by \ and then inject it there + append it if you didn't find any
  • v

    VoxBot

    07/07/2023, 1:40 PM
    but for a quick evening hacking I was happy with how much I could just do automatically already
  • y

    Yury Bushmelev

    07/07/2023, 1:41 PM
    yep, tyvm! really helpful as it is already!
  • y

    Yury Bushmelev

    07/07/2023, 1:43 PM
    maybe Iโ€™ll have a look into it later but itโ€™s a bit over my free time limit ๐Ÿ™‚
  • v

    vchepkov

    07/07/2023, 1:43 PM
    I stumbled yesterday on legacy stdlib function called from an erb in theforeman/puppet - very easy to miss
  • d

    Dr Bunsen Honeydew

    07/07/2023, 1:43 PM
    See the
    theforeman-puppet
    module at https://forge.puppet.com/theforeman/puppet?src=slack&amp;channel=voxpupuli
  • v

    VoxBot

    07/07/2023, 1:43 PM
    bastelfreak: I just rebased https://github.com/voxpupuli/rspec-puppet-facts/pull/152 and for me on puppet-puppetserver_foreman it was a difference of 10 seconds vs 6 seconds, so I'm quite happy with the result now
    ๐Ÿ‘๐Ÿป 1
1...545546547...648Latest