This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Rex -feature => qw(1.3); | |
| user 'my_user_on_target'; | |
| #Rex::Config->set_openssh_opt( | |
| # LocalForward => 'localhost:2222 final.target.host:22' ); | |
| task 'runs_on_target', 'localhost:20000', sub { | |
| say run 'hostname'; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| time perl -MRedis::Fast -MPath::Tiny=path -E 'my $redis = Redis::Fast->new; my $fh = path($ARGV[0])->openr_raw; while (my $line = <$fh>) { chomp $line; $redis->rpush("adjust_logs", $line) }' ferki.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Rex -feature => ['1.4']; | |
| use DDP; | |
| task 'a', sub { | |
| my $cmdb = get cmdb; | |
| p $cmdb; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Rex -feature => ['1.4']; | |
| use DDP; | |
| desc 'Dump CMDB information'; | |
| no_ssh task 'dumpcmdb', sub { | |
| my $params = shift; | |
| my $cmdb = get cmdb( $params->{node}, $params->{host} ); | |
| p $cmdb; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set cmdb => { | |
| type => 'YAML', | |
| path => sub { | |
| my ( $self, $item, $server ) = @_; | |
| return ( "cmdb/$server.yml", "cmdb/default.yml" ); | |
| }, | |
| merge_behavior => 'LEFT_PRECEDENT', | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rex::Commands::Mkfs | |
| Rex::Cron::FreeBSD | |
| Rex::Helper::File::Spec | |
| Rex::Helper::File::Stat | |
| Rex::Helper::File::Stat::Unix | |
| Rex::Helper::File::Stat::Win32 | |
| Rex::Helper::Rexfile::ParamLookup | |
| Rex::Interface::Exec::IOReader | |
| Rex::Pkg::Arch | |
| Rex::Resource::firewall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| source=${1:-/} | |
| destination=${2:-/mnt/backup} | |
| rsync --archive \ | |
| --hard-links --human-readable --inplace --numeric-ids \ | |
| --delete --delete-excluded --progress \ | |
| --exclude-from $source/home/ferki/.backup/filter \ | |
| $source $destination |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
| user 'myuser'; | |
| environment production => sub { | |
| group destination => 'server1'; | |
| }; | |
| environment staging => sub { | |
| group destination => 'server2'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Rex -feature => [qw(1.4)]; | |
| set cmdb => { | |
| type => 'YAML', | |
| path => sub { | |
| my ( $self, $item, $server ) = @_; | |
| my @pathes; | |
| push @pathes, "cmdb/hosts/$server.yml"; | |
| push @pathes, "cmdb/items/$item.yml"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task 'hidden', sub { | |
| say q(Ssshh! I'm hiding!); | |
| }, { dont_register => TRUE }; |