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 strict; | |
| use warnings; | |
| use Rex -feature => [ '1.4', 'exec_autodie' ]; | |
| use Time::HiRes qw(time); | |
| use Minion; | |
| my $minion = Minion->new( SQLite => 'sqlite:/tmp/minion.backend' ); | |
| add_minion_tasks(); |
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
| 3060 2 | |
| 2023 4 | |
| 340 9 | |
| 309 10 | |
| 285 12 | |
| 255 1 | |
| 232 3 | |
| 171 8 | |
| 153 5 | |
| 114 7 |
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
| function timer_start { | |
| timer=${timer:-$SECONDS} | |
| } | |
| function timer_stop { | |
| exit_code=$? | |
| timer_show=$(($SECONDS - $timer)) | |
| unset timer | |
| } |
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
| $include /etc/inputrc | |
| # allow the use of the Delete/Insert keys | |
| "\e[P": delete-char | |
| "\e[4h": quoted-insert | |
| "\e[5~": history-search-backward | |
| "\e[6~": history-search-forward | |
| set colored-stats On |
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 }; |
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
| 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
| #!/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
| 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
| set cmdb => { | |
| type => 'YAML', | |
| path => sub { | |
| my ( $self, $item, $server ) = @_; | |
| return ( "cmdb/$server.yml", "cmdb/default.yml" ); | |
| }, | |
| merge_behavior => 'LEFT_PRECEDENT', | |
| }; |