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

    Skylar Thompson

    03/06/2023, 11:09 PM
    I have a (hopefully) quick question about
    pdk
    . I'd like to get in the habit of writing unit tests for our in-house modules, since we're going to be supporting more platforms than we've been needed in the past. Unfortunately, I haven't been able to get
    pdk test
    to work reliably on Ubuntu, though it seems to work fine on FreeBSD. I'm a FreeBSD person so not terribly upset, but most of my team mates will be using Ubuntu so could become a problem. On FreeBSD, I just installed
    rubygem-pdk
    from Ports, made a test module w/
    pdk new module
    and class w/
    pdk new class
    , ran
    pdk test unit
    , and got feedback that the example tests all worked. On Ubuntu, I did the same thing, and got
    Copy code
    An error occurred while loading ./spec/classes/spectrum_protect_client_spec.rb.
    Failure/Error: require 'puppetlabs_spec_helper/module_spec_helper'
    
    TypeError:
      no implicit conversion of nil into String
    # /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-4.0.1/lib/puppetlabs_spec_helper/module_spec_helper.rb:61:in `directory?'
    # /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-4.0.1/lib/puppetlabs_spec_helper/module_spec_helper.rb:61:in `block in <top (required)>'
    # /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-4.0.1/lib/puppetlabs_spec_helper/module_spec_helper.rb:60:in `each'
    # /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-4.0.1/lib/puppetlabs_spec_helper/module_spec_helper.rb:60:in `<top (required)>'
    # ./spec/spec_helper.rb:7:in `require'
    # ./spec/spec_helper.rb:7:in `<top (required)>'
    # ./spec/classes/spectrum_protect_client_spec.rb:3:in `require'
    # ./spec/classes/spectrum_protect_client_spec.rb:3:in `<top (required)>'
    No examples found.
    My gut instinct is that this might be a Ruby bug, but not sure. Has anyone run into this?
  • r

    rusty

    03/06/2023, 11:19 PM
    perhaps your
    Gemfile.lock
    would also be useful. Did you run
    pdk bundle install
    before
    pdk test unit
    ?
  • r

    rusty

    03/06/2023, 11:30 PM
    looks like it is complaining about walking the spec tree, which is odd, as pdk adds that bit
  • r

    rusty

    03/06/2023, 11:34 PM
    weird, the only thing I see different is yours did not create
    spec/{defines,functions,hosts}
    otherwise mine is the same. They are empty dirs see if creating them changes anything
  • k

    Ken

    03/07/2023, 12:09 AM
    I'm trying to stand up my first compiler, and am following the documentation to bring it up w/o the CA service. I followed all the steps from this document https://www.puppet.com/docs/puppet/7/server/scaling_puppet_server.html#creating-and-configuring-compilers Then when I ran 'puppet agent -t' I get this error and it's probably because I do not have a ca.conf anywhere on my system. If I'm to manually create this file, where do I create it? Error: When attempting to sign certificate request 'puppet1.lan', received code: 409 body: CSR 'puppet1.lan' contains extra subject alternative names (DNS:puppet, DNS:puppet.lan, DNS:puppet.local, DNS:puppet1, DNS:puppet1.local), which are disallowed. *To allow subject alternative names, set allow-subject-alt-names to true in your ca.conf file. T*hen restart the puppetserver and try signing this certificate again.
  • k

    Ken

    03/07/2023, 12:35 AM
    OMG - I just ran across something that mentions I'm supposed to create my ca.conf file, with 'allow-subject-alt-names' set to true BEFORE generating my ca certs on my master node? Srsly? Not sure how I missed this since I followed the docs for that also...is this correct?
  • o

    Olmo

    03/07/2023, 11:52 AM
    with r10k puppetfile install you can provide --puppetfile <path> is there a way you can configure r10k to use a particular Puppetfile when running
    r10k deploy environments
    for example ?
  • s

    Slackbot

    03/07/2023, 12:04 PM
    This message was deleted.
    👍 1
    o
    • 2
    • 1
  • d

    Dr Bunsen Honeydew

    03/07/2023, 2:45 PM
    businessparrot Content and Tooling is about to start up in #CFD8Z9A4T
  • s

    Slackbot

    03/07/2023, 4:06 PM
    This message was deleted.
    ☝🏻 1
    👍 2
    👍🏼 1
    🦜 2
    ☝️ 2
    this 2
    😂 2
    y
    s
    +3
    • 6
    • 18
  • m

    ma_garvo

    03/07/2023, 5:41 PM
    Hey not sure if this is just me but I noticed the versioning check puppet does appears to break sometimes when theres more than 1 decimal point. Such as this:
    Copy code
    Error: Could not install module 'binford2k-node_encrypt' (v2.0.0)
      The requested version cannot satisfy one or more of the following installed modules:
        puppetlabs-inifile, installed: 5.4.0, expected: >= 1.4.0 < 6.0.0
  • d

    Dr Bunsen Honeydew

    03/07/2023, 5:41 PM
    See the
    binford2k-node_encrypt
    module at https://forge.puppet.com/binford2k/node_encrypt?src=slack&amp;channel=puppet
  • s

    Slackbot

    03/07/2023, 6:37 PM
    This message was deleted.
    y
    c
    k
    • 4
    • 17
  • k

    Kristian M

    03/07/2023, 6:38 PM
    Hey guys, I am new here and currently facing an issue with the puppet file resource. The below is supposed to create a wp-config.php on an NFS share that does not have no_root_squash set.
    Copy code
    file { "${install_dir}/wp-config.php":
        staging_location => "/tmp",
        require => Vcsrepo["${install_dir}"],
        owner   => $wp_config_owner,
        group   => $wp_config_group,
        mode    => $wp_config_mode,
        content => epp(
          'wordpress/wp-config.php.epp',
          {
            'domain'               => $site_url,
            'db_name'              => $db_name,
            'db_user'              => $db_user,
            'db_pass'              => $db_password,
            'db_host'              => $db_host,
            'db_table_prefix'      => $db_table_prefix,
          }
        )
      }
    With the above the temporary file gets created in /tmp as root (puppet agent is running as root), so when it then tries to copy/move the temporary file to it’s final destination (${install_dir}/wp-config.php) it is failing, as root can not write to the NFS share. How can I best work around this, besides changing any settings to the NFS share, which isn’t possible. I would have expected even the temporary file to have been created as the specified owner/group, but that is clearly not the case. Any advise or hints for possible workarounds are highly appreciated. Thanks
  • k

    Kristian M

    03/07/2023, 6:39 PM
    If I am in the wrong channel, I apologize. Please point me into the right direction.
  • s

    Slackbot

    03/07/2023, 6:41 PM
    This message was deleted.
    h
    c
    • 3
    • 18
  • s

    Slackbot

    03/07/2023, 6:41 PM
    This message was deleted.
    c
    r
    d
    • 4
    • 9
  • s

    Slackbot

    03/07/2023, 7:49 PM
    This message was deleted.
    r
    d
    +3
    • 6
    • 19
  • d

    Dr Bunsen Honeydew

    03/07/2023, 7:49 PM
    See the
    puppetlabs-puppetdb
    module at https://forge.puppet.com/puppetlabs/puppetdb?src=slack&amp;channel=puppet
  • s

    Slackbot

    03/07/2023, 9:59 PM
    This message was deleted.
    n
    b
    • 3
    • 2
  • c

    Corey Hickey

    03/07/2023, 11:53 PM
    Ok, I think I'm still following so far. Next questions: 4. Is there any reasonably-easy way to protect against infinite recursion, e.g. two values aliased to each other? To be fair, I don't know if the current
    alias()
    function protects against this, but it would be nice to do, if feasible. 5. If the high-priority backend defers to lower priority backends via
    context.not_found
    , and the
    alias()
    function is not in use, then what is the concern with respect to:
    If it was not found it must return a default value since if it signals “not found” hiera would continue the search and most likely return undef, resulting in an empty string."
    I would think that signaling "not found" is desirable whenever the high-priority backend does not find anything.
  • c

    Corey Hickey

    03/08/2023, 7:48 AM
    I see what you're saying. I was taking it for a given that it would be desirable that "hiera would then try to find the key with lower prio", but I guess it's more nuanced. It's not possible for a hiera backend to return a terminal "not found and stop looking"? Absent that, I still think that for my own purposes, at least, your option 'b' remains the most suitable. Options 'a' and 'c' preclude using a default specified as a class parameter, which is how the current behavior of
    alias()
    always gets me in trouble. Here's another way of looking at it: my general understanding of hiera is that higher levels of the hierarchy can only add to (or overwrite) data provided by the lower levels of the hierarchy; it's not usually possible to remove data specified lower in the hierarchy, at least without some kind of tricks. So, if an alias fails to find any value from the target key, then so be it: no value was found, so keep looking for the original key lower in the hierarchy. I don't know how complete my understanding is, and maybe I'm rationalizing, but that seems consistent to me.
  • s

    Slackbot

    03/08/2023, 12:02 PM
    This message was deleted.
    z
    b
    n
    • 4
    • 16
  • b

    brokencode

    03/08/2023, 12:02 PM
    Hey there. Is it possible to use
    stdlib::manage::create_resources:
    to create a file with eyaml encrypted content? Something like:
    stdlib::manage::create_resources:
    file:
    '/opt/foobar.conf':
    ensure: file
    mode: '0600'
    owner: 'root'
    group: 'root'
    content: >
    ENC[PKCS7,MIIB6wYJKoZIhvcNAQcDoIIB3DCCAdgCAQAxggEhMIIBHQIBAD
    ...
    CmtBzSRToM9vWPR0Z1HqyrpcKHCgrUg2tVWI6OqFDod8SSis/j1/5TJWhIXL
    tTj7bZfTTR]
  • z

    zipkid

    03/08/2023, 12:54 PM
    Tip, you can use “```” to wrap multiline code blocks.
  • b

    brokencode

    03/08/2023, 1:05 PM
    Hey there. Is it possible to use
    stdlib::manage::create_resources:
    to create a file with eyaml encrypted content? Something like:
    Copy code
    ``
    `stdlib::manage::create_resources:`        
      `file:`
        `'/opt/foobar.conf':`
          `ensure: file`
          `mode: '0600'`
          `owner: 'root'`
          `group: 'root'`
          `content: >`
            `ENC[PKCS7,MIIB6wYJKoZIhvcNAQcDoIIB3DCCAdgCAQAxggEhMIIBHQIBAD`
            `...`
            `CmtBzSRToM9vWPR0Z1HqyrpcKHCgrUg2tVWI6OqFDod8SSis/j1/5TJWhIXL`
            `tTj7bZfTTR]`
    ``
  • b

    brokencode

    03/08/2023, 1:05 PM
    Hey there. Is it possible to use
    stdlib::manage::create_resources:
    to create a file with eyaml encrypted content? Something like:
    stdlib::manage::create_resources:
    file:
    '/opt/foobar.conf':
    ensure: file
    mode: '0600'
    owner: 'root'
    group: 'root'
    content: >
    ENC[PKCS7,MIIB6wYJKoZIhvcNAQcDoIIB3DCCAdgCAQAxggEhMIIBHQIBAD
    ...
    CmtBzSRToM9vWPR0Z1HqyrpcKHCgrUg2tVWI6OqFDod8SSis/j1/5TJWhIXL
    tTj7bZfTTR]
  • b

    brokencode

    03/08/2023, 1:06 PM
    Hey there. Is it possible to use
    stdlib::manage::create_resources:
    to create a file with eyaml encrypted content? Something like:
    Copy code
    stdlib::manage::create_resources:        
      file:
        '/opt/foobar.conf':
          ensure: file
          mode: '0600'
          owner: 'root'
          group: 'root'
          content: >
            ENC[PKCS7,MIIB6wYJKoZIhvcNAQcDoIIB3DCCAdgCAQAxggEhMIIBHQIBAD
            ...
            CmtBzSRToM9vWPR0Z1HqyrpcKHCgrUg2tVWI6OqFDod8SSis/j1/5TJWhIXL
            tTj7bZfTTR]
  • s

    Slackbot

    03/08/2023, 1:30 PM
    This message was deleted.
    v
    y
    d
    • 4
    • 6
  • d

    David Sandilands

    03/08/2023, 2:21 PM
    Although what im hearing here is we need to not only publish our release but give clear ideas of what is currently being worked on
1...320321322...428Latest