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

    ziggy

    04/14/2023, 11:00 PM
    Hey all. I am adding a yaml file to a host and configuring it an an epp like:
    Copy code
    signers:
      user:
        key: |
          <%= $user_ca %>
    The contents of user_ca is a private key; however, when I do this, the outcome is:
    Copy code
    signers:
      user:
        key: |
          -----BEGIN OPENSSH PRIVATE KEY-----
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXX
    -----END OPENSSH PRIVATE KEY-----
    The first line is correct, but the ones at the bottom are not inline with the top. Is there a way to ensure they are all aligned with the top line?
  • s

    smortex

    04/14/2023, 11:50 PM
    @ziggy I would rather try
    { signers => { user => { key => $user_ca } } }.to_yaml
    , that is generate a data structure that match what you want and serialize it to YAML
  • s

    smortex

    04/14/2023, 11:50 PM
    @ziggy I would rather try
    { signers => { user => { key => $user_ca } } }.to_yaml
    , that is generate a data structure that match what you want and serialize it to YAML
  • s

    smortex

    04/14/2023, 11:51 PM
    https://github.com/puppetlabs/puppetlabs-stdlib/blob/main/REFERENCE.md#to_yamlany-data-optionalhash-options
  • z

    ziggy

    04/15/2023, 12:01 AM
    oh! Thank you
  • v

    vchepkov

    04/15/2023, 7:57 PM
    you can also try fiddyspence/hash_file
  • d

    Dr Bunsen Honeydew

    04/15/2023, 7:58 PM
    See the
    fiddyspence-hash_file
    module at https://forge.puppet.com/fiddyspence/hash_file?src=slack&amp;channel=puppet
  • d

    David Sandilands

    04/17/2023, 12:09 PM
    ok with no shouts of pain these have been archived and set to read only into the toybox. A blog post will be released to clarify this and the future direction of PDK https://github.com/puppetlabs-toy-chest/pct https://github.com/puppetlabs-toy-chest/prm
  • d

    David Sandilands

    04/17/2023, 12:09 PM
    ok with no shouts of pain these have been archived and set to read only into the toybox. A blog post will be released to clarify this and the future direction of PDK https://github.com/puppetlabs-toy-chest/pct https://github.com/puppetlabs-toy-chest/prm
  • s

    Slackbot

    04/17/2023, 5:13 PM
    This message was deleted.
    c
    d
    +2
    • 5
    • 9
  • s

    Slackbot

    04/17/2023, 5:15 PM
    This message was deleted.
    g
    e
    • 3
    • 4
  • d

    Dr Bunsen Honeydew

    04/17/2023, 5:15 PM
    ```- took a hit! Ouch. (Karma: -107)
  • v

    vchepkov

    04/17/2023, 5:19 PM
    There is a quite old ticket about it https://tickets.puppetlabs.com/browse/SERVER-2355
  • s

    Slackbot

    04/17/2023, 5:39 PM
    This message was deleted.
    c
    k
    y
    • 4
    • 28
  • c

    CVQuesty

    04/17/2023, 5:40 PM
    file_line is a paqrt of the stdlib module: https://forge.puppetlabs.com/modules/puppetlabs/stdlib/reference#file_line
  • r

    rusty

    04/17/2023, 5:41 PM
    the stdlib may as well be considered "core" since it is "standard"
    🤔 1
    ➕ 1
  • c

    CVQuesty

    04/17/2023, 5:42 PM
    Generally speaking, you can trust anything produced by Puppet on your system. Core functionality for pretty much all supported or affiliate modules is usually offered by puppetlabs/stdlib
  • d

    Dr Bunsen Honeydew

    04/17/2023, 5:42 PM
    See the
    puppetlabs-stdlib
    module at https://forge.puppet.com/puppetlabs/stdlib?src=slack&amp;channel=puppet
  • s

    Slackbot

    04/17/2023, 5:42 PM
    This message was deleted.
    y
    c
    +3
    • 6
    • 12
  • c

    Cam Chambers

    04/17/2023, 5:43 PM
    I'm writing out a puppet module and got into a debate with a coworker about what would be the best way to write it and wanted to see what opinions were: Let's say I'm creating a puppet module that does three things: 1) installs an application, 2) creates a config file from a template, and then 3) ensures the application service is running (on linux). I've gone the route such that my module hierarchy is:
    Copy code
    | hieradata
    |   -> defaults.yaml
    |
    | manifests
    |   -> init.pp
    |   -> install.pp
    |   -> config.pp
    |   -> service.pp
    |
    | templates
    |   -> config.yaml.epp
    The idea is that the init.pp just does a contain on the other 3 subclasses (install, config, and service). The install subclass will contain the functions for installing the application as well as any parameters related to the install:
    Copy code
    class module::install(
      String $package_version
    ) {}
    The config subclass will generate and place the config file on the server as well as contain any parameters related to the config. The service subclass will ensure the service is in a given state and will contain any parameters related to the service. My coworker proposed that instead all of the parameters actually be defined within the init.pp class. I felt it was better to put parameters in the subclasses they belong to as a means of being more organized but what are your thoughts?
  • s

    Slackbot

    04/17/2023, 5:43 PM
    This message was deleted.
    c
    v
    r
    • 4
    • 7
  • c

    CVQuesty

    04/17/2023, 5:43 PM
    message has been deleted
  • v

    vchepkov

    04/17/2023, 5:43 PM
    user interact with a module via init class's parameters
  • c

    CVQuesty

    04/17/2023, 5:45 PM
    message has been deleted
  • c

    CVQuesty

    04/17/2023, 5:57 PM
    https://github.com/puppetlabs/puppetlabs-stdlib
  • s

    Slackbot

    04/17/2023, 6:19 PM
    This message was deleted.
    c
    y
    • 3
    • 2
  • y

    Yury Bushmelev

    04/17/2023, 6:20 PM
    though it’s well aligned with the idea of having the init.pp as the only entry point (interface) of the module
  • c

    Cam Chambers

    04/17/2023, 6:51 PM
    Appreciate it everyone!
  • s

    Slackbot

    04/17/2023, 7:12 PM
    This message was deleted.
    y
    r
    • 3
    • 4
  • s

    Slackbot

    04/18/2023, 4:55 AM
    This message was deleted.
    b
    j
    +3
    • 6
    • 50
1...348349350...428Latest