Skip to content

Commit bbf3931

Browse files
author
Donald Morton
committed
Update docs and add check for deprecated var.
1 parent 52bb6c4 commit bbf3931

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,6 @@ dmypy.json
141141

142142
# Cython debug symbols
143143
cython_debug/
144+
145+
# Vagrant
146+
.vagrant/

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,59 @@ have to install all dependencies even when they are disabled to prevent errors.
217217
Tests
218218
-----
219219

220-
If you'd like to test the role out using our test suite, you'll need a few things installed:
220+
If you'd like to run the Molecule tests, you'll need a few things installed:
221221

222222
- [Vagrant](https://www.vagrantup.com/docs/installation)
223223
- [libvirt](https://github.com/vagrant-libvirt/vagrant-libvirt)
224224
- [Molecule](https://molecule.readthedocs.io/en/latest/installation.html)
225225
- [testinfra](https://testinfra.readthedocs.io/en/latest/)
226226

227+
Note that this is ONLY required if you want to run the test harness. You don't need any of this to run the playbook. This is a special setup that allows you to test the Ansible playbook against disposable VMs.
228+
229+
#### Install Notes
230+
231+
Setting up Molecule requires installing a number tools for the VM enviroment. The following are notes from a successful install on Ubuntu 20.04.
232+
233+
Install Virtualenv, Molecule, and testharness
234+
235+
sudo apt-get update
236+
sudo apt-get install -y python3-pip libssl-dev python3-virtualenv
237+
source venv/bin/activate
238+
python3 -m pip install "molecule[lint]"
239+
pip3 install testinfra
240+
241+
Install Vagrant and libvirt
242+
243+
sudo apt-get install -y bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev
244+
sudo wget -nv https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb
245+
sudo dpkg -i vagrant_2.2.9_x86_64.deb
246+
vagrant --version
247+
sudo apt-get install ruby-libvirt qemu libvirt-daemon-system libvirt-clients ebtables
248+
sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
249+
vagrant plugin install vagrant-libvirt
250+
vagrant plugin list
251+
pip3 install python-vagrant molecule-vagrant
252+
253+
Test that Vagrant works
254+
255+
vagrant init generic/ubuntu1804
256+
vagrant up --provider=libvirt
257+
vagrant ssh
258+
vagrant halt
259+
260+
Test that Molecule works
261+
262+
git clone https://github.com/Graylog2/graylog-ansible-role.git
263+
cd graylog-ansible-role
264+
molecule create
265+
molecule converge
266+
molecule login
267+
systemctl status graylog-server
268+
exit
269+
molecule destroy
270+
271+
#### Commands
272+
227273
To spin up a test VM:
228274

229275
export MOLECULE_DISTRO='generic/ubuntu1804'

tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
when: item not in vars
1111
with_items: "{{ required_vars }}"
1212

13+
- name: "Check deprecated variables"
14+
fail:
15+
msg: "Varible 'graylog_server_version' has been deprecated. Use 'graylog_full_version' instead."
16+
when: graylog_server_version is defined
17+
1318
- name: "Load OS-family specific vars"
1419
include_vars: "{{ ansible_os_family }}.yml"
1520

0 commit comments

Comments
 (0)