Top Banner
Linux Desktop Automation
39

Linux Desktop Automation

Jul 25, 2015

Download

Technology

Rui Lapa
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Linux Desktop Automation

Linux Desktop Automation

Page 2: Linux Desktop Automation

Rui LapaSenior Linux System Administrator

MeOutsourcerFreelancer

Page 3: Linux Desktop Automation

Linux NewbiesJunior SysAdmin2010-04 2013-07 2014-09

TeamMicro TeamAlmost 6 years

Senior SysAdmin 2014-122009-02

Page 4: Linux Desktop Automation

Central Farm

Solutions3 DifferentLAN and Internet

Laptops Local Stations

800x

Page 5: Linux Desktop Automation

17x

2x

IBM HS2120x

ServersProduction/Tests and SupportReal and Virtual

WebDBDNSCloningLocal MirrorRadiusVPNWi-FiPrintMonitoringDeploymentAutomationLBDesktops...

Page 6: Linux Desktop Automation

Work StationUsers ViewDesktop

Applications

Page 7: Linux Desktop Automation

Work StationHelp Desk ViewShared

5x Service Desk 5x Field Support

Applications Settings

Manager

Page 8: Linux Desktop Automation

Work StationVirtual View System AdministratorOperating System?

Applications Settings Operating System

Page 9: Linux Desktop Automation

Work StationReal View System AdministratorTotal management

Applications Settings Operating System

Updates Global Changes Inventory Validation

User Profile Security Remote Access

Network Profile Operation Automation

Monitoring 3ª Line Help Desk

Administration Solution Architect

Engineering

Project Management

<

Page 10: Linux Desktop Automation

Total ManagementZero CostOpen Source

Clone Lapa?

Applications Settings Operating System

Updates Global Changes Inventory Validation

User Profile Security Remote Access

Network Profile Operation Automation

Monitoring 3ª Line Help Desk

Administration Solution Architect

Engineering

Project Management

Page 11: Linux Desktop Automation

DevOpsDevelopmentOperation

DEV OPS

Page 12: Linux Desktop Automation

PuppetWhy?Help!

Settings Operating System

- Unix/Windows

- Equipment Access Control (Certificates)

- Team Access Control (Role Based Access Control)

- Puppet Forge

- Easy Learning

- Rules are interpreted in Runtime based on programmable Facts

Page 13: Linux Desktop Automation

PuppetForgeApt Puppet Labs

Settings Operating System

> puppet module install puppetlabs-apt

</etc/puppet>/modules/trusty/manifests/apt.pp

class trusty::apt {

class { '::apt': always_apt_update => false, disable_keys => undef, purge_sources_list => true, purge_sources_list_d => false, purge_preferences_d => false }

apt::key { 'puppetlabs': key => '4BD6EC30', key_server => 'keyserver.ubuntu.com', }

apt::source { 'puppetlabs-trusty': location => 'http://mirror/puppetlabs', release => 'trusty', repos => 'main dependencies', key => '4BD6EC30', key_server => 'keyserver.ubuntu.com', include_src => false, }}

Page 14: Linux Desktop Automation

PuppetExample 1Ubuntu Trusty

Settings Operating System

class trusty::postfix {

package { 'postfix': ensure => latest }

file { '/etc/mailname': notify => Service['postfix'], content => "$::fqdn\n", require => Package['postfix'], }

file { '/etc/postfix/main.cf': ensure => present, mode => '0644', owner => root, group => root, content => template('trusty/postfix/main.cf'), notify => Service['postfix'], require => Package['postfix'], }

service { 'postfix': ensure => running, enable => true, require => Package['postfix'], provider => init, subscribe => [ Package['postfix'], File['/etc/postfix/main.cf'], File['/etc/aliases'] ] }}

Page 15: Linux Desktop Automation

PuppetExample 2Common

Settings Operating System

define model_ppd( $ppd ) {

file { "/etc/cups/provision/ppd/${title}.ppd": ensure => present, mode => '0644', owner => lp, group => lp, source => "puppet:///modules/common/cups/ppd/${ppd}", require => File['/etc/cups/provision/ppd/'] }

}

class common::cups_update_ppd {

file { '/etc/cups/provision/': ensure => directory, mode => '0755', owner => lp, group => lp, }

file { '/etc/cups/provision/ppd/': ensure => directory, mode => '0755', owner => lp, group => lp, require => File['/etc/cups/provision/'] }

model_ppd { 'bizhub36': ppd => 'bizhub36.ppd', }}

Page 16: Linux Desktop Automation

PuppetFile SystemGIT

Devs

DEV

Settings Operating System

Page 17: Linux Desktop Automation

Puppetpuppet_node_classifierHistory

Puppet – Dashboard – History

common::userscommon::java

trusty::firefox

radius::freeradius...

OPS

Settings Operating System

Page 18: Linux Desktop Automation

PuppetClassificationDB

Portal / Provision Server – Model/Function/Image

Vivo PC - Trusty - 20140808Vivo PC - Trusty - 20141208

Asus P52F - 20140710PuppetMaster - 20140809

Radius - 20131001...

Puppet – Models

NN

N + N + Filtro Nome

