Virtualmin automatic postinstall wizard

10 posts / 0 new
Last post
#1 Mon, 01/15/2018 - 16:40
scooty

Virtualmin automatic postinstall wizard

Hello,

I need to create fully automated virtualmin install so I have to skip manual post installation wizard, I don't see any CLI tool for this so I'm wondering how can I make workaround for this. I made a list of post-installation wizard steps and how I can do them manually. Could someone look at this and check if it's complete and should work fine? I'm afraid that post-install script making something in background and I don't know about it.

  • Preload Virtualmin libraries? - /etc/webmin/virtual-server/config: preload_mode=
  • Run email domain lookup server? config-system
  • Run ClamAV server scanner? config-system
  • Run SpamAssassin server filter? config-system
  • Run MySQL database server? config-system
  • Run PostgreSQL database server? config-system
  • Set MySQL password: virtualmin set-mysql-pass --user root --pass NEWPASS, /etc/webmin/mysql/config
  • MySQL configuration size - probably should manually change my.cnf
  • Primary nameserver, Secondary nameservers (optional): /etc/hosts
  • Password storage mode (plain-text / only hashed): /etc/webmin/virtual-server/config: hashpass: 1

After all changes i need to set wizard_run=1 in /etc/webmin/virtual-server/config to avoid showing this script in web panel.

Tue, 01/16/2018 - 09:21
unborn
unborn's picture

hi - what a nonsense you on about? - https://www.virtualmin.com/documentation/developer/cli

  • 'After all changes i need to set' -- your brain working again...

Configuring/troubleshooting Debian servers is always great fun

Tue, 01/16/2018 - 10:49
Joe
Joe's picture

Unborn, it's a valid question. There's no need to criticize a legitimate question.

The CLI actually doesn't solve the problem (but should, and I've added it to my to-do list).

There's a way to tell Virtualmin that the wizard has already run. I will follow up shortly, when my internet comes back (winter storm has knocked it out, so I'm on my phone).

--

Check out the forum guidelines!

Fri, 01/19/2018 - 08:16
scooty

Joe, thanks for reply.

'There's a way to tell Virtualmin that the wizard has already run" - I've mentioned it in my first post: "wizard_run=1 in /etc/webmin/virtual-server/config" The CLI actually doesn't solve the problem (but should, and I've added it to my to-do list). - it's great to hear that! but until it's impossible, is my idea of workaround should work fine?

Mon, 01/22/2018 - 12:25 (Reply to #4)
Joe
Joe's picture

Yes, this is how I've handled automating setup in the past; it's not really that painful, as-is...most programming languages have facilities for easily handling the key=value config file format we use. I've mostly used sed since it's just a simple substitution problem in most cases, so each config change is a one-liner.

But, it would be nice if it were even easier and more self-documenting than that. I'm actually planning to introduce a webmin CLI in the 2.0 branch which is coming in the next few weeks, I think. I'd like to be able to do things like changing any config option for any Webmin module from the CLI, initiating a module installation from the command line, modifying a user, etc.

e.g. to make a change to a config variable, you'd do something like:

# webmin set-config virtual-server wizard_run 1

It's a little bit verbose, but it is general and would cover any Webmin module including those we don't maintain, which would be pretty powerful, I think, for scripting purposes. And, it'd be possible to do it via a web request (since we'd implement the same sort of HTTP API as in Virtualmin, though I might like it to be more REST-ful than the current API, which is somewhat old-fashioned), as well, making managing fleets of Virtualmin servers nicer. The amount code to accomplish this isn't very high; a few hundred lines of code, maybe. And, the benefits will be pretty big for anyone with a lot of servers to deploy and manage.

--

Check out the forum guidelines!

Sun, 01/20/2019 - 16:28 (Reply to #5)
ice

Hi @Joe,

Is your webmin CLI available and ready for use? I am not able to find anything related to this on google.

Mon, 01/22/2018 - 10:56
scooty

Hi KitchM,

I want to create ansible script which will create VPS with virtualmin from A to Z, automatically. Settings will come from ansible parameters. I need to skip post-install wizard because non-technical people will use it. Ansible will create virtual servers etc. and end-users will have access to manage email accounts(for ex.). It could be many servers so I can't log in to each of them manually and go through post-install process.

Tue, 01/30/2018 - 06:03
scooty

ok, Thanks for Your opinion KitchM

Sun, 01/20/2019 - 15:49
ice

Hi scooty,

Have you ever find a way to bypass the post installation wizard? I am trying to do the same automation thing but on a chef cookbook.

Please let me know. Thank you!

Wed, 01/23/2019 - 16:45
ok-world

Hi,

also interested in this question. I'm workin on installing virtualmin by running shell script. Aka wget -q -O - https://<my-site>/virtualmin.sh | sh . This script downloads and installs all needed packages to clean system, makes required changes in config files. And the system is ready to use. It's trouble for lot of clients to make something more than that. And same about postinstall wizard. So the idea is to create the script which can set up virtualmin and short manual how to use it for own site and e-mail server.

Thanks.

Topic locked