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 On Thu, 3 Sep 2020 at 18:18, Raghu Ram Baisani <[email protected]> wrote: > Hello > Puts the machines into maintenance mode. > I want to execute sleep for 1 hour. > Revert the machines from maintenance mode. > Thanks > Raghuram > > > On Thu, Sep 3, 2020, 12:12 PM Bart-Jan Vrielink <[email protected]> > wrote: > >> 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? >> >> >> -----Original message----- >> *From:* Raghu Ram Baisani <[email protected]> >> *Sent:* Thursday 3rd September 2020 7:17 >> *To:* Puppet Users <[email protected]> >> *Subject:* [Puppet Users] Reg: Calling the sleep method >> >> 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 >> >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/5ed25917-527c-49b9-97c4-a90dc4d717e5n%40googlegroups.com >> <https://groups.google.com/d/msgid/puppet-users/5ed25917-527c-49b9-97c4-a90dc4d717e5n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/zarafa.5f509049.60e5.2bcfbcfe014212fa%40anjie.dontpanic.nl >> <https://groups.google.com/d/msgid/puppet-users/zarafa.5f509049.60e5.2bcfbcfe014212fa%40anjie.dontpanic.nl?utm_medium=email&utm_source=footer> >> . >> > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/CAFfXrByoTfQu%3D-GuQH_1U_PfWmfz4PZXdy0%3Dm-vWPgbXW2CVUQ%40mail.gmail.com > <https://groups.google.com/d/msgid/puppet-users/CAFfXrByoTfQu%3D-GuQH_1U_PfWmfz4PZXdy0%3Dm-vWPgbXW2CVUQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- *Jesse Reynolds* Principal Professional Services Engineer Melbourne, Australia mobile: +61 414 669 790 [email protected] *Puppet <https://puppet.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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAMwMGPMOSiGWztHbebWQ_SHXqkhzzv3H16EUfu8nAiNmdocU-A%40mail.gmail.com.
