Linuxday.at - Lightning Talk

1,313 views
1,208 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,313
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Linuxday.at - Lightning Talk

  1. 1. <ul>(R)?ex - A framework to simplify system administration </ul>
  2. 2. <ul>for s in $(cat $HOME/myserver.lst); do ssh root@$s “useradd -m myuser“ scp files/zabbix_agentd.conf root@$s:/etc/zabbix done </ul>
  3. 3. <ul>Hosted </ul><ul>Cloud Services </ul>
  4. 4. <ul>Configuration Management </ul>
  5. 5. <ul><li>(R)?ex - Remote Execution
  6. 6. CentOS, Debian, Fedora, Gentoo, Mageia, OpenSuSE, Ubuntu, ...
  7. 7. FreeBSD, NetBSD, OpenBSD
  8. 8. Solaris 10/11
  9. 9. CPAN </li></ul>
  10. 10. <ul>Wie funktioniert‘s? </ul><ul><li>Ganz grob, so was ähnliches wie Make
  11. 11. Es gibt ein Rexfile
  12. 12. Ein normales Perl Script </li></ul>
  13. 13. <ul><li>Userverwaltung
  14. 14. Paketverwaltung
  15. 15. Dienstverwaltung
  16. 16. Konfigurationsverwaltung
  17. 17. Filterregeln (iptables) </li></ul><ul>Configmanagement </ul>
  18. 18. <ul>Usermanagement </ul><ul>task “create_user“, sub { create_user “myuser“ => { groups => [“wheel“, “users“], password => “foobar“, ssh_key => “ssh-rsa AAAAB3NzaC1yc2EAAAADAQ...“, }; }; </ul><ul>bash# rex -H “server[1..9]“ create_user </ul>
  19. 19. <ul>Paketverwaltung </ul><ul>task “install_packages“, sub { install package => [ “ sudo“, “ apache2“, “ php5“, ... ]; }; </ul><ul>bash# rex -H “server[1..9]“ install_packages </ul>
  20. 20. <ul>Dienstverwaltung </ul><ul>task “start_services“, sub { service apache2 => “start“; service mysql => “start“; service apache2 => “ensure“, “started“; }; </ul><ul>bash# rex -H “server[1..9]“ start_services </ul>
  21. 21. <ul>Konfiguration </ul><ul>task “configure_monitoring“, sub { file “/etc/zabbix/zabbix_agentd.conf“, source => “files/etc/zabbix/zabbix_agentd.conf“, <li>owner => “root“,
  22. 22. group => “root“,
  23. 23. mode => 640,
  24. 24. on_change => sub { </li></ul><ul><ul><ul><ul><ul><li>service “zabbix-agentd“ => “restart“;
  25. 25. }, </li></ul></ul></ul></ul></ul><ul>}; </ul><ul>bash# rex -H “server[1..9]“ configure_monitoring </ul>
  26. 26. <ul>Konfiguration </ul># Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # Listen <%= $::eth0_ip %> :80 <% if( $::use_ssl ) { %> Listen <%= $::eth0_ip %> :443 <% } %>
  27. 27. <ul>Einfache Filterregeln </ul><ul>task “configure_iptables“, sub { open_port [22, 80]; close_port “all“; }; </ul><ul>bash# rex -H “server[1..9]“ configure_ iptables </ul>
  28. 28. <ul>Alles aufeinmal </ul><ul>task “prepare“, sub { create_user(); install_packages(); start_services(); configure_monitoring(); configure_iptables(); }; </ul><ul>bash# rex -H “server[1..9]“ prepare </ul>
  29. 29. <ul>Deployments </ul>
  30. 30. <ul>Freitag Nachmittags? </ul>
  31. 31. <ul>Rollback Szenario? </ul>
  32. 32. <ul>(R)?ex Module </ul><ul>Rex::Apache::Deploy </ul>
  33. 33. <ul><li>Nachvollziehbare Deployments
  34. 34. Testen des Deployments möglich
  35. 35. Rollbacks sind schnell gemacht </li></ul><ul><ul><li>Wenn man will auch automatisch wenn Tests fehlschlagen. </li></ul></ul>
  36. 36. <ul>Apache, lighttpd, ... </ul><ul>use Rex::Apache::Deploy &quot;Symlink&quot; ; </ul><ul>user &quot;deploy&quot; ; public_key &quot;/home/deploy/.ssh/id_rsa.pub&quot; ; private_key &quot;/home/deploy/.ssh/id_rsa&quot; ; </ul><ul>group &quot;php&quot; => &quot;php[01..04]&quot; ; </ul><ul>deploy_to &quot;/var/www&quot; ; document_root &quot;/var/www/html&quot; ; </ul><ul>desc &quot;Deploy Application&quot; ; task &quot;deploy&quot;, group => &quot;php&quot;, sub { </ul><ul>deploy &quot;myapp-1.0.0.tar.gz&quot; ; }; </ul>
  37. 37. <ul>Tomcat </ul><ul>use Rex::Apache::Deploy &quot;Tomcat&quot; ; </ul><ul>user &quot;deploy&quot; ; public_key &quot;/home/deploy/.ssh/id_rsa.pub&quot; ; private_key &quot;/home/deploy/.ssh/id_rsa&quot; ; </ul><ul>group &quot;tomcat&quot; => &quot;tomcat[01..04]&quot; ; </ul><ul>context_path &quot;/myapp&quot; ; </ul><ul>desc &quot;Deploy Application&quot; ; task &quot;deploy&quot;, group => &quot;tomcat&quot;, sub { </ul><ul>deploy &quot;myapp-1.0.0.war&quot;, username => &quot;manager-user&quot; , password => &quot;manager-password&quot; , port => 8080; }; </ul>
  38. 38. <ul>Danke für die Aufmerksamkeit. </ul><ul>http://rexify.org / </ul><ul>@jfried83 </ul>

×