Re: [Puppet Users] Mysqldump using puppet

2020-07-31 Thread Md Juyel Haque
okay Thank You

On Sat, Aug 1, 2020 at 3:17 AM Chris  wrote:

> You put the perl script and backup scripts in a module, and deploy as
> files.  In my case, they are part of a private module called bayhosting:
>
> file {
> "/var/local/backups/mysql":
>   ensure  => directory,
>   mode  =>  '0700',
>   owner  =>  'root',
>   group  =>  'root',
>   require => File['/var/local/backups'];
>
> "/opt/bin/MySQLBackup.pl":
>   source => "puppet:///modules/bayhosting/opt/bin/MySQLBackup.pl",
>   owner   => 'root',
>   group   => 'root',
>   mode=> '0555';
>
> "/root/backup.sh":
>   source => "puppet:///modules/bayhosting/root/backup.sh",
>   owner   => 'root',
>   group   => 'root',
>   mode=> '0555';
>  }
>
> And then you set up a cron job:
>
> cron {
> cron_mysqlbackup:
>   command  =>  "/root/backup.sh",
>   user  =>  root,
>   hour  => 0,
>   minute  => 0,
>   require =>
> File['/opt/bin/MySQLBackup.pl',"/var/local/backups/mysql",
> "/root/backup.sh"];
> }
>
> On Sat, Aug 1, 2020 at 9:31 AM Md Juyel Haque <
> haquemohammedju...@gmail.com> wrote:
>
>> if I write this code how will I run it from puppet
>>
>> On Sat, Aug 1, 2020 at 1:39 AM Chris  wrote:
>>
>>> I use this as my mysql backup script:
>>> https://github.com/ghstwhl/MySQLBackup
>>>
>>> It expects that the credentials for the database are in ~/.my.cnf for
>>> the user running the script.  If you are using puppetlabs/mysql to manage
>>> your mysql database then this is already set up for you and you just need
>>> to run your cron job as root.  Right now it assumes it is running on the DB
>>> server itself, but the ParseMyCnf function could be easily tweaked to
>>> read the server address from ~/.my.cnf if it exists and only default to
>>> localhost if a host isn't specified.
>>>
>>> It doesn't currently send emails on errors, but you can fork the repo
>>> and submit a PR and I'd be happy to merge.
>>>
>>>
>>> -Chris
>>>
>>> On Sat, Aug 1, 2020 at 5:17 AM Md Juyel Haque <
>>> haquemohammedju...@gmail.com> wrote:
>>>
 Please help me.I want to create  script database backup. This should
 be deployed with the puppet scripts on the Tomcat server.
 Errors from the dump should be noted and an email sent to particular
 email address in case of errors/failure.
 The script should also take the IP addresses from the Cloudformation
 template specified and SCP the backup to each of these servers.

 --
 You received this message because you are subscribed to the Google
 Groups "Puppet Users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Puppet Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to puppet-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/CAABnqB8rJDhgQFUrmGsnLTOuj6h15Q9ZaDjzBC%2BHJR%3DRi-8iLQ%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> Thanks & Regards,
>> Md Juyel Haque | Sr. DevOps Engineer
>> Phone No: 7047906982
>> Email: haquemohammedju...@gmail.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CAH_OGbb0g3aZkoQ%2BRvcph5am_JbER73H3sXwCz%2BS%2BW3k%3Dj_%2BFQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAABnqB-H3dhEx2bf0rL0iLgXSzqf0oi9prij_6S93bZqDO6D8g%40mail.gmail.com
> 
> .
>


-- 

Thanks & Regards,
Md Juyel Haque | Sr. DevOps Engineer
P

Re: [Puppet Users] Mysqldump using puppet

2020-07-31 Thread Chris
You put the perl script and backup scripts in a module, and deploy as
files.  In my case, they are part of a private module called bayhosting:

file {
"/var/local/backups/mysql":
  ensure  => directory,
  mode  =>  '0700',
  owner  =>  'root',
  group  =>  'root',
  require => File['/var/local/backups'];

"/opt/bin/MySQLBackup.pl":
  source => "puppet:///modules/bayhosting/opt/bin/MySQLBackup.pl",
  owner   => 'root',
  group   => 'root',
  mode=> '0555';

"/root/backup.sh":
  source => "puppet:///modules/bayhosting/root/backup.sh",
  owner   => 'root',
  group   => 'root',
  mode=> '0555';
 }

And then you set up a cron job:

cron {
cron_mysqlbackup:
  command  =>  "/root/backup.sh",
  user  =>  root,
  hour  => 0,
  minute  => 0,
  require => File['/opt/bin/MySQLBackup.pl',"/var/local/backups/mysql",
"/root/backup.sh"];
}

On Sat, Aug 1, 2020 at 9:31 AM Md Juyel Haque 
wrote:

