diff --git a/tasks/main.yml b/tasks/main.yml index bd644a6..16e4934 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,6 +23,6 @@ name: "{{ item }}" state: stopped enabled: no - with_items: stop_service_list + with_items: "{{ stop_service_list }}" tags: [ 'daemon' ] when: ci_run is not defined diff --git a/tests/Vagrantfile b/tests/Vagrantfile new file mode 100644 index 0000000..fea3bf4 --- /dev/null +++ b/tests/Vagrantfile @@ -0,0 +1,21 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + boxes = [ + { :name => "ubuntu-hello-world-box", :box => "ubuntu/xenial64" }, + { :name => "debian-hello-world-box", :box => "debian/stretch64" }, + { :name => "centos-hello-world-box", :box => "geerlingguy/centos8" } + ] + boxes.each do |opts| + config.vm.define opts[:name] do |config| + config.vm.box = opts[:box] + if opts[:name] == boxes.last[:name] + config.vm.provision "ansible" do |ansible| + ansible.playbook = "test-playbook.yml" + ansible.limit = "all" + end + end + end + end +end \ No newline at end of file diff --git a/tests/test-playbook.yml b/tests/test-playbook.yml index bb52c54..6cecd85 100644 --- a/tests/test-playbook.yml +++ b/tests/test-playbook.yml @@ -4,4 +4,4 @@ hosts: all gather_facts: True roles: - - update-system + - ../../.