https://www.puppet.com/community logo
Join SlackCommunities
Powered by
# puppet-enterprise
  • h

    helindbe

    07/10/2023, 9:39 AM
    Here is an alternative
  • h

    helindbe

    07/10/2023, 9:39 AM
    https://github.com/hlindberg/tahu/blob/master/lib/puppet/functions/tahu/signature.rb
  • h

    helindbe

    07/10/2023, 9:40 AM
    It returns the type signature of things. If asked for a function that does not exist it returns nil/undef.
  • b

    bastelfreak

    07/10/2023, 9:40 AM
    neat
  • h

    helindbe

    07/10/2023, 9:43 AM
    basically, this is what "is function available" is:
    Copy code
    # signature of a function
        loaders = scope.compiler.loaders
        loader = loaders.private_environment_loader
        if loader && func = loader.load(:function, val)
          function_instance_signature(scope, func)
        else
          return nil # no such function
        end
    ... just return true or false
    👍 1
  • h

    helindbe

    07/10/2023, 9:54 AM
    If you don't want to write a new function and add to stdlib, that could possibly be made to work in an inline ERB template.
  • b

    bastelfreak

    07/10/2023, 9:54 AM
    @helindbe https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/657/files#diff-8851067a4edcb1091a43007647750925aba241b000ac32a011f3b874a38a1858R240 can you tell me if that's correct/enough to simulate the type?
    👀 1
  • h

    helindbe

    07/10/2023, 9:57 AM
    oh, you mean the testing part... not sure about that, sorry
  • v

    vchepkov

    07/10/2023, 11:36 AM
    I have been using another function that was deleted from a puppetlabs module, would be useful to have something "standard".
    Copy code
    Puppet::Functions.create_function(:is_classified_with) do
      dispatch :is_classified_with do
        param 'String', :str
      end
    
      def is_classified_with(str)
        closure_scope.find_global_scope.compiler.node.classes.keys.include?(str.to_s)
      end
    end
  • v

    vchepkov

    07/10/2023, 11:37 AM
    defined
    function doesn't work at all on PE classes, due to some trickery
  • v

    vchepkov

    07/10/2023, 11:38 AM
    and I do need to distinguish primary from replica
    Copy code
    unless is_classified_with('puppet_enterprise::profile::primary_master_replica') {
  • h

    helindbe

    07/10/2023, 11:46 AM
    Hm, difficult. Back to square one. Either new function or inline ERB.
  • b

    binford2k

    07/11/2023, 12:03 AM
    @glee++
    thankyou 1
  • d

    Dr Bunsen Honeydew

    07/11/2023, 12:03 AM
    grace.lee +1! (Karma: 2)
  • t

    Theodore Knab

    07/12/2023, 12:27 PM
    * You can move web configuration items from PE web into hiera YAML. Here is one example we use for setting up a wild card certificate. #Web Interface way: ref Directions for the console : https://www.puppet.com/docs/pe/2021.2/use_a_custom_ssl_cert_for_the_console.html #YAML way - This workeds hiera common.yaml or puppet-node.yaml:
    Copy code
    puppet_enterprise::profile::console::browser_ssl_cert:'/opt/puppetlabs/server/data/console-services/certs/public-console.cert.pem'
    puppet_enterprise::profile::console::browser_ssl_private_key:'/opt/puppetlabs/server/data/console-services/certs/public-console.private_key.pem'
  • t

    Theodore Knab

    07/12/2023, 6:30 PM
    I think I created a chicken and egg problem with my puppet server. How can I tell puppet that my system is using r10k without putting this info in the web interface ? I thought I would be smart but it appears I created a bit of a conundrum.
  • v

    vchepkov

    07/12/2023, 6:32 PM
    Not sure what you ask, but this tells to use code manager
    Copy code
    puppet_enterprise::profile::master::code_manager_auto_configure: true
  • t

    Theodore Knab

    07/12/2023, 6:35 PM
    Well I moved the variables that existed in the PE web interface to the Hiera. However, puppet doesn't know about hiera when you do that. Is the PE web interface the only way you can define these variables ?
  • t

    Theodore Knab

    07/12/2023, 6:36 PM
    Looking at puppet_enterprise:profilemastercode manager auto configure puppet_enterprise:profilemaster:r10k_private_key puppet_enterprise:profilemasterr10k remote puppet_enterprise:profilemasterreplication mode
  • v

    vchepkov

    07/12/2023, 6:37 PM
    nope, not the only way
  • v

    vchepkov

    07/12/2023, 6:38 PM
    you can add it in pe.conf too
  • v

    vchepkov

    07/12/2023, 6:38 PM
    Copy code
    /etc/puppetlabs/enterprise/conf.d/pe.conf
  • v

    vchepkov

    07/12/2023, 6:40 PM
    in fact, this is where peadm puts it
  • s

    Slackbot

    07/12/2023, 6:51 PM
    This message was deleted.
    b
    v
    • 3
    • 2
  • r

    Raj Parpani

    07/13/2023, 1:58 AM
    https://puppet.pacific.nxtravel.com:8170/code-manager/v1/webhook?type=gitlab&token=xxxxxxxxxxxxx
  • r

    Raj Parpani

    07/13/2023, 1:58 AM
    what should be the type if the repo is in azure devops
  • r

    Raj Parpani

    07/13/2023, 2:07 AM
    I tried azuredevops as type but still getting dns error when trying to test the webhook in azure
  • g

    glee

    07/13/2023, 2:24 AM
    @Raj Parpani "Previously known as Team Foundation Server (TFS), Azure DevOps Server is a set of collaborative software development tools, hosted on-premises [...]" (reference), so type would be
    tfs-git
    https://www.puppet.com/docs/pe/2021.7/code_mgr_webhook.html#code_manager_webhook_query_parameters
    • Team Foundation Server (resource version 1.0 is supported):
    type=tfs-git
  • r

    Raj Parpani

    07/13/2023, 2:45 AM
    Azure has Repos. That's where the repo is
  • g

    glee

    07/13/2023, 2:48 AM
    @Raj Parpani yes, and the repo type is
    tfs-git
    per the table in the documentation
1...596061...73Latest