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

    natemccurdy

    10/26/2022, 10:56 PM
    So that kind of thing is generally handled a common “base” profile or “common” profile that all nodes/roles get on them. And within that profile you can have conditional logic to apply more code based on operating system or other facts. For example:
    Copy code
    class profile::base {
    
      case $facts['os']['family'] {
        'RedHat', 'Debian' : { include profile::base::linux }
        'Windows': { include profile::base::windows }
        default: { }
      }
    
    }
    And to declare the
    profile::base
    class on all nodes, you could either explicitly add
    include profile::base
    to reach role class, or put
    include profile::base
    outside of a
    node
    definition or within the
    default
    node definition in
    site.pp
  • r

    ramindk

    10/26/2022, 11:00 PM
    Insert my lightly held soapbox opinion to use
    profile::std
    rather than
    profile::base
    . I've found it's clearer to consumers in that you're applying a standard set of packages, etc rather than applying a base which is usually viewed as less intrusive. ymmv. Bonus content, something like this is common IME.
    Copy code
    class profile::std {
    
      include "profile::$facts[os.family].downcase" # or whatever works
  • w

    William Myers

    10/26/2022, 11:05 PM
    Thanks! going to use profile::base for the moment
  • w

    William Myers

    10/26/2022, 11:08 PM
    is node default { } applied to all nodes or only those not explicitly defined?
  • n

    natemccurdy

    10/26/2022, 11:09 PM
    The latter. Only those that don’t have a node definition.
  • w

    William Myers

    10/26/2022, 11:09 PM
    Sweet, that allows me to clean things up a fair amount!
  • w

    William Myers

    10/26/2022, 11:46 PM
    I'm trying to figure out how to get an array value from hiera into a module. What's the term for how the $user_password key value is being extracted from hiera in this example?
    Copy code
    class account_svcansiblelocal (
        String $user_password
  • w

    William Myers

    10/26/2022, 11:47 PM
    I'm trying to move the SSH key values into my site level Hiera but it's fighting me some due to it being an array.
    Copy code
    account_svcansiblelocal::user_sshkeys:
      - '(somekey1)'
      - '(Somekey2)'
  • w

    William Myers

    10/26/2022, 11:47 PM
    I'm trying to move the SSH key values into my site level Hiera but it's fighting me some due to it being an array.
    Copy code
    account_svcansiblelocal::user_sshkeys:
      - '(somekey1)'
      - '(Somekey2)'
  • g

    glee

    10/26/2022, 11:47 PM
    if you're referring to automatic lookup of class parameters, it's usually called Automatic Parameter Lookup (APL) https://puppet.com/docs/puppet/7/hiera_automatic.html#class_parameters
  • g

    glee

    10/26/2022, 11:49 PM
    if an array is.a valid value for that param then the class signature should specify array as valid type for that parameter eg: Array[String] $user_sshkeys
  • w

    William Myers

    10/26/2022, 11:49 PM
    aaah
  • w

    William Myers

    10/26/2022, 11:51 PM
    Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Syntax error at 'Array' (file
  • g

    glee

    10/26/2022, 11:53 PM
    if you've added it after the $user_password parameter,make sure there's a comma after user_password/before the next param?? it's a bit hard to tell from error without seeing the code you're using to generate
  • w

    William Myers

    10/26/2022, 11:53 PM
    Copy code
    class account_svcansiblelocal (
        String $user_password  
        Array[String] $user_sshkeys
      ) {
  • w

    William Myers

    10/26/2022, 11:54 PM
    ahhh
  • w

    William Myers

    10/26/2022, 11:54 PM
    I had frgotten the comma
    👍 1
  • g

    glee

    10/26/2022, 11:55 PM
    it's usually considered good practice to have comma after all params in the class signature to avoid forgetting when adding new parameters, eg:
    Copy code
    class account_svcansiblelocal (
        String $user_password,
        Array[String] $user_sshkeys,
    ) {
    this 1
  • t

    Tamas Papp

    10/27/2022, 3:58 AM
    hi all, I have a problem, that I don't understand, why it happens
  • s

    Slackbot

    10/27/2022, 3:59 AM
    This message was deleted.
    t
    s
    • 3
    • 5
  • t

    Tamas Papp

    10/27/2022, 4:00 AM
    Copy code
    $file = '/dev/ipmi0'
      exec { "check_${file}_exist":
        command => '/bin/true',
        onlyif  => "/usr/bin/test -e ${file}",
      }
    
      package { [ 'ipmitool','freeipmi-tools' ]:
        ensure  => latest,
        require => Exec["check_${file}_exist"],
      }
  • t

    Tamas Papp

    10/27/2022, 4:00 AM
    Copy code
    $file = '/dev/ipmi0'
      exec { "check_${file}_exist":
        command => '/bin/true',
        onlyif  => "/usr/bin/test -e ${file}",
      }
    
      package { [ 'ipmitool','freeipmi-tools' ]:
        ensure  => latest,
        require => Exec["check_${file}_exist"],
      }
    And this is the related debug output:
    Copy code
    Debug: Exec[check_/dev/ipmi0_exist](provider=posix): Executing check '/usr/bin/test -e /dev/ipmi0'
    Debug: Executing: '/usr/bin/test -e /dev/ipmi0'
    Debug: /Stage[main]/Pts_ipmi/Exec[check_/dev/ipmi0_exist]: '/bin/true' won't be executed because of failed check 'onlyif'
    Debug: Executing: '/usr/bin/apt-cache policy ipmitool'
  • s

    sameer

    10/27/2022, 7:42 AM
    Can someone please explain what is the problem and how can this be fixed......The /etc/apt/sources.list.d/proxysql_repo.list is updated with the link but still proxy doesn't install
  • s

    Slackbot

    10/27/2022, 7:48 AM
    This message was deleted.
    z
    • 2
    • 1
  • s

    Slackbot

    10/27/2022, 10:31 AM
    This message was deleted.
    f
    n
    +2
    • 5
    • 17
  • f

    fe80

    10/27/2022, 11:37 AM
    Yes, that depends of your jruby release. I use only tls1.2 and 1.3 in my stack
  • r

    Robert FD

    10/27/2022, 11:43 AM
    Is anyone else having issues with the
    puppetlabs-mysql
    module's switch to mariaDB when you have an existing installation of mysql? I reported the issue that I am experiencing here.
  • d

    Dr Bunsen Honeydew

    10/27/2022, 11:43 AM
    See the
    puppetlabs-mysql
    module at https://forge.puppet.com/puppetlabs/mysql?src=slack&channel=puppet
  • r

    Robert FD

    10/27/2022, 11:43 AM
    Is anyone else having issues with the
    puppetlabs-mysql
    module's switch to mariaDB when you have an existing installation of mysql? I reported the issue that I am experiencing here.
  • s

    Slackbot

    10/27/2022, 12:09 PM
    This message was deleted.
    r
    m
    +4
    • 7
    • 28
1...218219220...428Latest