> if I write this code how will I run it from puppet
>
> On Sat, Aug 1, 2020 at 1:39 AM Chris  wrote:
>
>> I use this as my mysql backup script:
>> https://github.com/ghstwhl/MySQLBackup
>>
>> It expects that the credentials for the database are in ~/.my.cnf for the
>> user running the script.  If you are using puppetlabs/mysql to manage your
>> mysql database then this is already set up for you and you just need to run
>> your cron job as root.  Right now it assumes it is running on the DB server
>> itself, but the ParseMyCnf function could be easily tweaked to read the
>> server address from ~/.my.cnf if it exists and only default to localhost if
>> a host isn't specified.
>>
>> It doesn't currently send emails on errors, but you can fork the repo and
>> submit a PR and I'd be happy to merge.
>>
>>
>> -Chris
>>
>> On Sat, Aug 1, 2020 at 5:17 AM Md Juyel Haque <
>> haquemohammedju...@gmail.com> wrote:
>>
>>> Please help me.I want to create  script database backup. This should be
>>> deployed with the puppet scripts on the Tomcat server.
>>> Errors from the dump should be noted and an email sent to particular
>>> email address in case of errors/failure.
>>> The script should also take the IP addresses from the Cloudformation
>>> template specified and SCP the backup to each of these servers.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Puppet Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to puppet-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CAABnqB8rJDhgQFUrmGsnLTOuj6h15Q9ZaDjzBC%2BHJR%3DRi-8iLQ%40mail.gmail.com
>> 
>> .
>>
>
>
> --
>
> Thanks & Regards,
> Md Juyel Haque | Sr. DevOps Engineer
> Phone No: 7047906982
> Email: haquemohammedju...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAH_OGbb0g3aZkoQ%2BRvcph5am_JbER73H3sXwCz%2BS%2BW3k%3Dj_%2BFQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAABnqB-H3dhEx2bf0rL0iLgXSzqf0oi9prij_6S93bZqDO6D8g%40mail.gmail.com.


Re: [Puppet Users] Mysqldump using puppet

2020-07-31 Thread Md Juyel Haque
if I write this code how will I run it from puppet

On Sat, Aug 1, 2020 at 1:39 AM Chris  wrote:

> I use this as my mysql backup script:
> https://github.com/ghstwhl/MySQLBackup
>
> It expects that the credentials for the database are in ~/.my.cnf for the
> user running the script.  If you are using puppetlabs/mysql to manage your
> mysql database then this is already set up for you and you just need to run
> your cron job as root.  Right now it assumes it is running on the DB server
> itself, but the ParseMyCnf function could be easily tweaked to read the
> server address from ~/.my.cnf if it exists and only default to localhost if
> a host isn't specified.
>
> It doesn't currently send emails on errors, but you can fork the repo and
> submit a PR and I'd be happy to merge.
>
>
> -Chris
>
> On Sat, Aug 1, 2020 at 5:17 AM Md Juyel Haque <
> haquemohammedju...@gmail.com> wrote:
>
>> Please help me.I want to create  script database backup. This should be
>> deployed with the puppet scripts on the Tomcat server.
>> Errors from the dump should be noted and an email sent to particular
>> email address in case of errors/failure.
>> The script should also take the IP addresses from the Cloudformation
>> template specified and SCP the backup to each of these servers.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAABnqB8rJDhgQFUrmGsnLTOuj6h15Q9ZaDjzBC%2BHJR%3DRi-8iLQ%40mail.gmail.com
> 
> .
>


-- 

Thanks & Regards,
Md Juyel Haque | Sr. DevOps Engineer
Phone No: 7047906982
Email: haquemohammedju...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAH_OGbb0g3aZkoQ%2BRvcph5am_JbER73H3sXwCz%2BS%2BW3k%3Dj_%2BFQ%40mail.gmail.com.


Re: [Puppet Users] Mysqldump using puppet

2020-07-31 Thread Chris
I use this as my mysql backup script:
https://github.com/ghstwhl/MySQLBackup

It expects that the credentials for the database are in ~/.my.cnf for the
user running the script.  If you are using puppetlabs/mysql to manage your
mysql database then this is already set up for you and you just need to run
your cron job as root.  Right now it assumes it is running on the DB server
itself, but the ParseMyCnf function could be easily tweaked to read the
server address from ~/.my.cnf if it exists and only default to localhost if
a host isn't specified.

It doesn't currently send emails on errors, but you can fork the repo and
submit a PR and I'd be happy to merge.


-Chris

On Sat, Aug 1, 2020 at 5:17 AM Md Juyel Haque 
wrote:

> Please help me.I want to create  script database backup. This should be
> deployed with the puppet scripts on the Tomcat server.
> Errors from the dump should be noted and an email sent to particular
> email address in case of errors/failure.
> The script should also take the IP addresses from the Cloudformation
> template specified and SCP the backup to each of these servers.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAABnqB8rJDhgQFUrmGsnLTOuj6h15Q9ZaDjzBC%2BHJR%3DRi-8iLQ%40mail.gmail.com.


