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

    Lumiere

    04/19/2023, 3:11 PM
    https://github.com/voxpupuli/puppet-python/blob/448fcab139900bbb47ac000aa7c211b3f39104b3/manifests/install.pp#L209-L213
  • s

    Slackbot

    04/19/2023, 8:02 PM
    This message was deleted.
    y
    n
    n
    • 4
    • 4
  • d

    Dr Bunsen Honeydew

    04/19/2023, 8:02 PM
    See the
    puppet-r10k
    module at https://forge.puppet.com/puppet/r10k?src=slack&channel=puppet
  • s

    Slackbot

    04/19/2023, 8:04 PM
    This message was deleted.
    n
    n
    c
    • 4
    • 9
  • m

    Massimiliano (Max)

    04/19/2023, 8:59 PM
    It's my first time using a deferred function and the outcome is not the intended. 1. I have this function, to check that all the paths in an array exist on the system:
    Copy code
    Puppet::Functions.create_function(:'xxx_nomad::array_is_path') do
      dispatch :check_paths do
        param 'Variant[Array[0, 0], Array[Stdlib::Absolutepath]]', :volume_paths
        return_type 'Variant[Array[0, 0], Array[Stdlib::Absolutepath]]'
      end
    
      def check_paths(volume_paths)
        status_array = []
        volume_paths.each do |path|
          status_array.push = path unless File.directory?(path) || File.file?(path)
        end
        status_array
      end
    end
    2. I assign the function to a variable:
    Copy code
    $test_paths = Deferred('xxx_nomad::array_is_path', $host_volume_paths)
    I'm not getting the value returned by the function, and instead I'm getting the string that I use to call the function 3. I've also tried with
    raise ArgumentError
    which works if I run a server side function, but it doesn't work if I use the
    deferred
    function.
  • m

    Massimiliano (Max)

    04/19/2023, 9:26 PM
    maybe I understand. I created a "notify" resource to print the output of the function. The resource title is created when the catalog is compiled, but when the catalog is compiled, the output of the function is not yet known, because the function it's deferred, Does this make sense? 🤯
  • m

    Massimiliano (Max)

    04/19/2023, 9:30 PM
    so, how would you check if a bunch of directories (that I lookup in hiera) exist on the server, before applying the configuration? Namely, Nomad fails to start if one of these directory is missing and I need to avoid that human errors will bring the cluster down
  • s

    Slackbot

    04/19/2023, 9:57 PM
    This message was deleted.
    n
    • 2
    • 1
  • n

    natemccurdy

    04/19/2023, 9:58 PM
    If you need to introspect the state of the agent and use that information to affect the catalog, you need to write a custom fact. Facts run and are evaluated before the catalog is compiled, so they can be used to affect the catalog. But you can't look those directories up from Hiera because Hiera data isn't available to facts.
  • s

    Slackbot

    04/19/2023, 10:00 PM
    This message was deleted.
    m
    n
    d
    • 4
    • 10
  • j

    jhoblitt

    04/19/2023, 10:03 PM
    So this isn't really a puppet question... but I am working on managing NM keyfiles with puppet. Does anyone know if a physical ethernet interface which is being used as a trunk interface, that is it has no addresses assigned to it, but it is configured as the parent interface of a vlan interface should be autoconnect=false or autoconnect=true (the default)?
  • s

    Slackbot

    04/19/2023, 10:05 PM
    This message was deleted.
    m
    j
    • 3
    • 10
  • s

    Slackbot

    04/20/2023, 12:35 AM
    This message was deleted.
    j
    • 2
    • 1
  • s

    smortex

    04/20/2023, 1:14 AM
    Looks like the puppetserver already has a (revoked) certificate for this node. On the puppetserver:
    puppetserver ca clean --certname <http://host1.domain.com|host1.domain.com>
  • s

    smortex

    04/20/2023, 1:16 AM
    See https://www.puppet.com/docs/puppet/7/server/subcommands.html#ca for more info on the ca command
  • n

    Navester

    04/20/2023, 7:54 AM
    Hi All, I have puppet module and getting an error cannot reassign a variable .how can I fix this Template: Xms=<% @xms %> Manifest: Class jboss ::dce( $xms= ${ramhalf}
  • n

    Navester

    04/20/2023, 7:57 AM
    ) } $ramhalf = $ram/2 $xms = $ramhalf Hiera: Jboss:dcexms '1'
  • b

    bastelfreak

    04/20/2023, 7:58 AM
    can you put the code into code blocks so it's more readable?
  • n

    Navester

    04/20/2023, 8:15 AM
    @bastelfreak can you please check above
  • b

    bastelfreak

    04/20/2023, 8:16 AM
    you reassign
    $xms
    and
    $xmx
  • n

    Navester

    04/20/2023, 8:24 AM
    Yes .How can I fix it
  • n

    Navester

    04/20/2023, 8:24 AM
    As I need to overwrite xms value in hiera and if the value is not defined in hiera i need it to pick based on half of the ram
  • b

    bastelfreak

    04/20/2023, 8:25 AM
    assign the default value in the parameter block
    this2 1
  • b

    bastelfreak

    04/20/2023, 8:26 AM
    and your code uses
    $ramhalf
    in line 4 and 5 but that variable isn't present at that time
  • n

    Navester

    04/20/2023, 8:32 AM
    So you mean to keep ( $xms = 5 $xmx = 7 )
  • n

    Navester

    04/20/2023, 8:33 AM
    Any default value ?sorry I'm bit new to puppet
  • b

    bastelfreak

    04/20/2023, 8:33 AM
    the logic you have in link 7/8 can directly be used in line 4/5
  • n

    Navester

    04/20/2023, 8:35 AM
    Okay .so add those like to calculate Ram and heap i need to define inside parameter block directly
  • b

    bastelfreak

    04/20/2023, 8:35 AM
    yes, that would work
    ❤️ 1
1...350351352...428Latest