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

    AngeloMileto

    07/08/2022, 3:42 PM
    I'm having a problem with my agent running not being able to backup the changed files to the archive server which is set as the master. It is only one host as I have 9 other agents connected to this server and they all work perfectly fine being able to archive the files just fine. I tried to manually change the archive_files = false in the puppet.conf on this host but it doesn't seem to care about that as it still failed - unless the conf is changed before the agent run starts? So how can I either figure out what is causing it to fail - the log is no help - or how do I completely disable the archive just for this host?
  • a

    Argon Wade

    07/08/2022, 3:50 PM
    There an easy way to convert Puppet query json output to xml?
  • s

    Slackbot

    07/08/2022, 4:04 PM
    This message was deleted.
    a
    l
    • 3
    • 3
  • l

    Lumiere

    07/08/2022, 4:04 PM
    xml is awful
  • h

    Hugh Esco

    07/08/2022, 5:30 PM
    Back in the day when I ran NFS, I wrote a
    user::function::add_system_user
    defined type which depends on an
    ensure_resource ( user, ... )
    . It sets the gid to the $uid. Recent upgrades have created a conflict for the uid I set for my mysql user. As a work-around I have added to my hiera data a new key,
    user::application::mysql::fix_uid
    , with a boolean value. I had hoped that passing an undef to the
    uid =>
    attribute of the
    user
    resource would communicate to puppet that I want the underlying OS to sort out the uid for this user. Although this behavior is not documented, I hoped it would be worth a try. But now I am getting
    Parameter gid failed on Group[mysql]: Invalid GID
    . Any thoughts on how I might resolve this?
  • h

    Hugh Esco

    07/08/2022, 5:32 PM
    Back in the day when I ran NFS, I wrote a
    user::function::add_system_user
    defined type which depends on an
    ensure_resource ( user, ... )
    . It sets the gid to the $uid. Recent upgrades have created a conflict for the uid I set for my mysql user. As a work-around I have added to my hiera data a new key,
    user::application::mysql::fix_uid
    , with a boolean value. I had hoped that passing an undef to the
    uid =>
    attribute of the
    user
    resource would communicate to puppet that I want the underlying OS to sort out the uid for this user. But now I am getting
    Parameter gid failed on Group[mysql]: Invalid GID
    . Any thoughts on how I might resolve this?
  • h

    Hugh Esco

    07/08/2022, 5:34 PM
    Back in the day when I ran NFS, I wrote a
    user::function::add_system_user
    defined type which depends on an
    ensure_resource ( user, ... )
    . It sets the gid to the $uid. Recent upgrades have created a conflict for the uid I set for my mysql user. As a work-around I have added to my hiera data a new key,
    user::application::mysql::fix_uid
    , with a boolean value. I had hoped that passing an undef to the
    uid =>
    attribute of the
    user
    resource would communicate to puppet that I want the underlying OS to sort out the uid for this user (although this behavior is not documented, but I thought it would be worth a try). But now I am getting
    Parameter gid failed on Group[mysql]: Invalid GID
    . Any thoughts on how I might resolve this?
  • h

    Hugh Esco

    07/08/2022, 5:34 PM
    Back in the day when I ran NFS, I wrote a
    user::function::add_system_user
    defined type which depends on an
    ensure_resource ( user, ... )
    . It sets the gid to the $uid. Recent upgrades have created a conflict for the uid I set for my mysql user. As a work-around I have added to my hiera data a new key,
    user::application::mysql::fix_uid
    , with a boolean value. I had hoped that passing an undef to the
    uid =>
    attribute of the
    user
    resource would communicate to puppet that I want the underlying OS to sort out the uid for this user. Although this behavior is not documented, I hoped it would be worth a try. But now I am getting
    Parameter gid failed on Group[mysql]: Invalid GID
    . Any thoughts on how I might resolve this?
  • s

    Slackbot

    07/08/2022, 5:36 PM
    This message was deleted.
    h
    v
    • 3
    • 9
  • h

    Hugh Esco

    07/08/2022, 5:40 PM
    I have a wrapper class between hiera and the defined type which is performing the
    lookup
    . And yes, it uses an explicit call to that
    lookup
    function.
  • s

    Slackbot

    07/08/2022, 6:55 PM
    This message was deleted.
    b
    • 2
    • 2
  • l

    Lumiere

    07/08/2022, 7:08 PM
    it's currently not public, they're still working on the algorithm before making the metrics public I believe @binford2k
    💯 1
  • s

    Slackbot

    07/10/2022, 8:24 PM
    This message was deleted.
    h
    y
    l
    • 4
    • 26
  • y

    Yehuda Katz

    07/10/2022, 8:24 PM
    Is there a simple way to include a class in a manifest as if it were just code in the same file? We have a firewall wrapper that uses the correct module based on what firewall we want to use for a particular system:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      case $provider {
        'iptables': {
          if ($ipv4) {
            $networks_v4.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} (${ruleset}-${_order}) ${comment} from ${src['name']}":
                source => $src['network'],
                *      => $rule,
              }
            }
          }
          if ($ipv6) {
            $networks_v6.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} IPv6 (${ruleset}-${_order}) ${comment} from ${src['name']}":
                provider => 'ip6tables',
                source   => $src['network'],
                *        => $rule,
              }
            }
          }
        }
    
        'firewalld': {
          ...
        }
        'firewall_cmd': {
          ...
        }
        'csf': {
          ...
        }
        default: {
          fail("Unsupported fw provider '${provider}'")
        }
      }
    }
    To keep this file maintainable, I would love to do something like this:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      include "fw::${provider}::rules"
    }
    Is there a way to have the included class automatically have access to all the current variables?
  • y

    Yehuda Katz

    07/10/2022, 8:41 PM
    Is there a simple way to include a class in a manifest as if it were just code in the same file? We have a firewall wrapper that uses the correct module based on what firewall we want to use for a particular system:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      case $provider {
        'iptables': {
          if ($ipv4) {
            $networks_v4.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} (${ruleset}-${_order}) ${comment} from ${src['name']}":
                source => $src['network'],
                *      => $rule,
              }
            }
          }
          if ($ipv6) {
            $networks_v6.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} IPv6 (${ruleset}-${_order}) ${comment} from ${src['name']}":
                provider => 'ip6tables',
                source   => $src['network'],
                *        => $rule,
              }
            }
          }
        }
    
        'firewalld': {
          ...
        }
        'firewall_cmd': {
          ...
        }
        'csf': {
          ...
        }
        default: {
          fail("Unsupported fw provider '${provider}'")
        }
      }
    }
    To keep this file maintainable, I would love to do something like this:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      include "fw::${provider}::rules"
    }
    Is there a way to have the included class automatically have access to all the current variables? I tried this exact code and it didn't seem to actually do anything.
  • y

    Yehuda Katz

    07/10/2022, 8:49 PM
    Is there a simple way to include a class in a manifest as if it were just code in the same file? We have a firewall wrapper that uses the correct module based on what firewall we want to use for a particular system:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      case $provider {
        'iptables': {
          if ($ipv4) {
            $networks_v4.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} (${ruleset}-${_order}) ${comment} from ${src['name']}":
                source => $src['network'],
                *      => $rule,
              }
            }
          }
          if ($ipv6) {
            $networks_v6.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} IPv6 (${ruleset}-${_order}) ${comment} from ${src['name']}":
                provider => 'ip6tables',
                source   => $src['network'],
                *        => $rule,
              }
            }
          }
        }
    
        'firewalld': {
          ...
        }
        'firewall_cmd': {
          ...
        }
        'csf': {
          ...
        }
        default: {
          fail("Unsupported fw provider '${provider}'")
        }
      }
    }
    To keep this file maintainable, I would love to do something like this:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      include "fw::${provider}::rules"
    }
    Is there a way to have the included class automatically have access to all the current variables? I tried this exact code and it didn't seem to actually do anything. The example in the documentation (https://puppet.com/docs/puppet/7/lang_scope.html#lang_scope-local-scopes) makes it seem like it should work, but adding debug statements shows the variables are undefined.
  • y

    Yehuda Katz

    07/10/2022, 9:10 PM
    Is there a simple way to include a class in a manifest as if it were just code in the same file? We have a firewall wrapper that uses the correct module based on what firewall we want to use for a particular system:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      case $provider {
        'iptables': {
          if ($ipv4) {
            $networks_v4.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} (${ruleset}-${_order}) ${comment} from ${src['name']}":
                source => $src['network'],
                *      => $rule,
              }
            }
          }
          if ($ipv6) {
            $networks_v6.each |Integer $index, Hash[String, Optional[String]] $src| {
              $_order = String.new($index, '%02d')
              firewall{"${_priority} IPv6 (${ruleset}-${_order}) ${comment} from ${src['name']}":
                provider => 'ip6tables',
                source   => $src['network'],
                *        => $rule,
              }
            }
          }
        }
    
        'firewalld': {
          ...
        }
        'firewall_cmd': {
          ...
        }
        'csf': {
          ...
        }
        default: {
          fail("Unsupported fw provider '${provider}'")
        }
      }
    }
    To keep this file maintainable, I would love to do something like this:
    Copy code
    define fw::rules (
      String $ruleset,
      Hash $rule,
      String[1] $comment           = $title,
      Optional[Integer] $priority  = undef,
      Boolean $ipv4                = true,
      Boolean $ipv6                = false,
      String[1] $provider          = lookup('fw::provider'),
      Array[Hash] $networks_v4     = lookup("fw::rules::${ruleset}::networks_v4"),
      Array[Hash] $networks_v6     = lookup("fw::rules::${ruleset}::networks_v6"),
    ) {
      if (! $priority ) {
        case $rule['action'] {
          'accept': {
            $_priority = 400
          }
          'reject': {
            $_priority = 300
          }
          default: {
            $_priority = 900
          }
        }
      } else {
        $_priority = $priority
      }
    
      include "fw::${provider}::rules"
    }
    Is there a way to have the included class automatically have access to all the current variables? I tried this exact code and it didn't seem to actually do anything. The example in the documentation (https://puppet.com/docs/puppet/7/lang_scope.html#lang_scope-local-scopes) makes it seem like it should work, but adding debug statements shows the variables are undefined. I really don't want to end up doing something like this:
    Copy code
    case $provider {
        'iptables': {
          fw::iptables::rules { $title:
            ruleset     => $ruleset,
            rule        => $rule,
            comment     => $comment,
            priority    => $priority,
            ipv4        => $ipv4,
            ipv6        => $ipv6,
            provider    => $provider,
            networks_v4 => $networks_v4,
            networks_v6 => $networks_v6,
          }
        }
    
        'firewall_cmd': {
    ...
  • y

    Yehuda Katz

    07/10/2022, 10:43 PM
    message has been deleted
  • s

    Slackbot

    07/11/2022, 1:55 AM
    This message was deleted.
    n
    s
    • 3
    • 16
  • n

    n3snah

    07/11/2022, 2:35 AM
    what is the output of this
    puppet config print |grep report
    Specifically you should have
    Copy code
    report = true
    report_server = <fqdn of puppet server>
  • s

    Slackbot

    07/11/2022, 4:01 AM
    This message was deleted.
    y
    n
    • 3
    • 6
  • n

    n3snah

    07/11/2022, 4:18 AM
    Sorry, I don't think I made my question clear. I need to call a defined resource from a module but when my onceover runs, it can't find the class
    sshkey
    because its a defined type in module. So my question is, in Onceover should I be mocking/stubbing them or is there a way I can include the defined types from the module in question?
  • s

    Serin Abraham

    07/11/2022, 4:47 AM
    this what I get, don't have the fqdn
  • s

    Slackbot

    07/11/2022, 11:57 AM
    This message was deleted.
    t
    m
    b
    • 4
    • 8
  • s

    Slackbot

    07/11/2022, 1:38 PM
    This message was deleted.
    y
    s
    +2
    • 5
    • 8
  • y

    Yorokobi

    07/11/2022, 1:43 PM
    Oh. Debian. Looks like a cron job.
  • s

    Slackbot

    07/11/2022, 4:50 PM
    This message was deleted.
    m
    v
    • 3
    • 2
  • a

    AngeloMileto

    07/11/2022, 5:07 PM
    Could someone point me in a direction to solve a problem with my an agent not being able to backup the changed files to the archive server. The puppet.conf is configured properly and I have 10 other hosts on this server that work perfectly fine. The only unique distinction on these two hosts/agents is that they are FIPS enabled. One is running agent v6.22.1 and the other is v6.27.1. I tried to manually change the archive_files = false in the puppet.conf on this host but it doesn't seem to care about that as it still failed? So how can I either figure out what is causing it to fail - the log is no help - or how do I completely disable the archive just for this group/class of hosts?
  • s

    Slackbot

    07/11/2022, 5:39 PM
    This message was deleted.
    v
    l
    +3
    • 6
    • 12
  • s

    Slackbot

    07/11/2022, 6:37 PM
    This message was deleted.
    m
    • 2
    • 1
1...929394...428Latest