Vagrant Molecule 插件 :: 使用 Vagrant 运行 molecule 测试
项目描述
Molecule Vagrant 设计用于允许使用 Vagrant 来配置测试资源。
支持的平台
此驱动程序依赖于已知的在多个平台上安装有问题的 vagrant 命令行。我们尽最大努力在多个平台上执行 CI/CD 测试,但一些因已知错误而被禁用。
✅ MacOS 与 VirtualBox - GitHub Actions
✅ Fedora 32 与 libvirt - Zuul
✅ Ubuntu Bionic (18.04) 与 libvirt - Zuul
请勿为不支持的平台提交错误报告。欢迎您创建修复未测试平台的 Pull Request,只要它们不会破坏现有的功能。
文档
要使用此插件,您需要在您的 molecule.yml 中设置 driver 和 platform 变量。以下是一个使用 fedora/32-cloud-base 虚拟机的简单示例
driver:
name: vagrant
platforms:
- name: instance
box: fedora/32-cloud-base
memory: 512
cpus: 1
以下是一个使用 libvirt 提供程序的完整示例
driver:
name: vagrant
provider:
# Can be any supported provider (virtualbox, parallels, libvirt, etc)
# Defaults to virtualbox
name: libvirt
# Run vagrant up with --provision.
# Defaults to --no-provision)
provision: no
# vagrant-cachier configuration
# Defaults to 'machine'
# Any value different from 'machine' or 'box' will disable it
cachier: machine
# If set to false, set VAGRANT_NO_PARALLEL to '1'
# Defaults to true
parallel: true
# vagrant box to use by default
# Defaults to 'generic/alpine316'
default_box: 'generic/alpine316'
platforms:
- name: instance
# If specified, set host name to hostname, unless it's set to False and
# the host name won't be set. In all other cases (including default) use
# 'name' as host name.
hostname: foo.bar.com
# List of dictionaries mapped to `config.vm.network`
interfaces:
# `network_name` is the required identifier, all other keys map to
# arguments.
- auto_config: true
network_name: private_network
type: dhcp
- network_name: private_network
ip: 192.168.123.3
- network_name: forwarded_port
guest: 80
host: 8080
# List of raw Vagrant `config` options
instance_raw_config_args:
# use single quotes to avoid YAML parsing as dict due to ':'
- 'vm.synced_folder ".", "/vagrant", type: "rsync"'
# Run 'uname' a provisionning step **needs 'provision: true' to work**
- 'vm.provision :shell, inline: "uname"'
# Dictionary of `config` options. Note that string values need to be
# explicitly enclosed in quotes.
config_options:
ssh.keep_alive: yes
ssh.remote_user: 'vagrant'
synced_folder: true
box: fedora/32-cloud-base
box_version: 32.20200422.0
box_url:
memory: 512
cpus: 1
# Dictionary of options passed to the provider
provider_options:
video_type: 'vga'
# List of raw provider options
provider_raw_config_args:
- cpuset = '1-4,^3,6'
更多示例可以在 molecule 的 场景目录 中找到。它们是 CI 使用的场景。
参与其中
加入我们 Libera 上的 #ansible-devtools 频道。
加入 molecule-users 论坛 的讨论。
通过查看 wiki 加入社区工作组。
想了解发布信息,请订阅 ansible-announce 列表。
有关 Ansible 电子邮件列表和 IRC 频道的完整列表,请参阅 通讯页面。
许可证
MIT 许可证。
标志受 Creative Commons NoDerivatives 4.0 许可 限制。
如果您有其他用途,请联系我们。
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分发
molecule-vagrant-2.0.0.tar.gz (31.9 kB 查看哈希值)
构建分发
molecule_vagrant-2.0.0-py3-none-any.whl (33.5 kB 查看哈希值)
关闭
molecule-vagrant-2.0.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | bb27f4ec482d0f68231f31136bfba328fc8ef7d81341874284bdd71295e278d5 |
|
MD5 | c90203ccab2a3561f331b2e97406d5e7 |
|
BLAKE2b-256 | c9ad0ed60a69cd6887622ff03d67beacbc54183f9d6fa45978c37dc35a315b30 |