Commit Graph

1320 Commits

Author SHA1 Message Date
Jason Tarasovic
1251189145
Add ability to use emulated tpm (#1166)
Qemu has supported tpm 2 and the ability to start swtpm. Additionally 
it expands the tests for the tpm configuration to ensure that only when 
the options cause a change to the domain XML will the domain be updated 
on a subsequent start. This change just allows passing through the 
necessary config.

Vagrant.configure("2") do |config|
  config.vm.provider :libvirt do |libvirt|
    libvirt.tpm_model = "tpm-crb"
    libvirt.tpm_type = "emulator"
    libvirt.tpm_version = "2.0"
  end
end

closes #965
2020-12-15 12:43:46 +00:00
Darragh Bailey
20067be0d2
Support building from git-archive tarballs (#1187)
Adds support for exposing the correct version via export-subst for
git-archive constructed tarballs to make it easier to consume directly
from source.

Will check in the following order of preference:
 - version file
 - format string containing "Tag:"
 - clone remote to describe commit
2020-12-14 18:49:50 +00:00
Darragh Bailey
5e62973e08
Include rsync to support syncing folders (#1186)
Add rsync to enable vagrant folder syncing.

Closes: #1183
2020-12-14 14:55:42 +00:00
Darragh Bailey
f51192e80b
Provide uid/gid for additional volumes qemu:///session (#1170)
When using qemu:///session, it's necessary to ensure the correct
user/group is passed in when creating additional volume storage as
otherwise the default is to attempt to chown/chgrp it to 0:0 which will
fail.

With this in place and recent changes around uri/qemu_use_session,
remove the checks guarding retrieving the storage pool as it is also
possible for it to be created as expected for the session.

Update create domain tests to check for the correct settings such as
storage path and user/group id's passed to the volume create call for
the additional disks.

Fixes: #986
2020-12-05 15:49:25 +00:00
Darragh Bailey
21f7a796ff
Reduce start domain unnecessary domain redefines (#1178)
Various checks in the start domain action were accidentally causing a
redefine right after initial create. Update to provide debug output when
the domain needs to be changed to allow capture of the redefines
occurring in the future and to make it easy for the tests to pick up
where the redefine was triggered by setting an expectation on the log
output.

Include a small fix to avoid running strip on what might be a nil object
returned for elements without any text attributes.

Fix a bug where changes to tpm settings made to the config after an
initial domain creation where there was previously no tpm defined, would
be ignored.

Adds a logger double and updates other tests that trigger log calls.

should fix #1176
2020-12-05 15:24:42 +00:00
Darragh Bailey
c12b0de254
Add doc on ssh key replacement if repackaging (#1169)
If planning to repackage a machine that is brought up with vagrant and
modified, it is necessary to avoid the default ssh replacement that
normally takes place to ensure the subsequent box that is halted and
packaged can be accessed by vagrant using the default ssh key
subsequently.

Add some small documentation notes to help users be aware to this so
that they know to set `config.ssh.insert_key = false` when using vagrant
to build a box.

Fixes: #1116
2020-11-17 19:31:19 +00:00
IPv4v6
f91e1784ff
Add forward mode 'open' to README (#1118)
Document forward mode 'open' as this is passed to libvirt to handle.
2020-11-16 16:45:09 +00:00
Frantisek Sumsal
308ead403e
Support the newly-introduced --no-tty Vagrant's option (#1120)
hashicorp/vagrant#11465 introduced a new option --no-tty which silences
progress bars so they don't spam logs when Vagrant is used
non-interactively. First Vagrant version with this change is v2.2.8.

However, existing code needs to be slightly updated to cooperate with
the new option correctly, otherwise the progress bars spam the logs with
empty lines/warnings instead of remaining silent.

Fixes: #1106
2020-11-16 15:32:47 +00:00
Michael Ablassmeier
027910d236
Support setting ovs interface id (#1156)
Support setting the ovs interfaceid parameter

Fixes: #1155
2020-11-16 15:11:59 +00:00
Brad Smith
b2b40e1149
Additional install notes for Fedora (#1107)
Provides steps for how to build and copy across the required libraries
to avoid a number of runtime failures on Fedora when using upstream
releases of vagrant.

These steps also remove the need to provide `CONFIGURE_ARGS=..`
as part of the install process.
2020-11-16 15:03:30 +00:00
Darragh Bailey
d3daf962e3
Update issue template to request log be attached (#1168)
Github supports attaching files, therefore switch to suggesting users attach the
debug output instead of inserting to make it easier to quickly read over the issue.
2020-11-16 10:49:50 +00:00
Darragh Bailey
71503ed62e
Rudimentary start domain action spec (#1167)
Add default domain start spec test and fix bug triggered by whitespace
mismatch in string comparison that would trigger unexpected domain
undefine and recreate.
2020-11-15 23:28:43 +00:00
Joey Korkames
6dfff8414f
Gemfile: update branch-name of 'vagrant-spec' (#1163)
fixes `bundle install` step from the README, currently broken by https://github.com/hashicorp/vagrant-spec/issues/41

```
~/src/vagrant-libvirt $ bundle install
....
Fetching git://github.com/hashicorp/vagrant-spec.git
fatal: Needed a single revision
Revision master does not exist in the repository git://github.com/hashicorp/vagrant-spec.git. Maybe you misspelled it?
```


Works fine now on my workstation with the new name:
```
Using vagrant-spec 0.0.1 from git://github.com/hashicorp/vagrant-spec.git (at main@b6b56c8)
Bundle complete! 10 Gemfile dependencies, 73 gems now installed.
```
2020-10-27 11:51:04 +00:00
Darragh Bailey
b657f7c709
Use github cache for docker layers (#1164)
Cache the build layers between github action builds to reduce time
required.
2020-10-27 10:09:49 +00:00
Darragh Bailey
4adc24b8e6
Ensure docker image build has history for version resolving (#1162)
With the switch to using git to resolve the version it's necessary to
ensure the history is available in the clone during the github action.

Add the `context: .` setting to work around a bug in the docker github
action. Based on docker/build-push-action#162
2020-10-27 09:55:08 +00:00
Darragh Bailey
966ef2a534
Tag version from git tag (#1161)
Switch to looking up the version from a file with a fall back to get
it directly from git tags if the file isn't available.

The version file is automatically generated by a task of building of the
gem and included in the package release to prevent reading from git.

Should allow the release process to be automated from pushing of a git
tag.
2020-10-23 18:18:52 +01:00
Darragh Bailey
6e2df05177
Try using bundler cache for faster CI (#1159) 2020-10-23 14:51:22 +01:00
Michael Ablassmeier
70bb392241
Support separate storage pools for additional disks (#1130)
Add support for a pool setting for additional disks, example:

Vagrant.configure("2") do |config|
  config.vm.box = "generic/centos8"
    config.vm.provider :libvirt do |domain|
        domain.storage :file, :size => '20G', :pool=>'default'
        domain.snapshot_pool_name='cache'
    end
end

this allows to place the virtual machines snapshot in the "cache" pool,
while additional disks are created in the "default" storage pool.
2020-10-23 14:39:14 +01:00
Darragh Bailey
06e31d3918
Add rudimentary create domain spec test (#1158)
Provide a simple create domain test that uncovered a bug with an
exception in addition to fixing the tests to avoid unnecessary output
when the code sends messages via the UI.
2020-10-23 14:31:29 +01:00
Darragh Bailey
80c81f62f4
Fix release workflow (#1157)
Ensure the release workflow will work consistently by limiting the
number of issues that are checked in addition to making use of a cache.
This should keep the requests below the API limit and overtime may be
increased should the cache be retained.

Add checks to determine the correct default branch and look to establish
if the tag that was created is reachable from this branch, using it as
the value for `commitish` to the create release action so that it
retains the `x commits since release` text and link.

In the case the workflow is re-run for a release after another release
look to pick up the next tag after this release in order to limit the
release notes from updating with additional fixes.
2020-10-23 14:22:35 +01:00
Radix10
8f37a78290
fix typo (#1154) 2020-10-09 09:53:59 +01:00
Darragh Bailey
e5c50de3c2
Limit docker image push (#1152)
Tweak workflow to skip attempting to push the docker image without
credentials additionally modify to allow the dockerhub organization to
be managed via a secret so that forked repos may push locally modified
images to their own dockerhub with a minimum of effort.

Additionally given the way github status checks works, this should allow
maintainers of this project to push the same commit to a local branch in
order to build and publish the image to the org dockerhub repository to
allow testing of the image before merging. Based on having first
reviewed and decided it was safe to allow access to any secrets.

Pushing the PR to a local branch will not result in getting a tag with the
pr<num> as the version, however this is a reasonable starting position.
2020-10-04 12:22:23 +01:00
Darragh Bailey
2f827fa5a3
Update version for release (#1151) 2020-10-03 21:14:00 +01:00
Vít Ondruch
0ecb9cc94f
Use Vagrant::Util::TemplateRenderer instead of Erubis. (#1144)
Erubis is dead upstream, therefore it is good idea to avoid its usage.

Also, this allows to drop explicit dependency on Erubis, which is not
specified anywhere and may cause issues when Vagrant changes its
renderer.

Fixes #1142.
2020-10-03 21:04:59 +01:00
Darragh Bailey
6a9e604e45
Support release notes generation (#1150)
Add github actions to automatically populate release notes on tag push.
This should make it easier to show what new functionality/improvements
have been added by populating the release page based on PRs and issues.
2020-10-03 20:52:31 +01:00
Darragh Bailey
d4d82d9773
Add docker image for vagrant-libvirt (#1149)
Provide a docker image that supports execution of vagrant-libvirt
provided the host system has docker and libvirt installed. This can help
side step many of the library compatibility issues experienced by users
by providing an alternative way to run the latest code should their
distribution not have a natively packaged vagrant.
2020-10-03 17:16:00 +01:00
Darragh Bailey
d7debb68c6
Merge pull request #1123 from cvoltz/wwn
Add WWN support
2020-08-16 19:49:15 +01:00
Darragh Bailey
162eb7f8a7
config: allow for setting URI from environment (#1141)
Users are allowed to set a LIBVIRT_DEFAULT_URI environment variable that
controls tools (i.e. virsh, virt-install, etc) that communicate with
libvirt. Let's allow for that mechanism to be used here.
2020-08-16 16:45:01 +01:00
Dusty Mabe
41bcae26e4 config: allow for setting URI from environment
Users are allowed to set a LIBVIRT_DEFAULT_URI environment variable that
controls tools (i.e. virsh, virt-install, etc) that communicate with
libvirt. Let's allow for that mechanism to be used here.
2020-08-16 16:37:57 +01:00
Darragh Bailey
d16bdcc1dc
Add @uri config tests and minor refactor (#1139)
Test settings modifying the `@uri` and `@qemu_use_session` variables to make
it easier to update and perform an initial minor refactor to reduce some
of the code currently in use to set `@uri`.
2020-08-16 16:27:27 +01:00
Darragh Bailey
4cff77e1c7
Limit CI jobs to a subset of combinations (#1140)
It's time consuming to execute many combinations of vagrant releases
along with versions of ruby. Limit to the most likely combinations.
2020-08-16 16:18:49 +01:00
Darragh Bailey
74c381a30d
Update test syntax to remove stubs (#1138)
Use of stubs are deprecated, switch to the newer expect/allow syntax.
2020-08-16 16:06:05 +01:00
Darragh Bailey
dda5d4e1c4
Merge pull request #1137 from rgl/add-domain-title-and-description
let the user set the domain title and description
2020-08-13 14:52:06 +01:00
Rui Lopes
19cd1d5629 let the user set the domain title and description 2020-08-12 22:06:05 +01:00
Darragh Bailey
18c7803863
Merge pull request #1134 from eighthave/remove-redundant
remove redundant setting of default volume/backingStore mode
2020-07-22 16:44:04 +01:00
Hans-Christoph Steiner
8b712b7715 remove redundant setting of default volume/backingStore mode
According to the docs, for volumes and backingStores: "The mode defaults to
0600 when not provided.  https://libvirt.org/formatstorage.html

Removing this setting here allows the pool configuration to set the default
mode.
2020-07-22 13:45:38 +02:00
Christopher Voltz
437fc3f3b0 Add WWN support
Add the disk attribute wwn to set the WWN of a disk drive.

Signed-off-by: christopher@voltz.us
2020-06-14 20:00:15 -05:00
Michael Ablassmeier
5e77446297
add snapshot_pool_name to README (#1114) 2020-06-04 15:19:34 +01:00
Darragh Bailey
30599c6521
Merge pull request #1119 from timhughes/patch-1
update examples to use fedora/32-cloud-base
2020-06-04 15:19:05 +01:00
Darragh Bailey
f1b0c9a460
Merge pull request #1036 from zakame/public_address-provider-capability
Add public_address provider capability
2020-06-04 15:15:39 +01:00
Zak B. Elep
55abd327eb Add public_address provider capability
Used by vagrant-share plugin to determine local guest address for
forwarding via ngrok.
2020-06-04 17:07:40 +08:00
Tim Hughes
2ba06a168f
update examples to use fedora/32-cloud-base
fixes #1070
2020-06-04 01:04:18 +01:00
Darragh Bailey
760a08a6c4
Merge pull request #1037 from zakame/forward_ports-fix-pid-tracking
action/forward_ports.rb: Fix SSH tunnel spawning and PID tracking
2020-05-28 15:41:50 +01:00
Zak B. Elep
9e35ec2b05 action/forward_ports.rb: Fix SSH tunnel spawning and PID tracking
- Explicitly disable any SSH multiplexing here so PID tracking of
  tunnels works correctly.

- Using `exec ssh` in the spawn forces Ruby to use a subshell (as exec
  is a shell builtin) instead of spawning the ssh process directly, which
  results in getting the wrong (and dead, as the exec replaces the
  subshell) PID to track and clean up later.

- Run the ssh tunnel command on its own process group, essentially
  daemonizing it and keeping its PID intact even when `vagrant up` command
  is run on shell/consoles without an explicit TTY, such as Emacs Eshell.
2020-05-28 17:26:50 +08:00
Darragh Bailey
aa7ea05540
Bugfix release 0.1.2 (#1112)
Skipping 0.1.1 as accidentally tagged before bumping version
2020-05-12 10:05:32 +01:00
Darragh Bailey
1c39003fc6
Merge pull request #1111 from AmedeeBulle/issue-1110 2020-05-12 09:34:21 +01:00
Philippe Vanhaesendonck
4472654ba0
prune_nfs_exports: create Logger instance.
Fix #1110

Signed-off-by: Philippe Vanhaesendonck <philippe.vanhaesendonck@e-bulles.be>
2020-05-12 08:33:39 +02:00
Petr Ruzicka
d75c9ffda3
Improve Fedora installation procedure (#1101) 2020-05-10 14:54:56 +01:00
Julio Lajara
f00bc0eaae
Add qemu commandline environment variable support. (#961)
Make it easier to tweak some qemu options by allowing passthru of
command line environment variables.

- Also cleans up weird variable indirection used for qemu commandline args
  variable through `qargs` in various constructors.
- Addresses some functionality discussed in #776.
2020-05-10 14:37:31 +01:00
Darragh Bailey
f5f9e34da0
Tidy up README and TOC (#1108)
Bring the TOC in line with recent additions and enable the ability to
use a vim plugin to quickly regenerate in lieu of a better alternative.

Using https://github.com/mzlogin/vim-markdown-toc

Clean up any trailing whitespace so that subsequent file updates
by other PRs will be able to simply regen using appropriate tooling
without pulling in additional changes unrelated.
2020-05-10 14:23:25 +01:00