Thanks Mischa.
I ended up doing something similar with Vagrant.
- Created a symlink from the tests/roles dir to the root dir of the role
I am writing
- Installed the *vagrant-hostupdater* to add a custom host name to the
Vagrant box I use for testing
- Updated the inventory and added the hostname of the Vagrant box
- Created a minimal Vagrantfile to spin up the test env:
Vagrant.configure("2") do |config|
config.vm.box = "centos/6"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "myrole.vagrant.test.local"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "shell", inline: <<-SHELL
printf
'[sensu]\nname=sensu\nbaseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/\ngpgcheck=0\nenabled=1'
> /etc/yum.repos.d/sensu.repo
yum update -y
yum install libselinux-python sensu -y
SHELL
end
There's still room for improvement, but this gets the job done for the time
being.
On Wednesday, May 23, 2018 at 5:15:14 PM UTC+10, Mischa ter Smitten wrote:
>
> Have a look at some of our roles
> https://github.com/Oefenweb?tab=repositories. They are all tested on
> Travis CI and contain a Vagrantfile for manual testing.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/491ccc1f-15a7-454b-8cf8-a03d1a6b3f8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.