Skip to content

Instantly share code, notes, and snippets.

@rwp0
Last active July 5, 2022 12:17
Show Gist options
  • Save rwp0/a4fee5083dc7c0b863f5dbe7b8d16974 to your computer and use it in GitHub Desktop.
Save rwp0/a4fee5083dc7c0b863f5dbe7b8d16974 to your computer and use it in GitHub Desktop.
FreeBSD package upgrade with Perl's Rex automation
use v5.36;
use Rex -feature => [ '1.4' ];
port 2222; # custom port
user 'root'; # PermitRootLogin prohibit-password
private_key '<path to SSH key>';
# password "<SSH key's passphrase>"; # passphrase if any
key_auth;
group servers => qw(
s3.exaple.com
s10.exaple.com
s23.exaple.com
s24.exaple.com
);
desc 'Install utility packages'; # describe task, description shown in rex -T
task 'install_packages',
group => 'servers',
sub {
my @packages = qw(
tmux
ccze
moreutils
cmdwatch
p5-Archive-Tar
p5-Config-General
git-lite
);
pkg( [ @packages ], ensure => 'present' );
# first argument is arrayref to install in batch (undocumented)
};
@rwp0
Copy link
Author

rwp0 commented Jul 5, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment