|
| 1 | +*********************** |
| 2 | +Molecule Vagrant Plugin |
| 3 | +*********************** |
| 4 | + |
| 5 | +.. image:: https://badge.fury.io/py/molecule-vagrant.svg |
| 6 | + :target: https://badge.fury.io/py/molecule-vagrant |
| 7 | + :alt: PyPI Package |
| 8 | + |
| 9 | +.. image:: https://zuul-ci.org/gated.svg |
| 10 | + :target: https://dashboard.zuul.ansible.com/t/ansible/builds?project=ansible-community/molecule-vagrant |
| 11 | + |
| 12 | +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg |
| 13 | + :target: https://github.com/python/black |
| 14 | + :alt: Python Black Code Style |
| 15 | + |
| 16 | +.. image:: https://img.shields.io/badge/Code%20of%20Conduct-silver.svg |
| 17 | + :target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html |
| 18 | + :alt: Ansible Code of Conduct |
| 19 | + |
| 20 | +.. image:: https://img.shields.io/badge/Mailing%20lists-silver.svg |
| 21 | + :target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information |
| 22 | + :alt: Ansible mailing lists |
| 23 | + |
| 24 | +.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg |
| 25 | + :target: LICENSE |
| 26 | + :alt: Repository License |
| 27 | + |
| 28 | +Molecule Vagrant is designed to allow use of Vagrant for provisioning of test |
| 29 | +resources. |
| 30 | + |
| 31 | +Supported Platforms |
| 32 | +=================== |
| 33 | + |
| 34 | +This driver relies on vagrant command line which is known to be problematic |
| 35 | +to install on several platforms. We do our best to perform CI/CD testing on |
| 36 | +multiple platforms but some are disabled due to known bugs. |
| 37 | + |
| 38 | +* ✅ MacOS with VirtualBox - GitHub Actions |
| 39 | +* ✅ Fedora 32 with libvirt - Zuul |
| 40 | +* ✅ Ubuntu Bionic (18.04) with libvirt - Zuul |
| 41 | +* ❌ CentOS 8 with libvirt - Zuul DISABLED due to 1127_ and 11020_ |
| 42 | + |
| 43 | +Please **do not file bugs for unsupported platforms**. You are welcomed to |
| 44 | +create PRs that fix untested platform, as long they do not break existing ones. |
| 45 | + |
| 46 | +.. _`1127`: https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1127 |
| 47 | +.. _`11020`: https://github.com/hashicorp/vagrant/issues/11020 |
| 48 | + |
| 49 | + |
| 50 | +Documentation |
| 51 | +============= |
| 52 | + |
| 53 | +To use this plugin, you'll need to set the ``driver`` and ``platform`` |
| 54 | +variables in your ``molecule.yml``. Here's a simple example using the |
| 55 | +`fedora/32-cloud-base`_ box: |
| 56 | + |
| 57 | +.. code-block:: yaml |
| 58 | +
|
| 59 | + driver: |
| 60 | + name: vagrant |
| 61 | +
|
| 62 | + platforms: |
| 63 | + - name: instance |
| 64 | + box: fedora/32-cloud-base |
| 65 | + memory: 512 |
| 66 | + cpus: 1 |
| 67 | +
|
| 68 | +Here's a full example with the libvirt provider: |
| 69 | + |
| 70 | +.. code-block:: yaml |
| 71 | +
|
| 72 | + driver: |
| 73 | + name: vagrant |
| 74 | + provider: |
| 75 | + # Can be any supported provider (virtualbox, parallels, libvirt, etc) |
| 76 | + # Defaults to virtualbox |
| 77 | + name: libvirt |
| 78 | + # Run vagrant up with --provision. |
| 79 | + # Defaults to --no-provision) |
| 80 | + provision: no |
| 81 | + # vagrant-cachier configuration |
| 82 | + # Defaults to 'machine' |
| 83 | + # Any value different from 'machine' or 'box' will disable it |
| 84 | + cachier: machine |
| 85 | + # If set to false, set VAGRANT_NO_PARALLEL to '1' |
| 86 | + # Defaults to true |
| 87 | + parallel: true |
| 88 | + # vagrant box to use by default |
| 89 | + # Defaults to 'generic/alpine316' |
| 90 | + default_box: 'generic/alpine316' |
| 91 | +
|
| 92 | + platforms: |
| 93 | + - name: instance |
| 94 | + # If specified, set host name to hostname, unless it's set to False and |
| 95 | + # the host name won't be set. In all other cases (including default) use |
| 96 | + # 'name' as host name. |
| 97 | + hostname: foo.bar.com |
| 98 | + # List of dictionaries mapped to `config.vm.network` |
| 99 | + interfaces: |
| 100 | + # `network_name` is the required identifier, all other keys map to |
| 101 | + # arguments. |
| 102 | + - auto_config: true |
| 103 | + network_name: private_network |
| 104 | + type: dhcp |
| 105 | + - network_name: private_network |
| 106 | + ip: 192.168.123.3 |
| 107 | + - network_name: forwarded_port |
| 108 | + guest: 80 |
| 109 | + host: 8080 |
| 110 | + # List of raw Vagrant `config` options |
| 111 | + instance_raw_config_args: |
| 112 | + # use single quotes to avoid YAML parsing as dict due to ':' |
| 113 | + - 'vm.synced_folder ".", "/vagrant", type: "rsync"' |
| 114 | + # Run 'uname' a provisionning step **needs 'provision: true' to work** |
| 115 | + - 'vm.provision :shell, inline: "uname"' |
| 116 | + # Dictionary of `config` options. Note that string values need to be |
| 117 | + # explicitly enclosed in quotes. |
| 118 | + config_options: |
| 119 | + ssh.keep_alive: yes |
| 120 | + ssh.remote_user: 'vagrant' |
| 121 | + synced_folder: true |
| 122 | + box: fedora/32-cloud-base |
| 123 | + box_version: 32.20200422.0 |
| 124 | + box_url: |
| 125 | + memory: 512 |
| 126 | + cpus: 1 |
| 127 | + # Dictionary of options passed to the provider |
| 128 | + provider_options: |
| 129 | + video_type: 'vga' |
| 130 | + # List of raw provider options |
| 131 | + provider_raw_config_args: |
| 132 | + - cpuset = '1-4,^3,6' |
| 133 | +
|
| 134 | +.. _`fedora/32-cloud-base`: https://app.vagrantup.com/fedora/boxes/32-cloud-base |
| 135 | + |
| 136 | + |
| 137 | +More examples may be found in the ``molecule`` `scenarios directory`_. |
| 138 | +They're the scenarios used by the CI. |
| 139 | + |
| 140 | + |
| 141 | +.. _get-involved: |
| 142 | + |
| 143 | +Get Involved |
| 144 | +============ |
| 145 | + |
| 146 | +* Join us in the ``#ansible-devtools`` channel on `Libera`_. |
| 147 | +* Join the discussion in `molecule-users Forum`_. |
| 148 | +* Join the community working group by checking the `wiki`_. |
| 149 | +* Want to know about releases, subscribe to `ansible-announce list`_. |
| 150 | +* For the full list of Ansible email Lists, IRC channels see the |
| 151 | + `communication page`_. |
| 152 | + |
| 153 | +.. _`Libera`: https://web.libera.chat/?channel=#ansible-devtools |
| 154 | +.. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users |
| 155 | +.. _`wiki`: https://github.com/ansible/community/wiki/Molecule |
| 156 | +.. _`ansible-announce list`: https://groups.google.com/group/ansible-announce |
| 157 | +.. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html |
| 158 | +.. _`scenarios directory`: https://github.com/ansible-community/molecule-vagrant/tree/main/molecule_vagrant/test/scenarios/molecule |
| 159 | +.. _authors: |
| 160 | + |
| 161 | +Authors |
| 162 | +======= |
| 163 | + |
| 164 | +Molecule Vagrant Plugin was created by Sorin Sbarnea based on code from |
| 165 | +Molecule. |
| 166 | + |
| 167 | +.. _license: |
| 168 | + |
| 169 | +License |
| 170 | +======= |
| 171 | + |
| 172 | +The `MIT`_ License. |
| 173 | + |
| 174 | +.. _`MIT`: https://github.com/ansible-community/molecule-vagrant/blob/main/LICENSE |
| 175 | + |
| 176 | +The logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_. |
| 177 | + |
| 178 | +If you have some other use in mind, contact us. |
| 179 | + |
| 180 | +.. _`Creative Commons NoDerivatives 4.0 License`: https://creativecommons.org/licenses/by-nd/4.0/ |
0 commit comments