title: Add a custom sudoers in Puppet
body: <p>I'm new to Puppet and have downloaded <a href="https://forge.puppet.com/modules/qtechnologies/central_auth" rel="nofollow noreferrer">central_auth</a> module in forge to implement AD login on Linux (CentOS) servers. After some tweaking, I finally got AD login to work. What I'm trying to do now is add a custom sudoers file in /etc/sudoers.d based on the value in the node's yaml file. The issue: /etc/sudoers.d/customsudo gets created but the contents are not correct.</p>
  <p>Here are my configs:</p>
  <p>in manifests/init.pp</p>
  <pre><code>class central_auth (
    # Class parameters are populated from External(hiera)/Defaults/Fail
    Boolean $manage_auth                = false,
    Boolean $enable_sssd                = true,
    Boolean $enable_pam_access          = false,
    Boolean $manage_pam_files           = true,
     
  ) {
  
  
  
    if $manage_auth {
      class { 'central_auth::install': }
      -&gt; class { 'central_auth::config': }
      -&gt; class { 'central_auth::pam': }
      -&gt; class { 'central_auth::join_ad': }
      -&gt; class { 'central_auth::service': }
      -&gt; class { 'central_auth::custom_sudoers': }
    }
  }
  </code></pre>
  <p>in manifests/custom_sudoers.pp</p>
  <pre><code>class central_auth::custom_sudoers (
    Any $sudoersgrp               = $central_auth::sudoersgrp,
  ) {
  
    if $sudoersgrp {
      file { '/etc/sudoers.d/customsudo':
        ensure  =&gt; present,
        owner   =&gt; 'root',
        group   =&gt; 'root',      
        mode    =&gt; '0644',
        content =&gt; template( 'central_auth/sudogroup.epp' ),
      }   } }
  </code></pre>
  <p>in templates/sudogroup.epp</p>
  <pre><code>%&lt;%= $sudoersgrp %&gt; ALL=(ALL) NOPASSWD: ALL
  </code></pre>
  <p>In the node's yaml file, I added these lines to call the central_auth class:</p>
  <pre><code>classes:
    - central_auth
  
  central_auth::manage_auth: true
  central_auth::enable_sssd: true
  central_auth::enable_pam_access: true
  central_auth::manage_pam_files: true
  central_auth::sudoersgrp: 'CustomSudoers'
  </code></pre>
  <p>In the client's /etc/sudoers.d/customsudo file that was created, it only appears like the below. I want 'CustomSudoers' to be passed on $sudoersgrp varible in manifests/custom_sudoers.pp which will create /etc/sudoers.d/customsudo file.</p>
  <p>What it should look like in /etc/sudoers.d/customsudo:</p>
  <pre><code>%CustomSudoers ALL=(ALL) NOPASSWD: ALL
  </code></pre>