summaryrefslogtreecommitdiff
path: root/openbsd/frontends/Rexfile
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-04-13 21:45:00 +0100
committerPaul Buetow <paul@buetow.org>2022-04-13 21:45:00 +0100
commit3ba81b44973475765bb2bc7000d8d5cc9b38ec1a (patch)
treeb59e6604ced9ef457a245a2cd25495bf8f62f593 /openbsd/frontends/Rexfile
parent5fb38230b986bef238c74a670a678e2488bea507 (diff)
more on ha.pl and rexification
Diffstat (limited to 'openbsd/frontends/Rexfile')
-rw-r--r--openbsd/frontends/Rexfile22
1 files changed, 18 insertions, 4 deletions
diff --git a/openbsd/frontends/Rexfile b/openbsd/frontends/Rexfile
index 0ef0bfa..8f95339 100644
--- a/openbsd/frontends/Rexfile
+++ b/openbsd/frontends/Rexfile
@@ -1,5 +1,5 @@
use Rex -feature => ['1.4'];
-
+use File::Slurp;
group frontends => 'blowfish.buetow.org', 'twofish.buetow.org';
group dnsmaster => 'blowfish.buetow.org';
@@ -7,6 +7,7 @@ group dnsslaves => 'twofish.buetow.org';
user 'rex';
sudo TRUE;
+sudo_password read_file "$ENV{'HOME'}/.ssh/rex_password";
parallelism 5;
@@ -16,7 +17,7 @@ task 'id', group => 'frontends',
say $output;
};
-task 'dump-info', group => 'frontends',
+task 'dump_info', group => 'frontends',
sub { dump_system_information };
desc 'Get the uptime of all servers';
@@ -29,8 +30,21 @@ task 'uptime', group => 'frontends',
desc 'Setup inetd';
task 'inetd', group => 'frontends',
sub {
- my $output = run 'cat /etc/inetd.conf';
- say $output;
+ file '/etc/inetd.conf',
+ source => "./etc/inetd.conf",
+ on_change => sub {
+ service 'inetd' => 'restart';
+ };
+ };
+
+desc 'Setup failover';
+task 'failover', group => 'frontends',
+ sub {
+ file '/usr/local/bin/ha.pl',
+ source => "./usr/local/bin/ha.pl",
+ owner => 'root',
+ group => 'wheel',
+ mode => '755';
};
1;