#+CAPTION: [[file:abbey][=abbey=]]
#+BEGIN_SRC perl :tangle abbey
if ($ARGV[0] eq "tz") {
- my $city = `cat /etc/timezone`; chomp $city;
+ # my $city = `cat /etc/timezone`; chomp $city;
+ my $city = (readlink "/etc/localtime");
+ $city =~ s,/usr/share/zoneinfo/,,;
my $zone = `date +%Z`; chomp $zone;
- print "Setting timezones to $city.\n";
+ print "Setting timezones to $city ($zone).\n";
exec ("ansible-playbook", "-e", "\@Secret/become.yml",
"-e", "zone=$zone", "-e", "city=$city",
"playbooks/timezone.yml");
}
if ($ARGV[0] eq "tz") {
- my $city = `cat /etc/timezone`; chomp $city;
+ # my $city = `cat /etc/timezone`; chomp $city;
+ my $city = (readlink "/etc/localtime");
+ $city =~ s,/usr/share/zoneinfo/,,;
my $zone = `date +%Z`; chomp $zone;
- print "Setting timezones to $city.\n";
+ print "Setting timezones to $city ($zone).\n";
exec ("ansible-playbook", "-e", "\@Secret/become.yml",
"-e", "zone=$zone", "-e", "city=$city",
"playbooks/timezone.yml");