diff options
Diffstat (limited to 'tests')
8 files changed, 155 insertions, 0 deletions
diff --git a/tests/vagrant/vagrant-template/Vagrantfile b/tests/vagrant/vagrant-template/Vagrantfile new file mode 100644 index 00000000000..fda113f98de --- /dev/null +++ b/tests/vagrant/vagrant-template/Vagrantfile @@ -0,0 +1,50 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.define "vagrant-testVM" do |testvm| + testvm.vm.box = "fedora/23-cloud-base" + testvm.vm.hostname = "vagrant-testVM" + #testvm.ssh.insert_key = false + testvm.vm.synced_folder ".", "/vagrant", disabled: true + + + # Define basic config for VM, memory, cpu, storage pool + testvm.vm.provider "libvirt" do |lv| + lv.storage_pool_name = "default" + lv.memory = 1024 + lv.cpus = 1 + + + # We need a brick partition, lets have a 5G disk for that. + # If you need more bricks, just add more letters to the + # string below. + "b".split("").each do |i| + lv.storage :file, + #:path => "", + #:allow_existing => "", + :device => "vd#{i}", + :size => "5G", + :type => "qcow2", + :bus => "virtio", + :cache => "default" + end + end + + # Let's provision + + # Some packages are required for ansible dnf module to work + # so install them using shell inline + testvm.vm.provision "shell", inline: "sudo dnf install -y python-dnf", run: "always" + testvm.vm.provision "shell", inline: "sudo dnf install -y libselinux-python", run: "always" + testvm.vm.provision "shell", inline: "sudo dnf install -y libsemanage-python", run: "always" + + # Now onto the main provisioning + testvm.vm.provision "ansible", run: "always" do |setup| + setup.verbose = "v" + setup.playbook = "setup.yml" + end + + end +end + diff --git a/tests/vagrant/vagrant-template/roles/daemon-services/tasks/main.yml b/tests/vagrant/vagrant-template/roles/daemon-services/tasks/main.yml new file mode 100644 index 00000000000..98d077b1f2e --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/daemon-services/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: stop and disable kernel nfs + service: name=nfs-server state=stopped enabled=no diff --git a/tests/vagrant/vagrant-template/roles/install-pkgs/tasks/main.yml b/tests/vagrant/vagrant-template/roles/install-pkgs/tasks/main.yml new file mode 100644 index 00000000000..a6656b6cbb0 --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/install-pkgs/tasks/main.yml @@ -0,0 +1,76 @@ +--- +- name: install deltarpm + dnf: name=deltarpm state=present + +- name: update system + shell: dnf update -y + +- name: install other packages + dnf: name={{ item }} state=present + with_items: + - attr + - autoconf + - automake + - bison + - cmockery2 + - cmockery2-devel + - cifs-utils + - dbench + - dos2unix + - e2fsprogs + - findutils + - flex + - fuse-devel + - fuse-libs + - gcc + - gdb + - git + - glib2-devel + - hostname + - libacl-devel + - libaio-devel + - libattr-devel + - libibverbs-devel + - librdmacm-devel + - libtool + - libxml2-devel + - lvm2-devel + - make + - man-db + - mock + - net-tools + - nfs-utils + - openssh-server + - openssl-devel + - perl-Test-Harness + - pkgconfig + - procps-ng + - psmisc + - python-devel + - python-devel + - python-eventlet + - python-netifaces + - python-paste-deploy + - python-setuptools + - python-simplejson + - python-sphinx + - python-webob + - pyxattr + - readline-devel + - rpm-build + - screen + - strace + - supervisor + - systemtap-sdt-devel + - sqlite-devel + - samba* + - userspace-rcu-devel + - vim + - wget + - which + - xfsprogs + - yajl-devel + +- name: Erase gluster packages, keep dependencies; we will source install + shell: rpm -ev --nodeps `rpm -qa | grep ^gluster` + ignore_errors: True diff --git a/tests/vagrant/vagrant-template/roles/iptables/tasks/main.yml b/tests/vagrant/vagrant-template/roles/iptables/tasks/main.yml new file mode 100644 index 00000000000..768cb0e8668 --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/iptables/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: disable iptables, need to add specific rules later + shell: iptables -F diff --git a/tests/vagrant/vagrant-template/roles/mock-user/tasks/main.yml b/tests/vagrant/vagrant-template/roles/mock-user/tasks/main.yml new file mode 100644 index 00000000000..c8e1209937e --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/mock-user/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: Add mock user; required for rpm.t + user: name=mock group=mock diff --git a/tests/vagrant/vagrant-template/roles/prepare-brick/tasks/main.yml b/tests/vagrant/vagrant-template/roles/prepare-brick/tasks/main.yml new file mode 100644 index 00000000000..6b3f6b8d3ea --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/prepare-brick/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Format backend + filesystem: fstype=xfs dev=/dev/vdb + +- name: Add entry to fstab and mount + mount: name=/d src=/dev/vdb fstype=xfs state=mounted diff --git a/tests/vagrant/vagrant-template/roles/selinux/tasks/main.yml b/tests/vagrant/vagrant-template/roles/selinux/tasks/main.yml new file mode 100644 index 00000000000..c9ba9618428 --- /dev/null +++ b/tests/vagrant/vagrant-template/roles/selinux/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- name: Allow gfapi in Samba to bind to other ports than well known smb ports + seboolean: name=samba_load_libgfapi state=yes persistent=yes diff --git a/tests/vagrant/vagrant-template/setup.yml b/tests/vagrant/vagrant-template/setup.yml new file mode 100644 index 00000000000..691c7aff07f --- /dev/null +++ b/tests/vagrant/vagrant-template/setup.yml @@ -0,0 +1,11 @@ +--- +- hosts: all + sudo: true + roles: + - install-pkgs + - prepare-brick + - mock-user + - selinux + - iptables + - daemon-services + |