Terraform Pipelines for Dummies Part 1: Run a Terraform Configuration in GitLabCI
Introduction Automating infrastructure provisioning with Terraform is nothing for many, but to truly harness IaC power, seamless integration with ... Read More
Learn more about why Eclipsys has been named the 2023 Best Workplaces in Technology and Ontario, Certified as a Great Place to Work in Canada and named Canada’s Top SME Employer!
Learn more!I was playing with my Linux Vagrant boxes lately and I realized I was always spinning third-party boxes that had a totally different time zone (Europe/UK mostly). Up until now I never bothered as I have used a bunch of those from Vagrant Cloud for years. I sometimes notice, and think of using a shell command to fix it during the bootstrap, but I haven’t had the time. However, I was heavily debugging some logs this week and the wrong Time Zone started to get annoying for me so I decided to look for a permanent fix.
Solution
There is no need to add a random shell script in the shell provisioning area of your Vagrantfile. Teemu Matilainen has you covered with his sweet ruby plugin called vagrant-timezone that does just that.
How does it work
Install the plugin:
C:\Users\brokedba> vagrant plugin install vagrant-timezone
Installing the 'vagrant-timezone' plugin. This can take a few minutes...
Fetching vagrant-timezone-1.3.0.gem
Installed the plugin 'vagrant-timezone (1.3.0)'!
► Configuration
To configure the time zone for all Vagrant VMs, add the following to $HOME/.vagrant.d/Vagrantfile or to a project-specific Vagrantfile (see below example in windows).
C:\Users\brokedba\.vagrant.d>vagrant init --- Add the IF block below in the master or each build’s Vagrantfile Vagrant.configure("2") do |config| if Vagrant.has_plugin?("vagrant-timezone") config.timezone.value = "America/Toronto" end # ... other stuff end
You can of course choose your own Time Zone from this TZ database list
– The configuration is done on vagrant up
and vagrant reload
actions.
Note that no services are restarted automatically so they may keep using the old-time zone information.
– This plugin requires Vagrant 1.2 or newer.
BSD guests:
Windows
This will hopefully encourage you to more often use and enjoy vagrant boxes without being stuck with the original Time Zone!
Introduction Automating infrastructure provisioning with Terraform is nothing for many, but to truly harness IaC power, seamless integration with ... Read More
Introduction Since the very beginning, everyone was introduced to Cloud Services through the console as it’s very quick. But the cloud CLI tooling ... Read More