Puppet Syntax Issue for tzutil

CPX

Ars Legatus Legionis
28,143
Subscriptor++
I have Puppet deployed on a variety of systems, both workstation and server. I need the servers on UTC...which is easy. But the workstations need to be on local time lest the users have to deal with UTC on all their email and calendar programs (which is less than ideal when you reach mid to senior management types). The servers stay UTC for a variety of reasons out of my control. I cannot execute this with GPO because I don't control the domain.

So here is the variable line:

Code:
$timezone=[$os[release][full] ? { '10' => ('Central Standard Time') , default => 'UTC'}]

And here's the command:

Code:
command =>"tzutil /s \"$timezone\"",

The UTC executes fine, but I can't get local time variable to take. I figure that since CST needs spelled out with spaces, it needs some kind of variable enclosure...but every edit I try kicks back errors and Puppet can't seem to pass the variable properly. What am I getting wrong on the variable syntax?
 

CPX

Ars Legatus Legionis
28,143
Subscriptor++
I need the servers on UTC


Gross. I know you don't control this but things should always be set to the time zone where they reside.


Logs should always be in UTC, allowing the local time zone to convert for display as necessary.

We'd stop having time zones if it were up to me. Yeah, I get it. But I think I'd have the same problem with Puppet anyway, since it's getting snippy about the syntax.
 

ZPrime

Ars Legatus Legionis
18,847
Subscriptor++
I need the servers on UTC


Gross. I know you don't control this but things should always be set to the time zone where they reside.


Logs should always be in UTC, allowing the local time zone to convert for display as necessary.

Oftentimes the logs are written in the server's TZ (at least IME). So if you mandate UTC logs, you're stuck with UTC in the GUI too.

My current org never will operate outside one TZ, so I'm setting everything to local, because I hate remembering how many hours to subtract...
 

sryan2k1

Ars Legatus Legionis
46,882
Subscriptor++
Oftentimes the logs are written in the server's TZ

As long as the logs have the TZ identifier in them, it doesn't really matter what TZ the data is in.



My current org never will operate outside one TZ, so I'm setting everything to local,

Lol, first time? Then you guys buy a small WISP outside of Chicago and boom, two time zones.
 

CPX

Ars Legatus Legionis
28,143
Subscriptor++
Oftentimes the logs are written in the server's TZ (at least IME). So if you mandate UTC logs, you're stuck with UTC in the GUI too.

Logs aren't an issue, crappy software that only reads system time instead of calculating UTC itself is. Almost as bad and cheap as Dell's fucking two-digit year in the firmware of some of their latest systems...like no one in engineering apparently lived through Y2K. :facepalm:

My current org never will operate outside one TZ, so I'm setting everything to local, because I hate remembering how many hours to subtract...

Mine operates in...more. A lot more.
 

Entegy

Ars Legatus Legionis
18,256
In a perfect world, every product would write logs in UTC, but have their viewer tools do the conversion. But we don't live in that world.

And as frustrating as governments has made them, you want time zones. You do not want one Earth time.

Have you tried setting Set-TimeZone in PowerShell instead? You could put the Timezone ID in a preset variable.
 

CPX

Ars Legatus Legionis
28,143
Subscriptor++
In a perfect world, every product would write logs in UTC, but have their viewer tools do the conversion. But we don't live in that world.

And as frustrating as governments has made them, you want time zones. You do not want one Earth time.

Have you tried setting Set-TimeZone in PowerShell instead? You could put the Timezone ID in a preset variable.

That I haven't yet. I could have the servers use tzutil and workstations set-timezone...
 

ZPrime

Ars Legatus Legionis
18,847
Subscriptor++
Oftentimes the logs are written in the server's TZ

As long as the logs have the TZ identifier in them, it doesn't really matter what TZ the data is in.



My current org never will operate outside one TZ, so I'm setting everything to local,

Lol, first time? Then you guys buy a small WISP outside of Chicago and boom, two time zones.

I don't imagine a community-focused nonprofit is going to expand outside of the community it was designed to serve. ;)

There's been some talk that once we fully develop "the model," there may be expansion to other cities, but I think it would be more like a licensing / franchise / pay us to help you get it off the ground concept.

Regardless, kind of o/t for this thread. :p