Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
App::LDAP - 管理者と百台のコンピュータ #YAPC::Asia 2012
Search
shelling
September 30, 2012
Technology
2
510
App::LDAP - 管理者と百台のコンピュータ #YAPC::Asia 2012
Introduction to App::LDAP, YAPC::Asia 2012
shelling
September 30, 2012
Tweet
Share
More Decks by shelling
See All by shelling
Distributed Storage for Web Applications
shelling
3
660
Other Decks in Technology
See All in Technology
ABEMA のコンテンツ制作を最適化!生成 AI x クラウド映像編集システム / abema-ai-editor
cyberagentdevelopers
PRO
1
180
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
350
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
160
20241031_AWS_生成AIハッカソン_GenMuck
tsumita
0
110
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
3
590
独自ツール開発でスタジオ撮影をDX!「VLS(Virtual LED Studio)」 / dx-studio-vls
cyberagentdevelopers
PRO
1
180
初心者に Vue.js を 教えるには
tsukuha
5
390
生成AIの強みと弱みを理解して、生成AIがもたらすパワーをプロダクトの価値へ繋げるために実践したこと / advance-ai-generating
cyberagentdevelopers
PRO
1
180
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
140
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
Documentation Writing (for coders)
carmenintech
65
4.4k
Fireside Chat
paigeccino
32
3k
Happy Clients
brianwarren
97
6.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
290
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
What's in a price? How to price your products and services
michaelherold
243
12k
A designer walks into a library…
pauljervisheath
202
24k
Ruby is Unlike a Banana
tanoku
96
11k
Transcript
App::LDAP 管理者と百台のコンピュータ shelling Sunday, September 30, 12
#!/me use qw(perl ruby javascript); use feature qw(css elisp); twitter
“shellingford”; github “shelling”; cpan “shelling”; Sunday, September 30, 12
Review Sunday, September 30, 12
/etc/passwd /etc/shadow LDAP Server Sunday, September 30, 12
network file system samba account netgroup network printers ... Sunday,
September 30, 12
new . Sunday, September 30, 12
ldap-utils LDAP Server Sunday, September 30, 12
LDIF#add ldapmodify -a -f dn: uid=jason8936,ou=people,dc=example,dc=com uid: jason8936 cn: jason8936
sn: jason8936 mail:
[email protected]
objectClass: inetOrgPerson objectClass: posixAccount objectClass: top objectClass: shadowAccount userPassword: {crypt}$6$Hk7MFO3..... shadowMax: 99999 shadowWarning: 7 loginShell: /bin/bash uidNumber: 1020 gidNumber: 1020 homeDirectory: /home/jason8936 Sunday, September 30, 12
LDIF#modify ldapmodify -f dn: uid=jason8936,ou=people,dc=example,dc=com changetype: modify delete: mail mail:
[email protected]
- add: mail mail:
[email protected]
mail:
[email protected]
Sunday, September 30, 12
LDIF#delete ldapmodify -f dn: uid=jason8936,ou=people,dc=example,dc=com changetype: delete Sunday, September 30,
12
Drawbacks • Time-Consumed • Not Quite Convenient • Not Abstract
Enough Sunday, September 30, 12
Demo https://vimeo.com/50077777 Sunday, September 30, 12
Demo https://vimeo.com/50077777 Sunday, September 30, 12
under the hood Sunday, September 30, 12
MVC $ ldap add user foo Controller Model LDAP Server
(CRUD)able Sunday, September 30, 12
User Group Host Sudoer Controller & Dispatcher $ ldap add
user foo Command Add Del Passwd Export User Group Host Sudoer App::LDAP:: use qw( Namespace::Dispatch MooseX::Getopt ); sub run { ... } foo Sunday, September 30, 12
Model & Schema top posixAccount person organizationalPerson inetOrgPerson shadowAccount posixGroup
ipHost LDIF::User LDIF::Group RFC2307 RFC2798 Sunday, September 30, 12
just class package person; use Moose; extends ‘top’; has ...
=> ...; package organizationalPerson; use Moose; extends ‘person’; has ... => ...; Sunday, September 30, 12
required => ? objectclass ( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'an
account with POSIX attributes' SUP top AUXILIARY MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) ) 1 0 RFC2307 has cn => ( required => ); Sunday, September 30, 12
isa => ? attributetype ( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'An
integer identifying a user' EQUALITY integerMatch SYNTAX ‘INTEGER’ SINGLE-VALUE ) attributetype ( 1.3.6.1.1.1.1.12 NAME 'memberUid' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX ‘IA5String’ ) ArrayRef[Str] Num Not SINGLE-VALUE RFC2307 Sunday, September 30, 12
Ext#1 package App::LDAP::ObjectClass::Foo; use Moose; has ‘a_attribute’ => ( is
=> “rw”, isa => “...”, required => 1 or 0, ); ... Sunday, September 30, 12
Ext#2 package App::LDAP::LDIF::Foo; use Moose; extends “App::LDAP::ObjectClass::Foo”; has ‘+a_attribute’ =>
( default => “...”, ); ... Sunday, September 30, 12
Ext#3 package App::LDAP::Command::Foo; use Moose; with “App::LDAP::Role::Command”; sub run {
my $self = @_; App::LDAP::LDIF::Foo->... } ... Sunday, September 30, 12
NextStep#1 User->search( cn => “shelling ford”, mail => “
[email protected]
” );
Sunday, September 30, 12
NextStep#2 $user->modify( cn => “shelling ford”, mail => “
[email protected]
” );
Sunday, September 30, 12
NextStep#3 config(“/nss/passwd”); config(“/nss/group”); Sunday, September 30, 12
UseCase#1 LDAP NFS orker /home/ Worker Worker Worker Work look
up sudoers mount Sunday, September 30, 12
UseCase#2 galera1 galera2 galera3 LDAP galera3’ look up hosts 10.1.193.205
10.1.132.173 Sunday, September 30, 12
Conclusions Not a replacement to ldap-utils Saving your time on
routines help you to create correct LDIFs Sunday, September 30, 12
Thank You http://github.com/shelling/app-ldap pull request & issues welcome Sunday, September
30, 12