(“serverp.*, server\d{2}", "serverp*, !serverp01", ".*, !serverp01”)

Puppet – Class

common::userscommon::java

trusty::firefox

radius::freeradius ...

DEV

OPS

Settings Operating System

Page 19: Linux Desktop Automation

DevOpsActionsMore Help?

DEV OPS

Page 20: Linux Desktop Automation

DevOpsDevelopmentOperation

Applications Settings

- Cluster e HA

- Web UI

- Authentication and Authorization

- Message with TTL

- Multiple Client Programming Languages

- AMQP, STOMP, MQTT, HTTP

...

Page 21: Linux Desktop Automation

RabbitMQComparisonOther MQs

Applications Settings

RabbitMQ is one of the leading implementation of the AMQP protocol (along with Apache Qpid). Therefore, it implements a broker architecture, meaning that messages are queued on a central node before being sent to clients.This approach makes RabbitMQ very easy to use and deploy, because advanced scenarios like routing, load balancing or persistent message queuing are supported in just a few lines of code.However, it also makes it less scalable and “slower” because the central node adds latency and message envelopes are quite big.

ZeroMQ is a very lightweight messaging system specially designed for high throughput/low latency scenarioslike the one you can find in the financial world.Zmq supports many advanced messaging scenarios but contrary to RabbitMQ, you’ll have to implement most of them yourselfby combining various pieces of the framework (e.g : sockets and devices).Zmq is very flexible but you’ll have to study the 80 pages or so of the guide(which I recommend reading for anybody writing distributed system, even if you don’t use Zmq) before being able to do anything more complicated that sending messages between 2 peers.

ActiveMQ is in the middle ground.Like Zmq, it can be deployed with both broker and P2P topologies.Like RabbitMQ, it’s easier to implement advanced scenarios but usually at the cost of raw performance.It’s the Swiss army knife of messaging :-).

Finally, all 3 products:• Have client APIs for the most common languages (C++, Java, .Net, Python, Php, Ruby, …)• Have strong documentation• Are actively supported

(Source: http://stackoverflow.com/questions/731233/activemq-or-rabbitmq-or-zeromq-or)

Page 22: Linux Desktop Automation

RabbitMQAutomationsINPUT

Portal / Provision

Applications Settings

Actions

Inventory

DNS Update

Help Desk

Page 23: Linux Desktop Automation

RabbitMQAutomationsOUTPUT

Portal / Provision

Applications Settings

Actions

Passwords Expire Notification

User Profile- Drives- Printers- Applications

Messages

Update local NSS

OPS

Page 24: Linux Desktop Automation

RabbitMQRetries and statusMySQL Table

Portal / Provision

MQ - Tasks

TaskTargetCorrelation ID BodyReplyStatusRetriesExpireAuthor

Applications Settings

DEV

Page 25: Linux Desktop Automation

DevOpsHelp DeskMore Help?

DEV OPS

Help Desk

Page 26: Linux Desktop Automation

RabbitMQAutomationsOUTPUT

Portal / Provision

Applications Settings

Actions

Profile Recreation

Application Kill

Backup e Restore

Help Desk

Page 27: Linux Desktop Automation

DevOpsDevelopmentOperation

Applications Settings Operating System

Page 28: Linux Desktop Automation

Portal / Provision

Applications Settings Operating System

KnowledgeCentralized and SharedHistory and Inventory

Page 29: Linux Desktop Automation

Help DeskCloningUpdates

Help Desk

Page 30: Linux Desktop Automation

PXE

CloningRsync + Automation + InventoryLinux e Windows

(Mac + Image + Prefix)→

Nome

Linux/WindowsImagesISOs

OPS

Help Desk

Page 31: Linux Desktop Automation

CustomPackages

OfficialMirrors

Images

Mirror

Servers

UpdatesMirrorImages

DEV OPS

Page 32: Linux Desktop Automation

PuppetCode ReviewGIT

Admins

DEV

Settings Operating System

CodeReview

Page 33: Linux Desktop Automation

AutomationsOldNot fully updated/migrated

Page 34: Linux Desktop Automation

Active Directory

Logon Scripts

Name

Email

Company

Department

Account Expiration Date

Password Expiration Date

Logon Scripts

Printers

Drives Rede

Quota Configured

Quota Usada

Provision

NFS

Data OriginAD + LogonsNFS

Page 35: Linux Desktop Automation

Active DirectoryNIS

UID

GID

Shell

Home

Provision

Data DestinationMySQL + SFUUnix Attributes

Page 36: Linux Desktop Automation

Printing - Provision - PrintersBD → GIT → PuppetManual

Admins

Portal / ProvisionPrinter

BrandModelLocationIPMacPPD FileDefault Settings

Page 37: Linux Desktop Automation

Radius

RadiusWi-FiWPA2-PEAP e TLS

Portal / Provision

Mac Address Authorization

User / HostnameEmailEmail SentEmail WhenMacMac ManufacturerVLANAuthorization Author

AD

Page 38: Linux Desktop Automation

“Insanity:

doing the same thingover and over

again and expecting different results

Page 39: Linux Desktop Automation

Name Rui LapaEmail [email protected]

Thank you