Archer::Plugin::Exec::Remote - Archer::Plugin::Exec::Remote documentation


Archer documentation Contained in the Archer distribution.

Index


Code Index:

NAME

Top

Archer::Plugin::Exec::Remote -

SYNOPSIS

Top

    - module: Exec::Remote
      config:
        name: restart
        user: root
        command: "if [ -e /etc/init.d/apache ] ; then  /etc/init.d/apache stop; sleep 6; /etc/init.d/apache start; fi"
        type: app

DESCRIPTION

Top

should be use in 'process' phase?

TODO

Top

  use Net::SSH::Perl


Archer documentation Contained in the Archer distribution.

package Archer::Plugin::Exec::Remote;
use strict;
use warnings;
use base qw/Archer::Plugin::Exec/;

sub _execute {
    my ($self, $cmd, $args) = @_;

    my $real_command = "ssh $self->{server} $cmd";
    $real_command = "sudo -u $self->{config}->{user} $real_command" if $self->{config}->{user};
    $self->log(debug => "real execute: $real_command");

    system $real_command; # XXX security!!!
}

1;
__END__