Re: [Puppet Users] Re: puppet SSHD port based on hostname

2017-08-27 Thread Pete Brown
On Fri, 25 Aug 2017 at 23:07, John  wrote:

> So, I agree this is doable in Hiera.  However, I think for the SAZ SSH
> module, it would be better for me to include it in the sshd_config.erb.
>

Why?
It’s a simple solution to do it in hiera.

You are making th problem more complex by changing the template.


> I've added the following to sshd_config.:
>
> <%- if ServerName == myhost -%>
> Port = 
> <%- end -%>
>
> Puppet run finishes with no errors, but /etc/ssh/sshd_config does not the
> port setting at all.
>
> I've tried different variations of the command above with no luck.
>
> Am I even in the ball park?  It seems this should doable in the
> sshd_config.erb.  Any advice would be greatly appreciated.
>
> On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>>
>> I've pulled down the SAZ SSH module and implemented across my network.
>> It works great.
>>
>> However, I need to implement the following change:
>>
>> If hostname = host1 or host2 or host3
>>   then
>> port = 
>> fi
>>
>> I just want to change the default sshd port for a few hosts.
>>
>> How do I do that?
>>
>>
>>
>> --
> 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/d9316efe-3f09-4401-81ef-4022bbe85a7a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJ8DPF7m%2B91CGQYt_ZgF40ouD1L9b6iCTyxjE90vB0S%3DV76Usw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppet SSHD port based on hostname

2017-08-25 Thread Rob Nelson
If you're using saz/ssh, just add this to the 'options' parameter (hash) of
ssh::server. Anything that doesn't have a specific parameter can be
implemented there.

On Fri, Aug 25, 2017 at 11:07 PM John  wrote:

> So, I agree this is doable in Hiera.  However, I think for the SAZ SSH
> module, it would be better for me to include it in the sshd_config.erb.
>
> I've added the following to sshd_config.:
>
> <%- if ServerName == myhost -%>
> Port = 
> <%- end -%>
>
> Puppet run finishes with no errors, but /etc/ssh/sshd_config does not the
> port setting at all.
>
> I've tried different variations of the command above with no luck.
>
> Am I even in the ball park?  It seems this should doable in the
> sshd_config.erb.  Any advice would be greatly appreciated.
>
> On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>>
>> I've pulled down the SAZ SSH module and implemented across my network.
>> It works great.
>>
>> However, I need to implement the following change:
>>
>> If hostname = host1 or host2 or host3
>>   then
>> port = 
>> fi
>>
>> I just want to change the default sshd port for a few hosts.
>>
>> How do I do that?
>>
>>
>>
>> --
> 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/d9316efe-3f09-4401-81ef-4022bbe85a7a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Rob Nelson

-- 
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/CAC76iT_XWKj1AHfc88ZEaW1i7Gk99B%3DDKU7ha5sZSk%3Dz9w6jrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet SSHD port based on hostname

2017-08-25 Thread John
So, I agree this is doable in Hiera.  However, I think for the SAZ SSH 
module, it would be better for me to include it in the sshd_config.erb.

I've added the following to sshd_config.:

<%- if ServerName == myhost -%>
Port = 
<%- end -%>

Puppet run finishes with no errors, but /etc/ssh/sshd_config does not the 
port setting at all.

I've tried different variations of the command above with no luck.

Am I even in the ball park?  It seems this should doable in the 
sshd_config.erb.  Any advice would be greatly appreciated.

On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>
> I've pulled down the SAZ SSH module and implemented across my network.  It 
> works great.
>
> However, I need to implement the following change:
>
> If hostname = host1 or host2 or host3
>   then
> port = 
> fi
>
> I just want to change the default sshd port for a few hosts.
>
> How do I do that?
> 
>
>
>

-- 
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/d9316efe-3f09-4401-81ef-4022bbe85a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppet SSHD port based on hostname

2017-08-25 Thread Pete Brown
That is pretty easy to do with hiera.
It’s too complex to explain in an email so i would recommend looking up the
docs for it.
This is the best olace to start.
If you aren’t using puppet 5 just switch to the version you are using.

