Skip to content

Commit

Permalink
ready for initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
VVelox committed Oct 14, 2021
1 parent 27f50bc commit 1c30bd5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 21 deletions.
5 changes: 2 additions & 3 deletions Rex-Virtualization-CBSD/Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Revision history for Rex-Virtualization-CBSD

0.01 Date/time
First version, released on an unsuspecting world.

0.0.1 2021-10-14/13:00
- Initial release.
2 changes: 1 addition & 1 deletion Rex-Virtualization-CBSD/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ my %WriteMakefileArgs = (
},
PREREQ_PM => {
'Term::ANSIColor' => '0',
'Rex' => '1.9.0',
'Rex' => '1.13.4',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Rex-Virtualization-CBSD-*' },
Expand Down
45 changes: 35 additions & 10 deletions Rex-Virtualization-CBSD/README
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
Rex-Virtualization-CBSD

The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.

A README file is required for CPAN modules since CPAN extracts the README
file from a module distribution so that people browsing the archive
can use it to get an idea of the module's uses. It is usually a good idea
to provide version information here so that people can decide whether
fixes for the module are worth downloading.
This provides interface to CBSD for controlling bhyve via Rex.

use Rex::Commands::Virtualization;

set virtualization => "CBSD";

vm 'create', name=>'foo',
'vm_os_type'=>'freebsd',
'vm_os_profile'=>'FreeBSD-x64-13.0',
'vm_ram'=>'1g',
'vm_cpus'=>'1',
'imgsize'=>'10g';

vm 'start' => 'foo';

# list the basic settings for the VM foo from the VM list
my %vm_list = vm 'list';
print Dumper \%{ $vm_list{foo} };

# get all the config info for the VM foo and display it
%vm_info=vm 'info' => 'foo';
foreach my $vm_info_key (@{keys(%vm_info)}){
print $vm_info_key.": ".$vm_info{$vm_info_key}."\n";
}

# stop the VM foo
vm 'stop' => 'foo';

# remove the VM foo
vm 'remove' => 'foo';

# show all VM
my %vm_list = vm 'list';
print Dumper \%vm_list;



INSTALLATION
Expand Down
35 changes: 28 additions & 7 deletions Rex-Virtualization-CBSD/lib/Rex/Virtualization/CBSD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use base qw(Rex::Virtualization::Base);

=head1 NAME
Rex::Virtualization::CBSD - CBSD virtualization modulem for bhyve
Rex::Virtualization::CBSD - CBSD virtualization module for bhyve
=head1 VERSION
Expand All @@ -25,13 +25,34 @@ our $VERSION = '0.0.1';
set virtualization => "CBSD";
vm 'create', name=>'foo',
'vm_os_type'=>'freebsd',
'vm_os_profile'=>'FreeBSD-x64-13.0',
'vm_ram'=>'1g',
'vm_cpus'=>'1',
'imgsize'=>'10g';
vm 'start' => 'foo';
# list the basic settings for the VM foo from the VM list
my %vm_list = vm 'list';
print Dumper \%{ $vm_list{foo} };
# get all the config info for the VM foo and display it
%vm_info=vm 'info' => 'foo';
foreach my $vm_info_key (@{keys(%vm_info)}){
print $vm_info_key.": ".$vm_info{$vm_info_key}."\n";
}
print Dumper vm 'create', name=>'foo',
'vm_os_type'=>'freebsd',
'vm_os_profile'=>'FreeBSD-x64-13.0',
'vm_ram'=>'1g',
'vm_cpus'=>'1',
'imgsize'=>'10g';
# stop the VM foo
vm 'stop' => 'foo';
# remove the VM foo
vm 'remove' => 'foo';
# show all VM
my %vm_list = vm 'list';
print Dumper \%vm_list;
=cut

Expand Down

0 comments on commit 1c30bd5

Please sign in to comment.