- reboots :: Look for =/run/reboot*= on all hosts.
- versions :: Report ~ansible_distribution~, ~_distribution_version~,
and ~_architecture~ for all hosts.
+- facts :: Update (clobber!) [[file:facts][=facts=]].
** Abbey Command Script
{{ ansible_architecture }}
#+END_SRC
+** The Facts Command
+
+The script implements a ~facts~ sub-command to collect the Ansible
+"facts" from ~all~ and output them to the JSON format =facts= file.
+
+#+CAPTION: [[file:abbey][=abbey=]]
+#+BEGIN_SRC perl :tangle abbey
+if ($ARGV[0] eq "facts") {
+ my $line = ("ansible all -m gather_facts -e \@Secret/become.yml"
+ . " >facts");
+ print "$line\n";
+ my $status = system $line;
+ die "status: $status\nCould not run $line: $!\n" if $status != 0;
+ exit;
+}
+#+END_SRC
+
** The TZ Command
The abbey changes location almost weekly, so its timezone changes
#+CAPTION: [[file:abbey][=abbey=]]
#+BEGIN_SRC perl :tangle abbey
-my $ops = "config,new,old,pass,client,upgrade,reboots,versions,tz";
+my $ops = ("config,new,old,pass,client,"
+ ."upgrade,reboots,versions,facts,tz");
die "usage: $0 [$ops]\n";
#+END_SRC
"playbooks/versarch.yml");
}
+if ($ARGV[0] eq "facts") {
+ my $line = ("ansible all -m gather_facts -e \@Secret/become.yml"
+ . " >facts");
+ print "$line\n";
+ my $status = system $line;
+ die "status: $status\nCould not run $line: $!\n" if $status != 0;
+ exit;
+}
+
if ($ARGV[0] eq "tz") {
exec ("ansible-playbook", "-e", "\@Secret/become.yml",
"playbooks/timezone.yml");
}
-my $ops = "config,new,old,pass,client,upgrade,reboots,versions,tz";
+my $ops = ("config,new,old,pass,client,"
+ ."upgrade,reboots,versions,facts,tz");
die "usage: $0 [$ops]\n";