-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from andreygubarev/feature-vmnet-support
feature vmnet support
- Loading branch information
Showing
4 changed files
with
191 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
max-spaces-after: -1 | ||
level: error | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: disable | ||
truthy: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,23 @@ Support guest OS: | |
* Ubuntu 20.04 LTS (x86_64) | ||
* Debian 11 (x86_64) | ||
|
||
Support of other platforms and guest OS is possible, but not tested. | ||
Support of other platforms and guest OS is possible, but not tested. Please, open an issue if you want to add support for other platforms. | ||
|
||
## Network modes | ||
|
||
Network mode is selected by setting `vm_network` in `molecule.yml`. Supported modes are: `user` and `vmnet-shared`. Default mode is `user`. All modes are mutually exclusive. | ||
|
||
### `user` network mode | ||
|
||
This is the default network mode. It uses QEMU's user networking mode. | ||
|
||
Mode is selected by setting `vm_network: user` in `molecule.yml`. | ||
|
||
### `vmnet-shared` network mode | ||
|
||
This mode uses QEMU's `vmnet-shared` networking mode. It requires `vmnet.framework` to be installed on the host. This mode is only supported on MacOS. It requires *passwordless* `sudo` access for current user. | ||
|
||
Mode is selected by setting `vm_network: vmnet-shared` in `molecule.yml`. | ||
|
||
# Examples | ||
|
||
|
@@ -31,7 +47,8 @@ Support of other platforms and guest OS is possible, but not tested. | |
molecule init scenario default --driver-name molecule-qemu --verifier-name testinfra | ||
``` | ||
|
||
## Example `molecule.yml` | ||
## Example `molecule.yml` for `user` network mode | ||
|
||
```yaml | ||
--- | ||
dependency: | ||
|
@@ -40,21 +57,56 @@ driver: | |
name: molecule-qemu | ||
platforms: | ||
- name: ubuntu-1 | ||
image: file:///Users/andrey/Downloads/focal-server-cloudimg-arm64.img | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: aarch64 | ||
ssh_port: 10022 | ||
ssh_user: ubuntu | ||
- name: ubuntu-2 | ||
image: file:///Users/andrey/Downloads/focal-server-cloudimg-amd64.img | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: x86_64 # default | ||
ssh_port: 10023 | ||
ssh_user: ubuntu | ||
- name: debian-1 | ||
image: file:///Users/andrey/Downloads/debian-11-generic-amd64.qcow2 | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: x86_64 # default | ||
ssh_port: 10024 | ||
ssh_user: debian | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible | ||
``` | ||
## Example `molecule.yml` for `vmnet-shared` network mode | ||
|
||
```yaml | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: molecule-qemu | ||
platforms: | ||
- name: ubuntu-1 | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: aarch64 | ||
ssh_user: ubuntu | ||
vm_network: vmnet-shared | ||
- name: ubuntu-2 | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: x86_64 # default | ||
ssh_user: ubuntu | ||
vm_network: vmnet-shared | ||
- name: debian-1 | ||
image: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img | ||
image_checksum: sha256:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS | ||
image_arch: x86_64 # default | ||
ssh_user: debian | ||
vm_network: vmnet-shared | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
|
@@ -71,3 +123,8 @@ verifier: | |
* [Ansible](https://www.ansible.com/) | ||
* [Molecule](https://molecule.readthedocs.io/en/latest/) | ||
* [QEMU](https://www.qemu.org/) | ||
|
||
## QEMU vmnet-shared networking | ||
|
||
* [vmnet.framework modes](https://lore.kernel.org/all/[email protected]/T/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters