From 3c5dd7b335f0618046bacc03900a4b8b354309cd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 08:08:15 -0400 Subject: First implementation of server top-level profile --- profiles/server.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 profiles/server.py diff --git a/profiles/server.py b/profiles/server.py new file mode 100644 index 00000000..fcb33ee8 --- /dev/null +++ b/profiles/server.py @@ -0,0 +1,30 @@ +# Used to select various server application profiles on top of a minimal installation. + +import archinstall, os, logging + +is_top_level_profile = True + +available_servers = ["docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. + """ + selected_servers = archinstall.generic_multi_select(available_servers, f"Choose which servers to install and enable (leave blank for a minimal installation): ") + archinstall.storage['_selected_servers'] = selected_servers + + return True # Do nothing and just return True + +if __name__ == 'server': + """ + This "profile" is a meta-profile. + """ + archinstall.log(f'Now installing the selected servers.', level=logging.INFO) + archinstall.log(archinstall.storage['_selected_servers'], level=logging.DEBUG) + for server in archinstall.storage['_selected_servers']: + archinstall.log(f'Installing {server} ...', level=logging.INFO) + app = archinstall.Application(installation, server) + app.install() + + archinstall.log('If your selections included multiple servers with the same port, you may have to reconfigure them.', fg="yellow", level=logging.INFO) -- cgit v1.2.3-70-g09d2 From 5e567b6f3b1372e97bd97b7461b39db528c5a843 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 29 Apr 2021 10:39:01 -0400 Subject: Remove a comment --- profiles/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/server.py b/profiles/server.py index fcb33ee8..fab4e7cf 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -14,7 +14,7 @@ def _prep_function(*args, **kwargs): selected_servers = archinstall.generic_multi_select(available_servers, f"Choose which servers to install and enable (leave blank for a minimal installation): ") archinstall.storage['_selected_servers'] = selected_servers - return True # Do nothing and just return True + return True if __name__ == 'server': """ -- cgit v1.2.3-70-g09d2 From af3d85dc7d2ff86531766b9b819009e0c1a659c1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 11:41:57 -0400 Subject: Add cockpit, depends on #396 --- profiles/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/server.py b/profiles/server.py index fab4e7cf..9d28054d 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -4,7 +4,7 @@ import archinstall, os, logging is_top_level_profile = True -available_servers = ["docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] +available_servers = ["cockpit", "docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2