Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Bulk start/stop/destroy jails #815

Open
2Belette opened this issue Jan 16, 2025 · 6 comments
Open

[ENHANCEMENT] Bulk start/stop/destroy jails #815

2Belette opened this issue Jan 16, 2025 · 6 comments
Labels
enhancement New feature or request

Comments

@2Belette
Copy link

Is your feature request related to a problem? Please describe.
I'm always frustrated when I am testing Bastille / Template / any other thing outside from Bastille regarding jails where I am creating a bunch of tests jails and have to start/stop or destroy multiple times.

Describe the solution you'd like

bastille start test1 test2 test3 test4 test5 ...
bastille stop test1 test2 test3 test4 test5 ...
bastille destroy test1 test2 test3 test4 test5 ...

Describe alternatives you've considered
Doing it manually now

Additional context
N/A

@2Belette 2Belette added the enhancement New feature or request label Jan 16, 2025
@yaazkal
Copy link
Collaborator

yaazkal commented Jan 17, 2025

You can use the ALL as a target. Like:

bastille start ALL
bastille stop ALL
bastille destroy ALL

@2Belette
Copy link
Author

2Belette commented Jan 17, 2025

Yes thanks I know that but I don't want to start/stop/destroy all but just the jails test. It would also be very convenient for template to apply in one command for multiple jails but not for ALL.

By the way and just for the context, I am coming from lxd/incus which has this feature that the reason why I am used to

@yaazkal
Copy link
Collaborator

yaazkal commented Jan 17, 2025

Ok, so you say supporting something like bastille CMD test* OPTIONS?

In the meantime, this is what you can do for testing (change accordingly):

Create 5 jails with names test1, test2, test3, test4 and test5:
for i in $(seq 1 5); do bastille create test${i} 14.2-RELEASE 10.0.0.${i}; done

Stop the jails:
for i in $(seq 1 5); do bastille stop test${i}; done

Destroy the jails:
for i in $(seq 1 5); do bastille destroy test${i}; done

And for applying the template... well, again:

for i in $(seq 1 5); do bastille template test${i} vendor/template; done

@2Belette
Copy link
Author

Many thanks for the commands !

bastille test* start would be cool but that's would be only for the test I am doing.

For more maintenance and so on in production, doing a "bastille start|stop|destroy|template jail1 jail2 jail2" would be very convenient

@tschettervictor
Copy link
Collaborator

I have it local so I can quote jails together.

bastille start "test test1" etc...

@2Belette
Copy link
Author

2Belette commented Jan 28, 2025

You can use the ALL as a target. Like:

bastille start ALL
bastille stop ALL
bastille destroy ALL

for information stop ALL is working all fine but when I am trying destroy ALL after stoping them ALL I got :

bastille destroy ALL
Jail not found.

I got 11 jails.

from git 6d149f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants