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

    David

    05/23/2023, 2:56 PM
    I don't follow, how would you write 1.0.1.1-1101 in hiera escaping the dots?
  • h

    helindbe

    05/23/2023, 2:57 PM
    Not in hiera data, in the lookup
  • d

    David

    05/23/2023, 2:57 PM
    that's a variable which is set by hiera, so how would you know what to escape?
  • h

    helindbe

    05/23/2023, 2:58 PM
    You are doing a lookup where you are interpolating the digits and periods. Add quotes around that.
  • h

    helindbe

    05/23/2023, 2:59 PM
    lookup(“blah_’${version}’” kind of thing
  • h

    helindbe

    05/23/2023, 3:00 PM
    A quoted part tells lookup that the part is verbatim (period has no special meaning).
  • d

    David

    05/23/2023, 3:08 PM
    Copy code
    $application_core_version = lookup("::application::application_'${application_version}'_package_version", {'default_value' => '1.0.1.1-1101'})
      $application_libs_version = lookup("::application::application_'${application_version}'_libs_package_version", {'default_value' => '1.0.1-1'})
    this throws an error,
    Copy code
    Error: Syntax error in key: 'application::application_'2.0.2.2'_package_version'
    If they are supposed to be back-ticks then that does nothing and it still uses the default value
  • h

    helindbe

    05/23/2023, 3:11 PM
    Supposed to be single or double quotes, backticks are not special in puppet strings
  • d

    David

    05/23/2023, 3:12 PM
    The error above is thrown with single quotes around the variable, not sure why it works in puppet 3 but not in puppet 7
  • h

    helindbe

    05/23/2023, 3:12 PM
    Also, remove leading :: in key
  • d

    David

    05/23/2023, 3:13 PM
    ignore that bit, it's a typo when anonymising the data
  • h

    helindbe

    05/23/2023, 3:13 PM
    Puppet 7 is a much later hiera with more features
  • d

    David

    05/23/2023, 3:17 PM
    so in 7 is this not supported?
  • h

    helindbe

    05/23/2023, 3:20 PM
    The other way around. Here is the docs for this: https://www.puppet.com/docs/puppet/7/hiera_automatic.html#hiera_dotted_notation
  • h

    helindbe

    05/23/2023, 3:22 PM
    if it works in 3 it is because periods have no special meaning in hiera and the hiera lookup functions in puppet/hiera 3.
  • d

    Dr Bunsen Honeydew

    05/23/2023, 3:22 PM
    See the
    puppet-hiera
    module at https://forge.puppet.com/puppet/hiera?src=slack&channel=puppet
  • h

    helindbe

    05/23/2023, 3:22 PM
    No Dr Honeydew, we do not want to look at the old hiera 3 module… Go away
    hahaha 2
  • d

    David

    05/23/2023, 3:24 PM
    I've got it, I have to enclose the entire lookup in single quotes, not just the variable
    Copy code
    $application_version      = $::application::application_version
      $application_core_version = lookup("'application::application_${application_version}_package_version'", {'default_value' => '1.0.1.1-1101'})
      $application_libs_version = lookup("'application::application_${application_version}_libs_package_version'", {'default_value' => '1.0.1-1'})
    Thanks for the help
  • h

    helindbe

    05/23/2023, 3:25 PM
    so does that work for you? (as I recalled it, it was possible to quote parts of they key, but apparently not.
  • h

    helindbe

    05/23/2023, 3:27 PM
    To me that is a bug (it should work).
  • d

    David

    05/23/2023, 3:27 PM
    Just testing it again on a clean build, but it seems to have done the trick. The very last Note on the page you sent me did it 🙂
  • h

    helindbe

    05/23/2023, 3:28 PM
    ha, so maybe a bug was “fixed” by adding that to the docs … 😎 Glad it works for you now.
    👍 1
  • d

    Dr Bunsen Honeydew

    05/23/2023, 4:45 PM
    kermit typing 🧑‍🏫Puppet Core Team is about to start up in #CFD8Z9A4T
  • a

    attachmentgenie

    05/23/2023, 6:21 PM
    Has anyone here have any experience doing puppet module development and more importantly a r10k/g10k deployment strategy using a monorepo setup? If you have could you share some thoughts on things like pitfalls, workflows etc
  • b

    bastelfreak

    05/23/2023, 6:23 PM
    @attachmentgenie o/
  • b

    bastelfreak

    05/23/2023, 6:24 PM
    do you have any problems with that? I used monorepos like I handle control-repos or "normal" puppet modules
  • b

    bastelfreak

    05/23/2023, 6:24 PM
    write code, apply vox pupuli boilerplate to get test matrix, write tests, scream at CI pipeline, eat cookies, merge
  • a

    attachmentgenie

    05/23/2023, 6:43 PM
    all of the above really, but atm i mostly interested in how to build the puppetfile when it comes to in house developed modules that we need/want to deploy from git (e.g roles, profiles, $saas_product). I am struggling to get g10k to download from subdirectories
  • b

    bastelfreak

    05/23/2023, 6:46 PM
    ah maybe we have a different understanding of a monorepo
  • b

    bastelfreak

    05/23/2023, 6:46 PM
    I assumed a control-repo with modules vendored in
1...365366367...428Latest