Forum Discussion
bsdpruegelknabe
Nimbostratus
Nov 03, 2008create_user doesn't work or I'm to dumb?!
Hello,
the most possibillity is that I didn't understood to use create_user propperly...
Well, I hope anyone can help me here.
I use perl (yeah, I know, bite me... ;-p ) t...
bsdpruegelknabe
Nimbostratus
Dec 10, 2008Thats the code I use:
my $host='hostnameoflb';
my %urls=(
'url' => "https://$host:443/iControl/iControlPortal.cgi",
'uri_usermgmt' => 'urn:iControl:Management/UserManagement',
);
my @admins=("smurf", "gargamel", "azrael");
my $do=create_user(
'admins' => \@admins,
);
sub create_user {
my %config=@_;
for (@{$config{'admins'}}) {
my $pass='';
push @userdef, {
'user' => {
'name' => $_,
'full_name' => $_,
},
'role' => 'USER_ROLE_ADMINISTRATOR',
'password' => $pass,
'home_directory' => '/home/'.$_,
'login_shell' => '/bin/false',
'user_id' => '0',
'group_id' => '500',
}
}
my $soap=soap_object('uri' => $urls{'uri_usermgmt'});
my $res=$soap->create_user(SOAP::Data->name('users' => [@userdef]));
}
sub soap_object {
my %config=@_;
my $soap=SOAP::Lite
-> uri($config{'uri'})
-> proxy($urls{'url'});
eval { $soap->transport->http_request->header( 'Authorization' => 'Basic '.$enc_credentials ); };
return $soap;
}
The only thing what is missing at this codesniped is the creation of guestusers. But thats likewise the 'for (@{$config{'admins'}}) {' part and the content of @admins comes from a file or database.
cu,
bsdpruegelknabe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects