Add --start flag for create command

This commit is contained in:
Jip-Hop 2024-03-02 17:34:55 +01:00
parent 2b104682b5
commit ac75cd3c28
5 changed files with 10 additions and 4 deletions

View File

@ -1192,6 +1192,7 @@ def create_jail(**kwargs):
if not check_jail_name_available(jail_name): if not check_jail_name_available(jail_name):
return 1 return 1
start_now = kwargs.pop("start", start_now)
jail_config_path = kwargs.pop("config") jail_config_path = kwargs.pop("config")
config = KeyValueParser() config = KeyValueParser()
@ -1928,6 +1929,11 @@ def main():
) )
commands["create"].add_argument("--distro") commands["create"].add_argument("--distro")
commands["create"].add_argument("--release") commands["create"].add_argument("--release")
commands["create"].add_argument(
"--start", #
help="start jail after create",
action="store_true",
)
commands["create"].add_argument( commands["create"].add_argument(
"--startup", "--startup",
type=int, type=int,

View File

@ -2,4 +2,4 @@
## Setup ## Setup
Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/docker/config mydockerjail`. Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/docker/config mydockerjail`.

View File

@ -6,7 +6,7 @@
## Setup ## Setup
Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/incus/config myincusjail`. Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/incus/config myincusjail`.
Unfortunately incus doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail: Unfortunately incus doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail:

View File

@ -6,7 +6,7 @@
## Setup ## Setup
Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/lxd/config mylxdjail`. Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/lxd/config mylxdjail`.
Unfortunately snapd doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail: Unfortunately snapd doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail:

View File

@ -2,7 +2,7 @@
## Setup ## Setup
Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/podman/config mypodmanjail`. Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/podman/config mypodmanjail`.
## Rootless ## Rootless