Reg: Calling the sleep method

17 views
Skip to first unread message

Raghu Ram Baisani

unread,
Sep 3, 2020, 5:17:07 AM9/3/20
to Puppet Users
Hi Team
If I put:
$mainttime_converted = 100
exec{ 'maintenance_time':
  try_sleep => $mainttime_converted
 }
will this be in sleep state for 100 seconds?

Thanks
Raghuram Baisani

Bart-Jan Vrielink

unread,
Sep 3, 2020, 6:42:36 AM9/3/20
to puppet...@googlegroups.com

Hello,


No. The try_sleep parameter defines the time to sleep between tries. The default value of tries is 1.


What are you trying to achieve?


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5ed25917-527c-49b9-97c4-a90dc4d717e5n%40googlegroups.com.

Raghu Ram Baisani

unread,
Sep 3, 2020, 8:18:32 AM9/3/20
to puppet...@googlegroups.com
Hello 
Puts the machines into maintenance mode.
I want to execute sleep for 1 hour.
Revert the machines from maintenance mode.
Thanks
Raghuram


Jesse Reynolds

unread,
Sep 3, 2020, 10:50:45 AM9/3/20
to puppet...@googlegroups.com
Hi Raghu, 

Using exec is not a great way to put machines into maintenance mode. Some other ideas for you to look at: 

1/ Use the schedule resource, and schedule meta-parameter, to define the times of day for which puppet should enforce referenced resources. https://puppet.com/docs/puppet/6.18/types/schedule.html

2/ Use a bolt / puppet task to disable the puppet agent at the start of the maintenance, and revert after

Cheers
Jesse



--
Jesse Reynolds
Principal Professional Services Engineer
Melbourne, Australia
Reply all
Reply to author
Forward
0 new messages