diff options
| author | Paul Buetow <paul@buetow.org> | 2022-04-15 16:05:51 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-04-15 16:05:51 +0100 |
| commit | facb0483b52cd9e171d48a078ca2d78d36abaf54 (patch) | |
| tree | 3ce6a74f51300bd2b0db01a97eca0d6bcfd498ac /openbsd/frontends/Rexfile | |
| parent | de6175300bd4fe3106c5b5b3af6c72519369e673 (diff) | |
rexification of more
Diffstat (limited to 'openbsd/frontends/Rexfile')
| -rw-r--r-- | openbsd/frontends/Rexfile | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/openbsd/frontends/Rexfile b/openbsd/frontends/Rexfile index 756b326..0d16905 100644 --- a/openbsd/frontends/Rexfile +++ b/openbsd/frontends/Rexfile @@ -13,17 +13,65 @@ parallelism 5; task 'id', group => 'frontends', sub { say run 'id' }; task 'dump_info', group => 'frontends', sub { dump_system_information }; +our $ipv6address = sub { + my $hostname = shift; + return '2a01:4f8:c17:20f1::42' if $hostname eq 'blowfish'; + return '2401:c080:1000:45af:5400:3ff:fec6:ca1d' if $hostname eq 'twofish'; + return '::1'; +}; + +desc 'Install various packages'; +task 'packages', group => 'frontends', + sub { + pkg 'rsync', ensure => present; + pkg 'sudo', ensure => present; + pkg 'tig', ensure => present; + pkg 'vger', ensure => present; + pkg 'zsh', ensure => present; + }; + +desc 'Setup httpd'; +task 'httpd', group => 'frontends', + sub { + file '/etc/httpd.conf', + source => './etc/httpd.conf', + owner => 'www', + group => 'wheel', + mode => '644', + on_change => sub { + service 'httpd' => 'restart'; + }; + service 'httpd', ensure => 'started'; + }; + desc 'Setup inetd'; task 'inetd', group => 'frontends', sub { file '/etc/inetd.conf', source => './etc/inetd.conf', + owner => 'www', + group => 'wheel', + mode => '644', on_change => sub { service 'inetd' => 'restart'; }; service 'inetd', ensure => 'started'; }; +desc 'Setup relayd'; +task 'relayd', group => 'frontends', + sub { + file '/etc/relayd.conf', + content => template('./etc/relayd.conf.tpl', ipv6address => $ipv6address), + owner => 'root', + group => 'wheel', + mode => '600', + on_change => sub { + service 'relayd' => 'restart'; + }; + service 'relayd', ensure => 'started'; + }; + desc 'Setup HA'; task 'ha', group => 'frontends', sub { @@ -44,7 +92,10 @@ task 'ha', group => 'frontends', desc 'frontend'; task 'frontend', group => 'frontends', sub { + packages(); + httpd(); inetd(); + relayd(); ha(); }; |
