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

    William Myers

    10/18/2022, 10:19 PM
    For a control repo, is it better to have two distinct repos for production and development or just different braches, which would make rebasing easier?
  • s

    Slackbot

    10/18/2022, 10:20 PM
    This message was deleted.
    c
    d
    v
    • 4
    • 4
  • l

    Lumiere

    10/18/2022, 10:25 PM
    if you do one repo, you very very carefully need to design the PR/merge systems to prevent splitbrain of the branches
  • l

    Lumiere

    10/18/2022, 10:25 PM
    honestly, we actually do something very different, we only have a main branch, and we have separate puppetmasters per tier
  • s

    Slackbot

    10/18/2022, 10:26 PM
    This message was deleted.
    s
    l
    • 3
    • 2
  • w

    William Myers

    10/19/2022, 12:34 AM
    message has been deleted
  • w

    William Myers

    10/19/2022, 2:15 AM
    restructured some stuff and got r10k set up, quite nice it is.
  • w

    William Myers

    10/19/2022, 2:19 AM
    Do people usually setup r10k to run on a gitlab-runner trigger or on a scheduled basis via CRON ?
  • s

    smortex

    10/19/2022, 2:52 AM
    use a post-receive hook
  • w

    William Myers

    10/19/2022, 3:04 AM
    Can that be applied at the group level, E. G. whenever something lands in the "main" branch of one of the child repos it triggers r10k
  • w

    William Myers

    10/19/2022, 3:04 AM
    Can that be applied at the group level, E. G. whenever something lands in the "main" branch of one of the child repos it triggers r10k
  • s

    Slackbot

    10/19/2022, 8:53 AM
    This message was deleted.
    s
    • 2
    • 1
  • b

    bastelfreak

    10/19/2022, 8:58 AM
    we always use rspec-puppet for unit tests and beaker with serverspec for acceptancetests/integrationtests
    👍 4
    âž• 1
  • v

    vchepkov

    10/19/2022, 1:11 PM
    @CVQuesty, I meant branches of the same code in the same repo
  • u

    Ugo Bellavance

    10/19/2022, 3:22 PM
    What you are talking about - reusing PowerCLI scripts - is not possible with Ansible?
  • j

    jhoblitt

    10/19/2022, 4:36 PM
    generally, rspec-beaker / serverspec tests are more definitive that rspec-puppet. If beaker tests pass, you probably have a working manifest. The same can not be said for rspec-puppet... is is very easy to have working unit tests but the code won't work on a live system. However, it usually isn't practical to test everything with beaker if you want the CI run to finish the same business day.
  • j

    jhoblitt

    10/19/2022, 4:37 PM
    generally, rspec-beaker / serverspec tests are more definitive that rspec-puppet. If beaker tests pass, you probably have a working manifest. The same can not be said for rspec-puppet... is is very easy to have working unit tests but the code won't work on a live system. However, it usually isn't practical to test everything with beaker if you want the CI run to finish the same business day.
  • s

    Slackbot

    10/19/2022, 5:38 PM
    This message was deleted.
    c
    j
    • 3
    • 2
  • j

    Jordan Mueller

    10/19/2022, 5:39 PM
    Above is Linux example. I’m not too savvy with windows
  • w

    William Myers

    10/19/2022, 11:00 PM
    Would what I did within this module/class normally be done with a combination of the environment level common.yaml to set defaults and hiera for exceptions?
    Copy code
    # @summary A short summary of the purpose of this class
    #
    # Configures the sshd service for my homelab
    # Requires the ssh module from puppet forge
    # <https://forge.puppet.com/modules/saz/ssh>
    #
    # @example
    #   include sshd_config::configure_sshd
    class config_sshd (
      String $ssh_protocol,
      String $ssh_Port,
      String $ssh_PasswordAuthentication,
      String $ssh_PermitRootLogin,
      String $ssh_ChallengeResponseAuthentication,
      String $ssh_ChrootDirectory,
      String $ssh_UsePAM,
      String $ssh_AllowTcpForwarding,
      String $ssh_X11Forwarding,
      String $ssh_LoginGraceTime,
      String $ssh_MaxAuthTries,
      String $ssh_MaxSessions,
      String $ssh_MaxStartups,
      String $ssh_KexAlgorithms,
      String $ssh_ciphers,
      String $ssh_PrintMotd,
      # String $ssh_Include,
      ) {
    
      if $::osfamily =~ /^(Debian|RedHat)$/ {
       
        # load the ssh module 
        class { 'ssh':
          storeconfigs_enabled => false,
          server_options => {
            'protocol'                        => $config_sshd::ssh_protocol,
            'Port'                            => $config_sshd::ssh_Port,
            'PasswordAuthentication'          => $config_sshd::ssh_PasswordAuthentication,
            'PermitRootLogin'                 => $config_sshd::ssh_PermitRootLogin,
            'ChallengeResponseAuthentication' => $config_sshd::ssh_ChallengeResponseAuthentication,
            # 'ChrootDirectory'                 => $config_sshd::ssh_ChrootDirectory,
            'UsePAM'                          => $config_sshd::ssh_UsePAM,
            'AllowTcpForwarding'              => $config_sshd::ssh_AllowTcpForwarding,
            'X11Forwarding'                   => $config_sshd::ssh_X11Forwarding,
            'LoginGraceTime'                  => $config_sshd::ssh_LoginGraceTime,
            'MaxAuthTries'                    => $config_sshd::ssh_MaxAuthTries,
            'MaxSessions'                     => $config_sshd::ssh_MaxSessions,
            'MaxStartups'                     => $config_sshd::ssh_MaxStartups,
            'KexAlgorithms'                   => $config_sshd::ssh_KexAlgorithms,
            'ciphers'                         => $config_sshd::ssh_ciphers,
            'PrintMotd'                       => $config_sshd::ssh_PrintMotd,
            # 'Include'                         => $config_sshd::ssh_Include,
          },
        }
      }
    }
  • w

    William Myers

    10/19/2022, 11:01 PM
    Would what I did within this module/class normally be done with a combination of the environment level common.yaml to set defaults and hiera for exceptions?
    Copy code
    # @summary A short summary of the purpose of this class
    #
    # Configures the sshd service for my homelab
    # Requires the ssh module from puppet forge
    # <https://forge.puppet.com/modules/saz/ssh>
    #
    # @example
    #   include sshd_config::configure_sshd
    class config_sshd (
      String $ssh_protocol,
      String $ssh_Port,
      String $ssh_PasswordAuthentication,
      String $ssh_PermitRootLogin,
      String $ssh_ChallengeResponseAuthentication,
      String $ssh_ChrootDirectory,
      String $ssh_UsePAM,
      String $ssh_AllowTcpForwarding,
      String $ssh_X11Forwarding,
      String $ssh_LoginGraceTime,
      String $ssh_MaxAuthTries,
      String $ssh_MaxSessions,
      String $ssh_MaxStartups,
      String $ssh_KexAlgorithms,
      String $ssh_ciphers,
      String $ssh_PrintMotd,
      # String $ssh_Include,
      ) {
    
      if $::osfamily =~ /^(Debian|RedHat)$/ {
       
        # load the ssh module 
        class { 'ssh':
          storeconfigs_enabled => false,
          server_options => {
            'protocol'                        => $config_sshd::ssh_protocol,
            'Port'                            => $config_sshd::ssh_Port,
            'PasswordAuthentication'          => $config_sshd::ssh_PasswordAuthentication,
            'PermitRootLogin'                 => $config_sshd::ssh_PermitRootLogin,
            'ChallengeResponseAuthentication' => $config_sshd::ssh_ChallengeResponseAuthentication,
            # 'ChrootDirectory'                 => $config_sshd::ssh_ChrootDirectory,
            'UsePAM'                          => $config_sshd::ssh_UsePAM,
            'AllowTcpForwarding'              => $config_sshd::ssh_AllowTcpForwarding,
            'X11Forwarding'                   => $config_sshd::ssh_X11Forwarding,
            'LoginGraceTime'                  => $config_sshd::ssh_LoginGraceTime,
            'MaxAuthTries'                    => $config_sshd::ssh_MaxAuthTries,
            'MaxSessions'                     => $config_sshd::ssh_MaxSessions,
            'MaxStartups'                     => $config_sshd::ssh_MaxStartups,
            'KexAlgorithms'                   => $config_sshd::ssh_KexAlgorithms,
            'ciphers'                         => $config_sshd::ssh_ciphers,
            'PrintMotd'                       => $config_sshd::ssh_PrintMotd,
            # 'Include'                         => $config_sshd::ssh_Include,
          },
        }
      }
    }
  • k

    kenyon

    10/19/2022, 11:05 PM
    yeah we just do
    include ssh
    (via a list of classes in hiera) and set
    ssh::server_options
    in
    common.yaml
  • s

    Slackbot

    10/19/2022, 11:06 PM
    This message was deleted.
    w
    k
    • 3
    • 3
  • w

    William Myers

    10/19/2022, 11:07 PM
    could you show me an example of what a hiera config file for a node looks like, I've not done a module/class include in that way before.
  • w

    William Myers

    10/19/2022, 11:08 PM
    could you show me an example of what a hiera config file for a node looks like, I've not done a module/class include in that way before.
  • s

    Slackbot

    10/19/2022, 11:09 PM
    This message was deleted.
    c
    w
    • 3
    • 5
  • s

    Slackbot

    10/20/2022, 12:06 AM
    This message was deleted.
    w
    g
    • 3
    • 6
  • s

    Slackbot

    10/20/2022, 4:05 AM
    This message was deleted.
    👍 5
    sadpanda 3
    s
    c
    • 3
    • 3
  • s

    Slackbot

    10/20/2022, 12:12 PM
    This message was deleted.
    👍 2
    s
    • 2
    • 2
  • c

    CVQuesty

    10/20/2022, 1:32 PM
    Ah, ok. Thanks Jeremy.
1...205206207...428Latest