Re: [Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread Henrik Lindberg

On 2020-07-31 19:41, A Manzer wrote:

Did you update site.pp to use the include syntax?


That is not needed to make automatic parameter lookup to work.

- henrik

--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/rg1oi3%247sk%241%40ciao.gmane.io.


[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread A Manzer
Did you update site.pp to use the include syntax?

I looked at the error again, because I'm really not sure why it's working 
(other than the fact that you've mixed patterns, and seriously 
over-complicated your code). So here's your error, right?
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
Server Error: Evaluation Error: Error while evaluating a Resource 
Statement, Class[Permitroot]: expects a value for parameter 
'permitroot_config' (file: 
/etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
column: 3) on node lhcsrvprdcms01.fixnetix.com

Is it still more or less that?
Notice that the error is in the site.pp file, not your init.pp or 
config.pp.  It could be that since you're using the resource-like syntax, 
Puppet is expecting you to set that parameter, and isn't using Hiera.  
According to the hiera docs 
, it looks like 
it should still be looking things up?  But I know that in my own code, I 
always use include, or specify all my parameters when I'm forced to use the 
resource-like syntax.

On Friday, July 31, 2020 at 1:09:30 PM UTC-4 djc...@gmail.com wrote:

> Don't think it's a hiera issue now:
>
> # puppet lookup permitroot::permitroot_config --node 
> lhcsrvprdcms01.fixnetix.com
> ---
> - Match Address xx.xx.xx.xx
> - PermitRootLogin without-password
>
> # pwd
> /etc/puppetlabs/code/environments/production/data/nodes
>
> # cat *
> permitroot::permitroot_config:
>   - 'Match Address 10.20.232.21'
>   - 'PermitRootLogin without-password'
>
> Still no joy though.
>
> On Friday, July 31, 2020 at 4:47:40 PM UTC+1, A Manzer wrote:
>>
>> puppet lookup is a good diagnostic tool.
>>
>> Now though, you have a naming issue.  You need the permitroot:: prefix if 
>> you want Puppet/Hiera to automatically fill in your parameter.
>>
>> So your puppet lookup debug command should be puppet lookup 
>> permitroot::permitroot_config --explain --node 
>> lhcsrvprdcms01.fixnetix.com
>>
>> Once *that* works, your module should work too.
>>
>> Does any of this work if you put it in common.yaml to start?
>> On Friday, July 31, 2020 at 11:42:27 AM UTC-4 djc...@gmail.com wrote:
>>
>>> Still no luck.  Hiera is now matching (it wasn't before):
>>>
>>> root@puppet:/# puppet lookup permitroot_config --node 
>>> lhcsrvprdcms01.fixnetix.com
>>> ---
>>> - Match Address xx.xx.xx.xx
>>> - PermitRootLogin without-password
>>>
>>> I had to change the YAML file slightly to:
>>>
>>> permitroot_config:
>>>   - 'Match Address xx.xx.xx.xx'
>>>   - 'PermitRootLogin without-password'
>>>
>>> From:
>>>
>>> permitroot:permitroot_config
>>>   - 'Match Address xx.xx.xx.xx'
>>>   - 'PermitRootLogin without-password'
>>>
>>> Thanks for the tip!  I have been using PDK.
>>>
>>> On Friday, July 31, 2020 at 4:25:13 PM UTC+1, A Manzer wrote:

 I've noticed two other things that may need fixing:

  - It may be a copy and paste error, but you don't close your Match 
 Address string in the pasted Hiera file above.  That would cause your Yaml 
 to be incorrect, and probably ignored.
  - In site.pp, you use the resource-like syntax for including the 
 class.  I'm not sure what this does for automatic hiera parameter lookup, 
 but it's usually safer to use include syntax instead.  I'd change your 
 entry in site.pp to be


 node lhcsrvprdcms01.domain.com {
   include permitroot
 }

 BTW, out of curiosity, are you using the Puppet PDK 
  to develop this module?  It 
 brings *a lot* of boilerplate, but it also brings things like Yaml 
 syntax validating and syntax validating that might help you out while 
 you're learning.

 On Friday, July 31, 2020 at 10:46:13 AM UTC-4, Dan Crisp wrote:
>
> Thanks for the reply.
>
>  Unfortunately although my YAML file didn't have the .yaml suffix and 
> I didn't have a data directory, after making the necessary changes, the 
> same problem persists:
>
> Error: Could not retrieve catalog from remote server: Error 500 on 
> SERVER: Server Error: Evaluation Error: Error while evaluating a Resource 
> Statement, Class[Permitroot]: expects a value for parameter 
> 'permitroot_config' (file: 
> /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
> column: 3) on node lhcsrvprdcms01.fixnetix
>
> # pwd
> /etc/puppetlabs/code/environments/production
>
> # ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
> -rw-r--r--. 1 root root 103 Jul 30 12:09 
> data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>
>
> On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:
>>
>> You need to put your nodes hiera folder under a data folder.  (*All* 
>> your hiera data goes under a data folder.)
>>
>> Also, ensure that your yaml file is named 
>> lhcsrvprdcms01.domain.com.y

[Puppet Users] Help with error Could not evaluate: Could not retrieve file metadata ... interrupted after 28.78 seconds

2020-07-31 Thread Michael L
Could not evaluate: Could not retrieve file metadata for 
puppet:///modules/os_patching/os_patching_fact_generation.ps1: Request to 
https://puppet.mysite.com:8140/puppet/v3/file_metadata/modules/os_patching/os_patching_fact_generation.ps1?links=manage&checksum_type=md5&source_permissions=ignore&environment=production
 
interrupted after 28.78 seconds


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b99dbc36-5c99-45fb-b185-458551f63b6co%40googlegroups.com.


[Puppet Users] Mysqldump using puppet

2020-07-31 Thread Md Juyel Haque
Please help me.I want to create  script database backup. This should be 
deployed with the puppet scripts on the Tomcat server.
Errors from the dump should be noted and an email sent to particular email 
address in case of errors/failure.
The script should also take the IP addresses from the Cloudformation 
template specified and SCP the backup to each of these servers.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com.


[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread Dan Crisp
Don't think it's a hiera issue now:

# puppet lookup permitroot::permitroot_config --node 
lhcsrvprdcms01.fixnetix.com
---
- Match Address xx.xx.xx.xx
- PermitRootLogin without-password

# pwd
/etc/puppetlabs/code/environments/production/data/nodes

# cat *
permitroot::permitroot_config:
  - 'Match Address 10.20.232.21'
  - 'PermitRootLogin without-password'

Still no joy though.

On Friday, July 31, 2020 at 4:47:40 PM UTC+1, A Manzer wrote:
>
> puppet lookup is a good diagnostic tool.
>
> Now though, you have a naming issue.  You need the permitroot:: prefix if 
> you want Puppet/Hiera to automatically fill in your parameter.
>
> So your puppet lookup debug command should be puppet lookup 
> permitroot::permitroot_config --explain --node lhcsrvprdcms01.fixnetix.com
>
> Once *that* works, your module should work too.
>
> Does any of this work if you put it in common.yaml to start?
> On Friday, July 31, 2020 at 11:42:27 AM UTC-4 djc...@gmail.com wrote:
>
>> Still no luck.  Hiera is now matching (it wasn't before):
>>
>> root@puppet:/# puppet lookup permitroot_config --node 
>> lhcsrvprdcms01.fixnetix.com
>> ---
>> - Match Address xx.xx.xx.xx
>> - PermitRootLogin without-password
>>
>> I had to change the YAML file slightly to:
>>
>> permitroot_config:
>>   - 'Match Address xx.xx.xx.xx'
>>   - 'PermitRootLogin without-password'
>>
>> From:
>>
>> permitroot:permitroot_config
>>   - 'Match Address xx.xx.xx.xx'
>>   - 'PermitRootLogin without-password'
>>
>> Thanks for the tip!  I have been using PDK.
>>
>> On Friday, July 31, 2020 at 4:25:13 PM UTC+1, A Manzer wrote:
>>>
>>> I've noticed two other things that may need fixing:
>>>
>>>  - It may be a copy and paste error, but you don't close your Match 
>>> Address string in the pasted Hiera file above.  That would cause your Yaml 
>>> to be incorrect, and probably ignored.
>>>  - In site.pp, you use the resource-like syntax for including the 
>>> class.  I'm not sure what this does for automatic hiera parameter lookup, 
>>> but it's usually safer to use include syntax instead.  I'd change your 
>>> entry in site.pp to be
>>>
>>>
>>> node lhcsrvprdcms01.domain.com {
>>>   include permitroot
>>> }
>>>
>>> BTW, out of curiosity, are you using the Puppet PDK 
>>>  to develop this module?  It 
>>> brings *a lot* of boilerplate, but it also brings things like Yaml 
>>> syntax validating and syntax validating that might help you out while 
>>> you're learning.
>>>
>>> On Friday, July 31, 2020 at 10:46:13 AM UTC-4, Dan Crisp wrote:

 Thanks for the reply.

  Unfortunately although my YAML file didn't have the .yaml suffix and I 
 didn't have a data directory, after making the necessary changes, the same 
 problem persists:

 Error: Could not retrieve catalog from remote server: Error 500 on 
 SERVER: Server Error: Evaluation Error: Error while evaluating a Resource 
 Statement, Class[Permitroot]: expects a value for parameter 
 'permitroot_config' (file: 
 /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
 column: 3) on node lhcsrvprdcms01.fixnetix

 # pwd
 /etc/puppetlabs/code/environments/production

 # ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
 -rw-r--r--. 1 root root 103 Jul 30 12:09 
 data/nodes/lhcsrvprdcms01.fixnetix.com.yaml


 On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:
>
> You need to put your nodes hiera folder under a data folder.  (*All* 
> your hiera data goes under a data folder.)
>
> Also, ensure that your yaml file is named 
> lhcsrvprdcms01.domain.com.yaml.  You need the *full* node name, *and* 
> the .yaml at the end for hiera to find it.  That's tripped me up a few 
> times...
>
> On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:
>>
>> Hello experts,
>>
>> I'm struggling with some node specific heria.  I basically want to 
>> add the following lines to a number of nodes:
>>
>> Match Address xx.xx.xx.xx
>> PermitRootLogin without-password
>>
>> I have the following in place in an attempt to acheive this:
>>
>> # pwd
>>
>> /etc/puppetlabs/code/environments/production/modules/permitroot/manifests
>>
>> # more *
>>
>> ::
>> config.pp
>> ::
>> class permitroot::config (
>>   $config_path = $permitroot::params::config_path
>> ) inherits permitroot::params {
>>   if $facts['os']['release']['major'] =~ /7/ {
>> file { 'Update SSHD PermitRoot':
>>   ensure=> $permitroot::config_present,
>>   path  => $permitroot::config_path,
>>   content   => $permitroot::permitroot_config.join("\n"),
>>   owner  => root,
>>   group  => root,
>>   mode   => '0600'
>> }
>>   } else {
>>   notice ('Assuming RHEL 6.x thus taking no action')
>>

[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread A Manzer
puppet lookup is a good diagnostic tool.

Now though, you have a naming issue.  You need the permitroot:: prefix if 
you want Puppet/Hiera to automatically fill in your parameter.

So your puppet lookup debug command should be puppet lookup 
permitroot::permitroot_config --explain --node lhcsrvprdcms01.fixnetix.com

Once *that* works, your module should work too.

Does any of this work if you put it in common.yaml to start?
On Friday, July 31, 2020 at 11:42:27 AM UTC-4 djc...@gmail.com wrote:

> Still no luck.  Hiera is now matching (it wasn't before):
>
> root@puppet:/# puppet lookup permitroot_config --node 
> lhcsrvprdcms01.fixnetix.com
> ---
> - Match Address xx.xx.xx.xx
> - PermitRootLogin without-password
>
> I had to change the YAML file slightly to:
>
> permitroot_config:
>   - 'Match Address xx.xx.xx.xx'
>   - 'PermitRootLogin without-password'
>
> From:
>
> permitroot:permitroot_config
>   - 'Match Address xx.xx.xx.xx'
>   - 'PermitRootLogin without-password'
>
> Thanks for the tip!  I have been using PDK.
>
> On Friday, July 31, 2020 at 4:25:13 PM UTC+1, A Manzer wrote:
>>
>> I've noticed two other things that may need fixing:
>>
>>  - It may be a copy and paste error, but you don't close your Match 
>> Address string in the pasted Hiera file above.  That would cause your Yaml 
>> to be incorrect, and probably ignored.
>>  - In site.pp, you use the resource-like syntax for including the class.  
>> I'm not sure what this does for automatic hiera parameter lookup, but it's 
>> usually safer to use include syntax instead.  I'd change your entry in 
>> site.pp to be
>>
>>
>> node lhcsrvprdcms01.domain.com {
>>   include permitroot
>> }
>>
>> BTW, out of curiosity, are you using the Puppet PDK 
>>  to develop this module?  It 
>> brings *a lot* of boilerplate, but it also brings things like Yaml 
>> syntax validating and syntax validating that might help you out while 
>> you're learning.
>>
>> On Friday, July 31, 2020 at 10:46:13 AM UTC-4, Dan Crisp wrote:
>>>
>>> Thanks for the reply.
>>>
>>>  Unfortunately although my YAML file didn't have the .yaml suffix and I 
>>> didn't have a data directory, after making the necessary changes, the same 
>>> problem persists:
>>>
>>> Error: Could not retrieve catalog from remote server: Error 500 on 
>>> SERVER: Server Error: Evaluation Error: Error while evaluating a Resource 
>>> Statement, Class[Permitroot]: expects a value for parameter 
>>> 'permitroot_config' (file: 
>>> /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
>>> column: 3) on node lhcsrvprdcms01.fixnetix
>>>
>>> # pwd
>>> /etc/puppetlabs/code/environments/production
>>>
>>> # ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>>> -rw-r--r--. 1 root root 103 Jul 30 12:09 
>>> data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>>>
>>>
>>> On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:

 You need to put your nodes hiera folder under a data folder.  (*All* 
 your hiera data goes under a data folder.)

 Also, ensure that your yaml file is named 
 lhcsrvprdcms01.domain.com.yaml.  You need the *full* node name, *and* 
 the .yaml at the end for hiera to find it.  That's tripped me up a few 
 times...

 On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:
>
> Hello experts,
>
> I'm struggling with some node specific heria.  I basically want to add 
> the following lines to a number of nodes:
>
> Match Address xx.xx.xx.xx
> PermitRootLogin without-password
>
> I have the following in place in an attempt to acheive this:
>
> # pwd
>
> /etc/puppetlabs/code/environments/production/modules/permitroot/manifests
>
> # more *
>
> ::
> config.pp
> ::
> class permitroot::config (
>   $config_path = $permitroot::params::config_path
> ) inherits permitroot::params {
>   if $facts['os']['release']['major'] =~ /7/ {
> file { 'Update SSHD PermitRoot':
>   ensure=> $permitroot::config_present,
>   path  => $permitroot::config_path,
>   content   => $permitroot::permitroot_config.join("\n"),
>   owner  => root,
>   group  => root,
>   mode   => '0600'
> }
>   } else {
>   notice ('Assuming RHEL 6.x thus taking no action')
> }
> }
> ::
> init.pp
> ::
> class permitroot (
>   $service_name = $permitroot::params::service_name,
>   $config_path  = $permitroot::params::config_path,
>   Array[String] $permitroot_config,
>   String $service_ensure,
>   Boolean $service_enable,
>   Boolean $service_hasrestart,
> ) inherits permitroot::params {
>   contain permitroot::config
>   contain permitroot::service
>
>   Class['permitroot::config']
> -> Class['permitroot::service']
> }
> ::

[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread Dan Crisp
Still no luck.  Hiera is now matching (it wasn't before):

root@puppet:/# puppet lookup permitroot_config --node 
lhcsrvprdcms01.fixnetix.com
---
- Match Address xx.xx.xx.xx
- PermitRootLogin without-password

I had to change the YAML file slightly to:

permitroot_config:
  - 'Match Address xx.xx.xx.xx'
  - 'PermitRootLogin without-password'

From:

permitroot:permitroot_config
  - 'Match Address xx.xx.xx.xx'
  - 'PermitRootLogin without-password'

Thanks for the tip!  I have been using PDK.

On Friday, July 31, 2020 at 4:25:13 PM UTC+1, A Manzer wrote:
>
> I've noticed two other things that may need fixing:
>
>  - It may be a copy and paste error, but you don't close your Match 
> Address string in the pasted Hiera file above.  That would cause your Yaml 
> to be incorrect, and probably ignored.
>  - In site.pp, you use the resource-like syntax for including the class.  
> I'm not sure what this does for automatic hiera parameter lookup, but it's 
> usually safer to use include syntax instead.  I'd change your entry in 
> site.pp to be
>
>
> node lhcsrvprdcms01.domain.com {
>   include permitroot
> }
>
> BTW, out of curiosity, are you using the Puppet PDK 
>  to develop this module?  It 
> brings *a lot* of boilerplate, but it also brings things like Yaml syntax 
> validating and syntax validating that might help you out while you're 
> learning.
>
> On Friday, July 31, 2020 at 10:46:13 AM UTC-4, Dan Crisp wrote:
>>
>> Thanks for the reply.
>>
>>  Unfortunately although my YAML file didn't have the .yaml suffix and I 
>> didn't have a data directory, after making the necessary changes, the same 
>> problem persists:
>>
>> Error: Could not retrieve catalog from remote server: Error 500 on 
>> SERVER: Server Error: Evaluation Error: Error while evaluating a Resource 
>> Statement, Class[Permitroot]: expects a value for parameter 
>> 'permitroot_config' (file: 
>> /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
>> column: 3) on node lhcsrvprdcms01.fixnetix
>>
>> # pwd
>> /etc/puppetlabs/code/environments/production
>>
>> # ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>> -rw-r--r--. 1 root root 103 Jul 30 12:09 
>> data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>>
>>
>> On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:
>>>
>>> You need to put your nodes hiera folder under a data folder.  (*All* 
>>> your hiera data goes under a data folder.)
>>>
>>> Also, ensure that your yaml file is named lhcsrvprdcms01.domain.com.yaml.  
>>> You need the *full* node name, *and* the .yaml at the end for hiera to 
>>> find it.  That's tripped me up a few times...
>>>
>>> On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:

 Hello experts,

 I'm struggling with some node specific heria.  I basically want to add 
 the following lines to a number of nodes:

 Match Address xx.xx.xx.xx
 PermitRootLogin without-password

 I have the following in place in an attempt to acheive this:

 # pwd

 /etc/puppetlabs/code/environments/production/modules/permitroot/manifests

 # more *

 ::
 config.pp
 ::
 class permitroot::config (
   $config_path = $permitroot::params::config_path
 ) inherits permitroot::params {
   if $facts['os']['release']['major'] =~ /7/ {
 file { 'Update SSHD PermitRoot':
   ensure=> $permitroot::config_present,
   path  => $permitroot::config_path,
   content   => $permitroot::permitroot_config.join("\n"),
   owner  => root,
   group  => root,
   mode   => '0600'
 }
   } else {
   notice ('Assuming RHEL 6.x thus taking no action')
 }
 }
 ::
 init.pp
 ::
 class permitroot (
   $service_name = $permitroot::params::service_name,
   $config_path  = $permitroot::params::config_path,
   Array[String] $permitroot_config,
   String $service_ensure,
   Boolean $service_enable,
   Boolean $service_hasrestart,
 ) inherits permitroot::params {
   contain permitroot::config
   contain permitroot::service

   Class['permitroot::config']
 -> Class['permitroot::service']
 }
 ::
 params.pp
 ::
 class permitroot::params {
   $service_name = 'sshd'
   $config_path = '/etc/ssh/sshd_config'
 }
 ::
 service.pp
 ::
 class permitroot::service (
   $service_name = $permitroot::params::service_name,
 ) inherits permitroot::params {
   service {'permitroot_service':
 name   => $service_name,
 ensure => $permitroot::service_ensure,
 enable => $permitroot::service_enable,
 hasrestart => $permitroot::service_hasrestart,
   }
 }

 This is probably not the best method and I'm still learnin

[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread A Manzer
I've noticed two other things that may need fixing:

 - It may be a copy and paste error, but you don't close your Match Address 
string in the pasted Hiera file above.  That would cause your Yaml to be 
incorrect, and probably ignored.
 - In site.pp, you use the resource-like syntax for including the class.  
I'm not sure what this does for automatic hiera parameter lookup, but it's 
usually safer to use include syntax instead.  I'd change your entry in 
site.pp to be


node lhcsrvprdcms01.domain.com {
  include permitroot
}

BTW, out of curiosity, are you using the Puppet PDK 
 to develop this module?  It 
brings *a lot* of boilerplate, but it also brings things like Yaml syntax 
validating and syntax validating that might help you out while you're 
learning.

On Friday, July 31, 2020 at 10:46:13 AM UTC-4, Dan Crisp wrote:
>
> Thanks for the reply.
>
>  Unfortunately although my YAML file didn't have the .yaml suffix and I 
> didn't have a data directory, after making the necessary changes, the same 
> problem persists:
>
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource 
> Statement, Class[Permitroot]: expects a value for parameter 
> 'permitroot_config' (file: 
> /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
> column: 3) on node lhcsrvprdcms01.fixnetix
>
> # pwd
> /etc/puppetlabs/code/environments/production
>
> # ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
> -rw-r--r--. 1 root root 103 Jul 30 12:09 
> data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
>
>
> On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:
>>
>> You need to put your nodes hiera folder under a data folder.  (*All* 
>> your hiera data goes under a data folder.)
>>
>> Also, ensure that your yaml file is named lhcsrvprdcms01.domain.com.yaml.  
>> You need the *full* node name, *and* the .yaml at the end for hiera to 
>> find it.  That's tripped me up a few times...
>>
>> On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:
>>>
>>> Hello experts,
>>>
>>> I'm struggling with some node specific heria.  I basically want to add 
>>> the following lines to a number of nodes:
>>>
>>> Match Address xx.xx.xx.xx
>>> PermitRootLogin without-password
>>>
>>> I have the following in place in an attempt to acheive this:
>>>
>>> # pwd
>>> /etc/puppetlabs/code/environments/production/modules/permitroot/manifests
>>>
>>> # more *
>>>
>>> ::
>>> config.pp
>>> ::
>>> class permitroot::config (
>>>   $config_path = $permitroot::params::config_path
>>> ) inherits permitroot::params {
>>>   if $facts['os']['release']['major'] =~ /7/ {
>>> file { 'Update SSHD PermitRoot':
>>>   ensure=> $permitroot::config_present,
>>>   path  => $permitroot::config_path,
>>>   content   => $permitroot::permitroot_config.join("\n"),
>>>   owner  => root,
>>>   group  => root,
>>>   mode   => '0600'
>>> }
>>>   } else {
>>>   notice ('Assuming RHEL 6.x thus taking no action')
>>> }
>>> }
>>> ::
>>> init.pp
>>> ::
>>> class permitroot (
>>>   $service_name = $permitroot::params::service_name,
>>>   $config_path  = $permitroot::params::config_path,
>>>   Array[String] $permitroot_config,
>>>   String $service_ensure,
>>>   Boolean $service_enable,
>>>   Boolean $service_hasrestart,
>>> ) inherits permitroot::params {
>>>   contain permitroot::config
>>>   contain permitroot::service
>>>
>>>   Class['permitroot::config']
>>> -> Class['permitroot::service']
>>> }
>>> ::
>>> params.pp
>>> ::
>>> class permitroot::params {
>>>   $service_name = 'sshd'
>>>   $config_path = '/etc/ssh/sshd_config'
>>> }
>>> ::
>>> service.pp
>>> ::
>>> class permitroot::service (
>>>   $service_name = $permitroot::params::service_name,
>>> ) inherits permitroot::params {
>>>   service {'permitroot_service':
>>> name   => $service_name,
>>> ensure => $permitroot::service_ensure,
>>> enable => $permitroot::service_enable,
>>> hasrestart => $permitroot::service_hasrestart,
>>>   }
>>> }
>>>
>>> This is probably not the best method and I'm still learning and don't 
>>> want to use a module that has already been created by someone else at this 
>>> point.
>>>
>>> Here is the node specific heria:
>>>
>>> # pwd
>>> /etc/puppetlabs/code/environments/production/nodes
>>>
>>> # more *
>>> permitroot::permitroot_config:
>>>   - 'Match Address xx.xx.xx.xx
>>>   - 'PermitRootLogin without-password'
>>>
>>> Hiera file:
>>>
>>> # pwd
>>> /etc/puppetlabs/code/environments/production
>>>
>>> # more hiera.yaml
>>> ---
>>> version: 5
>>> defaults:
>>>   # The default value for "datadir" is "data" under the same directory 
>>> as the hiera.yaml
>>>   # file (this file)
>>>   # When specifying a datadir, make sure the directory exists.
>>>   # See https://puppet.com/d

[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread Dan Crisp
Thanks for the reply.

 Unfortunately although my YAML file didn't have the .yaml suffix and I 
didn't have a data directory, after making the necessary changes, the same 
problem persists:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
Server Error: Evaluation Error: Error while evaluating a Resource 
Statement, Class[Permitroot]: expects a value for parameter 
'permitroot_config' (file: 
/etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
column: 3) on node lhcsrvprdcms01.fixnetix

# pwd
/etc/puppetlabs/code/environments/production

# ll data/nodes/lhcsrvprdcms01.fixnetix.com.yaml
-rw-r--r--. 1 root root 103 Jul 30 12:09 
data/nodes/lhcsrvprdcms01.fixnetix.com.yaml


On Friday, July 31, 2020 at 2:15:18 PM UTC+1, A Manzer wrote:
>
> You need to put your nodes hiera folder under a data folder.  (*All* your 
> hiera data goes under a data folder.)
>
> Also, ensure that your yaml file is named lhcsrvprdcms01.domain.com.yaml.  
> You need the *full* node name, *and* the .yaml at the end for hiera to 
> find it.  That's tripped me up a few times...
>
> On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:
>>
>> Hello experts,
>>
>> I'm struggling with some node specific heria.  I basically want to add 
>> the following lines to a number of nodes:
>>
>> Match Address xx.xx.xx.xx
>> PermitRootLogin without-password
>>
>> I have the following in place in an attempt to acheive this:
>>
>> # pwd
>> /etc/puppetlabs/code/environments/production/modules/permitroot/manifests
>>
>> # more *
>>
>> ::
>> config.pp
>> ::
>> class permitroot::config (
>>   $config_path = $permitroot::params::config_path
>> ) inherits permitroot::params {
>>   if $facts['os']['release']['major'] =~ /7/ {
>> file { 'Update SSHD PermitRoot':
>>   ensure=> $permitroot::config_present,
>>   path  => $permitroot::config_path,
>>   content   => $permitroot::permitroot_config.join("\n"),
>>   owner  => root,
>>   group  => root,
>>   mode   => '0600'
>> }
>>   } else {
>>   notice ('Assuming RHEL 6.x thus taking no action')
>> }
>> }
>> ::
>> init.pp
>> ::
>> class permitroot (
>>   $service_name = $permitroot::params::service_name,
>>   $config_path  = $permitroot::params::config_path,
>>   Array[String] $permitroot_config,
>>   String $service_ensure,
>>   Boolean $service_enable,
>>   Boolean $service_hasrestart,
>> ) inherits permitroot::params {
>>   contain permitroot::config
>>   contain permitroot::service
>>
>>   Class['permitroot::config']
>> -> Class['permitroot::service']
>> }
>> ::
>> params.pp
>> ::
>> class permitroot::params {
>>   $service_name = 'sshd'
>>   $config_path = '/etc/ssh/sshd_config'
>> }
>> ::
>> service.pp
>> ::
>> class permitroot::service (
>>   $service_name = $permitroot::params::service_name,
>> ) inherits permitroot::params {
>>   service {'permitroot_service':
>> name   => $service_name,
>> ensure => $permitroot::service_ensure,
>> enable => $permitroot::service_enable,
>> hasrestart => $permitroot::service_hasrestart,
>>   }
>> }
>>
>> This is probably not the best method and I'm still learning and don't 
>> want to use a module that has already been created by someone else at this 
>> point.
>>
>> Here is the node specific heria:
>>
>> # pwd
>> /etc/puppetlabs/code/environments/production/nodes
>>
>> # more *
>> permitroot::permitroot_config:
>>   - 'Match Address xx.xx.xx.xx
>>   - 'PermitRootLogin without-password'
>>
>> Hiera file:
>>
>> # pwd
>> /etc/puppetlabs/code/environments/production
>>
>> # more hiera.yaml
>> ---
>> version: 5
>> defaults:
>>   # The default value for "datadir" is "data" under the same directory as 
>> the hiera.yaml
>>   # file (this file)
>>   # When specifying a datadir, make sure the directory exists.
>>   # See https://puppet.com/docs/puppet/latest/environments_about.html 
>> for further details on environments.
>>   #datadir: data
>>   data_hash: yaml_data
>> hierarchy:
>>   - name: "Per-node data"   # Human-readable name.
>> path: "nodes/%{trusted.certname}.yaml"  # File path, relative to 
>> datadir.
>>
>>   - name: "Per-OS defaults"
>> path: "os/%{facts.os.family}.yaml"
>>
>>   - name: "Common data"
>> path: "common.yaml"
>>
>> Site.pp file:
>>
>> # more site.pp
>> ...
>> ...
>> ...
>> node lhcsrvprdcms01.domain.com {
>>   class { 'permitroot': }
>> }
>>
>> When I run the puppet agent on the server about were I want the new 
>> vaules added, I see the see returned the following:
>>
>> # puppet agent --no-daemonize --onetime --verbose --noop
>> Info: Using configured environment 'production'
>> Info: Retrieving pluginfacts
>> Info: Retrieving plugin
>> Info: Retrieving locales
>> Info: Loading facts
>> Error: Could not retrieve catalog from remote server: Error 500 on 
>> SERVER: Server Error: Evaluation Error

[Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread A Manzer
You need to put your nodes hiera folder under a data folder.  (*All* your 
hiera data goes under a data folder.)

Also, ensure that your yaml file is named lhcsrvprdcms01.domain.com.yaml.  
You need the *full* node name, *and* the .yaml at the end for hiera to find 
it.  That's tripped me up a few times...

On Thursday, July 30, 2020 at 10:43:13 AM UTC-4, Dan Crisp wrote:
>
> Hello experts,
>
> I'm struggling with some node specific heria.  I basically want to add the 
> following lines to a number of nodes:
>
> Match Address xx.xx.xx.xx
> PermitRootLogin without-password
>
> I have the following in place in an attempt to acheive this:
>
> # pwd
> /etc/puppetlabs/code/environments/production/modules/permitroot/manifests
>
> # more *
>
> ::
> config.pp
> ::
> class permitroot::config (
>   $config_path = $permitroot::params::config_path
> ) inherits permitroot::params {
>   if $facts['os']['release']['major'] =~ /7/ {
> file { 'Update SSHD PermitRoot':
>   ensure=> $permitroot::config_present,
>   path  => $permitroot::config_path,
>   content   => $permitroot::permitroot_config.join("\n"),
>   owner  => root,
>   group  => root,
>   mode   => '0600'
> }
>   } else {
>   notice ('Assuming RHEL 6.x thus taking no action')
> }
> }
> ::
> init.pp
> ::
> class permitroot (
>   $service_name = $permitroot::params::service_name,
>   $config_path  = $permitroot::params::config_path,
>   Array[String] $permitroot_config,
>   String $service_ensure,
>   Boolean $service_enable,
>   Boolean $service_hasrestart,
> ) inherits permitroot::params {
>   contain permitroot::config
>   contain permitroot::service
>
>   Class['permitroot::config']
> -> Class['permitroot::service']
> }
> ::
> params.pp
> ::
> class permitroot::params {
>   $service_name = 'sshd'
>   $config_path = '/etc/ssh/sshd_config'
> }
> ::
> service.pp
> ::
> class permitroot::service (
>   $service_name = $permitroot::params::service_name,
> ) inherits permitroot::params {
>   service {'permitroot_service':
> name   => $service_name,
> ensure => $permitroot::service_ensure,
> enable => $permitroot::service_enable,
> hasrestart => $permitroot::service_hasrestart,
>   }
> }
>
> This is probably not the best method and I'm still learning and don't want 
> to use a module that has already been created by someone else at this point.
>
> Here is the node specific heria:
>
> # pwd
> /etc/puppetlabs/code/environments/production/nodes
>
> # more *
> permitroot::permitroot_config:
>   - 'Match Address xx.xx.xx.xx
>   - 'PermitRootLogin without-password'
>
> Hiera file:
>
> # pwd
> /etc/puppetlabs/code/environments/production
>
> # more hiera.yaml
> ---
> version: 5
> defaults:
>   # The default value for "datadir" is "data" under the same directory as 
> the hiera.yaml
>   # file (this file)
>   # When specifying a datadir, make sure the directory exists.
>   # See https://puppet.com/docs/puppet/latest/environments_about.html for 
> further details on environments.
>   #datadir: data
>   data_hash: yaml_data
> hierarchy:
>   - name: "Per-node data"   # Human-readable name.
> path: "nodes/%{trusted.certname}.yaml"  # File path, relative to 
> datadir.
>
>   - name: "Per-OS defaults"
> path: "os/%{facts.os.family}.yaml"
>
>   - name: "Common data"
> path: "common.yaml"
>
> Site.pp file:
>
> # more site.pp
> ...
> ...
> ...
> node lhcsrvprdcms01.domain.com {
>   class { 'permitroot': }
> }
>
> When I run the puppet agent on the server about were I want the new vaules 
> added, I see the see returned the following:
>
> # puppet agent --no-daemonize --onetime --verbose --noop
> Info: Using configured environment 'production'
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Retrieving locales
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource 
> Statement, Class[Permitroot]: expects a value for parameter 
> 'permitroot_config' (file: 
> /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 49, 
> column: 3) on node lhcsrvprdcms01.fixnetix.com
> Info: Using cached catalog from environment 'production'
> Info: Applying configuration version '1596101172'
> Notice: Applied catalog in 2.39 seconds
>
> Any help here would be appreciated.
>
> Thanks,
> Dan.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/00c7ca49-e568-4ca4-9d64-722ed6d2aee6o%40googlegroups.com.