https://docs.puppet.com/puppet/5.1/hiera_intro.html

On Tue, 22 Aug 2017 at 21:30, John Baird  wrote:

> Honestly, I believe you would benefit from reading this over a bit...
>
> https://docs.puppet.com/puppet/5.0/lang_template_erb.html
>
>
> On Tuesday, August 22, 2017 at 4:37:35 PM UTC-5, John wrote:
>>
>> So I added the following to sshd_config.erb
>>
>> <%- if hostname = MyHost -%>
>> Port = 
>> <%- end -%>
>>
>> But it did not provide the expected results.  The puppet run finished
>> cleanly, but the sshd_config remained unchanged.
>>
>> Does that syntax look alright?
>>
>> TIA
>>
>> On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>>>
>>> I've pulled down the SAZ SSH module and implemented across my network.
>>> It works great.
>>>
>>> However, I need to implement the following change:
>>>
>>> If hostname = host1 or host2 or host3
>>>   then
>>> port = 
>>> fi
>>>
>>> I just want to change the default sshd port for a few hosts.
>>>
>>> How do I do that?
>>>
>>>
>>>
>>> --
> 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/4a22f5df-272b-4ce6-9cad-fd60e564440f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJ8DPF4gmGJvkackDxMdPMPHs1%3DNTjHog7wVnDCrZDzbUO9Gww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet SSHD port based on hostname

2017-08-22 Thread John Baird
Honestly, I believe you would benefit from reading this over a bit...

https://docs.puppet.com/puppet/5.0/lang_template_erb.html


On Tuesday, August 22, 2017 at 4:37:35 PM UTC-5, John wrote:
>
> So I added the following to sshd_config.erb
>
> <%- if hostname = MyHost -%>
> Port = 
> <%- end -%>
>
> But it did not provide the expected results.  The puppet run finished 
> cleanly, but the sshd_config remained unchanged.
>
> Does that syntax look alright?
>
> TIA
>
> On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>>
>> I've pulled down the SAZ SSH module and implemented across my network. 
>>  It works great.
>>
>> However, I need to implement the following change:
>>
>> If hostname = host1 or host2 or host3
>>   then
>> port = 
>> fi
>>
>> I just want to change the default sshd port for a few hosts.
>>
>> How do I do that?
>> 
>>
>>
>>

-- 
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/4a22f5df-272b-4ce6-9cad-fd60e564440f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet SSHD port based on hostname

2017-08-22 Thread John
So I added the following to sshd_config.erb

<%- if hostname = MyHost -%>
Port = 
<%- end -%>

But it did not provide the expected results.  The puppet run finished 
cleanly, but the sshd_config remained unchanged.

Does that syntax look alright?

TIA

On Tuesday, August 22, 2017 at 12:36:15 PM UTC-4, John wrote:
>
> I've pulled down the SAZ SSH module and implemented across my network.  It 
> works great.
>
> However, I need to implement the following change:
>
> If hostname = host1 or host2 or host3
>   then
> port = 
> fi
>
> I just want to change the default sshd port for a few hosts.
>
> How do I do that?
> 
>
>
>

-- 
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/467a45f7-1171-4d7e-9a00-3c715db82790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet SSHD port based on hostname

2017-08-22 Thread John Baird
It looks like you should be able to pass it as a Hash of "options"... 

https://github.com/saz/puppet-ssh/search?utf8=%E2%9C%93&q=port&type=

On Tuesday, August 22, 2017 at 11:36:15 AM UTC-5, John wrote:
>
> I've pulled down the SAZ SSH module and implemented across my network.  It 
> works great.
>
> However, I need to implement the following change:
>
> If hostname = host1 or host2 or host3
>   then
> port = 
> fi
>
> I just want to change the default sshd port for a few hosts.
>
> How do I do that?
> 
>
>
>

-- 
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/1c86488f-7d74-4b8f-a93f-5682e71d12e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.