Infrastruktur als Code
Wer bin ich? (Und wenn ja, wieviele?)
● Jan (1x)
● inovex / Systems Engineer (1x)
Und wenn sie nicht gestorben sind...
Von Hardware zu Software
Das muss schneller gehn!
Infrastruktur als Code
Rex - Remote Execution
● Community Projekt
● Agentenlos (ssh, push)
● Einfach zu bedienen
● Perl als Konfigurationssprache
● Alles beginnt in einem Rexfile
● Ein Rexfile enthält Authentifizierung,
Servergruppen, Tasks, ...
Rex - Remote Execution
● Viele Module/Funktionen
○ Dateimanipulation
○ Pakete
○ Services
○ Prozesse
○ Inventarisierung
○ Partitionierung, LVM
○ Virtualisierung, Cloud
○ ...
use Rex -feature => ["1.0"];
user "root";
private_key "keys/root.key";
public_key "keys/root.key.pub";
use Rex -feature => ["1.0"];
user "admin";
private_key "keys/admin.key";
public_key "keys/admin.key.pub";
sudo_password "f00b4r";
sudo TRUE;
use Rex -feature => ["1.0"];
user "root";
private_key "keys/root.key";
public_key "keys/root.key.pub";
group frontends => "fe-[01..10].int.lan",
"fe-preview.int.lan";
group backends => "be-[01..10].int.lan";
task "setup",
group => ["frontends", "backends"],
sub {
pkg ["httpd", "perl-Mojolicious"],
ensure => "present";
file "/etc/httpd/httpd.conf",
content => template("httpd.conf.tpl"),
owner => "root",
group => "root",
mode => 644,
on_change => sub { service httpd => "restart"; };
service "httpd",
ensure => "started";
};
$ rex setup
task "patch",
sub {
do_task [
qw/disable_in_lb patch_backends enable_in_lb/
];
};
task "patch_backends",
group => ["backends"],
sub {
update_package_db;
update_system;
};
$ rex patch
irc: irc.freenode.net #rex
Website: http://www.rexops.org/
Github: https://github.com/RexOps
Twitter: @RexOps
Danke

German Perl Workshop 2015 - Infrastruktur als Code

  • 1.
  • 2.
    Wer bin ich?(Und wenn ja, wieviele?) ● Jan (1x) ● inovex / Systems Engineer (1x)
  • 3.
    Und wenn sienicht gestorben sind...
  • 9.
  • 10.
  • 11.
  • 13.
    Rex - RemoteExecution ● Community Projekt ● Agentenlos (ssh, push) ● Einfach zu bedienen ● Perl als Konfigurationssprache ● Alles beginnt in einem Rexfile ● Ein Rexfile enthält Authentifizierung, Servergruppen, Tasks, ...
  • 14.
    Rex - RemoteExecution ● Viele Module/Funktionen ○ Dateimanipulation ○ Pakete ○ Services ○ Prozesse ○ Inventarisierung ○ Partitionierung, LVM ○ Virtualisierung, Cloud ○ ...
  • 15.
    use Rex -feature=> ["1.0"]; user "root"; private_key "keys/root.key"; public_key "keys/root.key.pub";
  • 16.
    use Rex -feature=> ["1.0"]; user "admin"; private_key "keys/admin.key"; public_key "keys/admin.key.pub"; sudo_password "f00b4r"; sudo TRUE;
  • 17.
    use Rex -feature=> ["1.0"]; user "root"; private_key "keys/root.key"; public_key "keys/root.key.pub"; group frontends => "fe-[01..10].int.lan", "fe-preview.int.lan"; group backends => "be-[01..10].int.lan";
  • 18.
    task "setup", group =>["frontends", "backends"], sub { pkg ["httpd", "perl-Mojolicious"], ensure => "present"; file "/etc/httpd/httpd.conf", content => template("httpd.conf.tpl"), owner => "root", group => "root", mode => 644, on_change => sub { service httpd => "restart"; }; service "httpd", ensure => "started"; };
  • 19.
  • 20.
    task "patch", sub { do_task[ qw/disable_in_lb patch_backends enable_in_lb/ ]; }; task "patch_backends", group => ["backends"], sub { update_package_db; update_system; };
  • 21.
  • 22.
    irc: irc.freenode.net #rex Website:http://www.rexops.org/ Github: https://github.com/RexOps Twitter: @RexOps Danke