timezone by ignition

404 views
Skip to first unread message

Maarten Dekker

unread,
Jan 5, 2018, 2:46:23 PM1/5/18
to CoreOS User
Hi All,

Probably my question is either deadsimple or I overlooked something, so lets give it a shot here.
How can I set the timezone with ignition?

Its a typical thing you usually do only once, but I could not find a good example for ignition other than doing it as a one-shot, but I am not sure if that should be the right way to go.

Please advise :-)

Maarten

David Michael

unread,
Jan 8, 2018, 10:56:23 AM1/8/18
to Maarten Dekker, CoreOS User
On Fri, Jan 5, 2018 at 2:46 PM, Maarten Dekker <maa...@datastorm.nl> wrote:
> Hi All,
>
> Probably my question is either deadsimple or I overlooked something, so lets
> give it a shot here.
> How can I set the timezone with ignition?

Can you create a service like this?

https://coreos.com/os/docs/latest/cloud-config-examples.html#time

> Its a typical thing you usually do only once, but I could not find a good
> example for ignition other than doing it as a one-shot, but I am not sure if
> that should be the right way to go.

If you don't want it to run again, a ConditionFirstBoot=yes on the
service should prevent that.

Thanks.

David

Maarten Dekker

unread,
Jan 8, 2018, 11:07:26 AM1/8/18
to CoreOS User
Hi David,

Thanks for your reply.

You are pointing towards a cloud-config recipe.
The thing is the initial system setup is being done by iginition and I would like to keep it like that, especially now CoreOS is having a bigger focus on ignition.

Maarten

Op maandag 8 januari 2018 16:56:23 UTC+1 schreef David Michael:

David Michael

unread,
Jan 8, 2018, 11:22:48 AM1/8/18
to Maarten Dekker, CoreOS User
On Mon, Jan 8, 2018 at 11:07 AM, Maarten Dekker <maa...@datastorm.nl> wrote:
> Hi David,
>
> Thanks for your reply.
>
> You are pointing towards a cloud-config recipe.
> The thing is the initial system setup is being done by iginition and I would
> like to keep it like that, especially now CoreOS is having a bigger focus on
> ignition.

Yes, I meant: Are you able to write that example service file with Ignition?

Thanks.

David

Alex Crawford

unread,
Jan 8, 2018, 4:47:26 PM1/8/18
to Maarten Dekker, CoreOS User
Now that the Ignition 2.1.0 specification allows for symlinks, you can
use something like the following Container Linux Config:

storage:
links:
- path: /etc/localtime
target: /usr/share/zoneinfo/America/Los_Angeles
filesystem: root

I haven't actually tested this, but it would be great to know if it
solves your issue.

-Alex
signature.asc

Derek Gonyeo

unread,
Jan 8, 2018, 4:48:43 PM1/8/18
to Alex Crawford, Maarten Dekker, CoreOS User
There's a problem with that config in that `/etc/localtime` is a preexisting file, so the symlink creation will fail. I actually made a PR today to fix that: https://github.com/coreos/ignition/pull/494


--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages