Skip to content

osal.linux #

fn new #

fn new(args LinuxNewArgs) !LinuxFactory

return screen instance

fn play #

fn play(mut plbook PlayBook) !

struct LinuxFactory #

@[heap]
struct LinuxFactory {
pub mut:
	username string
}

fn (LinuxFactory) check_root #

fn (mut lf LinuxFactory) check_root() !

Check if running as root

fn (LinuxFactory) sshkey_create #

fn (mut lf LinuxFactory) sshkey_create(args SSHKeyCreateArgs) !

Create SSH key for user

fn (LinuxFactory) sshkey_delete #

fn (mut lf LinuxFactory) sshkey_delete(args SSHKeyDeleteArgs) !

Delete SSH key for user

fn (LinuxFactory) user_create #

fn (mut lf LinuxFactory) user_create(args UserCreateArgs) !

Create a new user with all the configuration

fn (LinuxFactory) user_delete #

fn (mut lf LinuxFactory) user_delete(args UserDeleteArgs) !

Delete a user

struct LinuxNewArgs #

@[params]
struct LinuxNewArgs {
pub:
	username string
}

struct SSHKeyCreateArgs #

@[params]
struct SSHKeyCreateArgs {
pub mut:
	username    string @[required]
	sshkey_name string @[required]
	sshkey_pub  string
	sshkey_priv string
}

struct SSHKeyDeleteArgs #

@[params]
struct SSHKeyDeleteArgs {
pub mut:
	username    string @[required]
	sshkey_name string @[required]
}

struct UserCreateArgs #

@[params]
struct UserCreateArgs {
pub mut:
	name        string @[required]
	giteakey    string
	giteaurl    string
	passwd      string
	description string
	email       string
	tel         string
	sshkey      string // SSH public key
}

struct UserDeleteArgs #

@[params]
struct UserDeleteArgs {
pub mut:
	name string @[required]
}