From 4ea37ed58194744079b6852a63b7a4ff8d7b35b3 Mon Sep 17 00:00:00 2001 From: Deepshikha Khandelwal Date: Tue, 9 Oct 2018 17:55:34 +0530 Subject: [PATCH 1/3] Add playbook to setup the basic instance of gluster which includes the tasks like install packages and do network configurations.It will be used in re-building the image for distributed regression testing. Signed-off-by: Deepshikha Khandelwal --- .../deploy_gluster_basic_instance.yml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 distributed-tests/deploy_gluster_basic_instance.yml diff --git a/distributed-tests/deploy_gluster_basic_instance.yml b/distributed-tests/deploy_gluster_basic_instance.yml new file mode 100644 index 0000000..8bdc357 --- /dev/null +++ b/distributed-tests/deploy_gluster_basic_instance.yml @@ -0,0 +1,80 @@ +--- +- name: Install basic packages + package: + state: present + name: + - automake + - autoconf + - libtool + - flex + - bison + - openssl-devel + - libxml2-devel + - python-devel + - libaio-devel + - libibverbs-devel + - librdmacm-devel + - readline-devel + - lvm2-devel + - glib2-devel + - userspace-rcu-devel + - libcmocka-devel + - libacl-devel + - sqlite-devel + - fuse-devel + - redhat-rpm-config + +- name: Remove package that cause trouble with the regression suite + package: + state: absent + name: + - qemu-img + - glusterfs-libs + - glusterfs + - glusterfs-api + - glusterfs-client-xlators + +# current regression test suite do not support ipv6, so we have to disable +# it +- lineinfile: + dest: /etc/sysconfig/network-scripts/ifcfg-eth0 + regexp: ^IPV6INIT= + line: IPV6INIT=no + name: Disable ipv6 in eth0 config + +- lineinfile: + dest: /etc/sysconfig/network + regexp: ^NETWORKING_IPV6= + line: NETWORKING_IPV6=no + name: Disable ipv6 in network config + +- sysctl: + name: "{{ item }}" + value: 1 + state: present + reload: yes + with_items: + - net.ipv6.conf.all.disable_ipv6 + - net.ipv6.conf.default.disable_ipv6 + name: Disable ipv6 in sysctl + notify: + - run dracut + +# use "install ipv6 /bin/true", since that's what ip6tables check to see if +# ipv6 is disabled. See reload function on /etc/init.d/ip6tables on RHEL 6. +- copy: + dest: /etc/modprobe.d/ipv6.conf + content: "options ipv6 disable=1\ninstall ipv6 /bin/true" + name: Disable ipv6 module + +- name: Create various directories for tests + file: + name: "{{ item }}" + mode: "u=rwx,g=rx,o=rx" + owner: root + group: root + state: directory + with_items: + - /var/log/glusterfs + - /var/lib/glusterd + - /var/run/gluster From 993e05059d97a653b31c127a5c2f4745567c3d2d Mon Sep 17 00:00:00 2001 From: Deepshikha Khandelwal Date: Thu, 11 Oct 2018 14:04:31 +0530 Subject: [PATCH 2/3] Set dynamic group name of instance in rax module Signed-off-by: Deepshikha Khandelwal --- distributed-tests/create-vm.yml | 2 +- distributed-tests/delete-vm.yml | 2 +- .../deploy_gluster_basic_instance.yml | 168 ++++++++++-------- distributed-tests/setup.yml | 6 +- 4 files changed, 100 insertions(+), 78 deletions(-) diff --git a/distributed-tests/create-vm.yml b/distributed-tests/create-vm.yml index 1dab797..5f60464 100755 --- a/distributed-tests/create-vm.yml +++ b/distributed-tests/create-vm.yml @@ -15,7 +15,7 @@ count: '{{ COUNT }}' count_offset: 1 exact_count: yes - group: distributed-test + group: '{{ NAME }}' wait: yes register: rax diff --git a/distributed-tests/delete-vm.yml b/distributed-tests/delete-vm.yml index 7c93349..28764aa 100755 --- a/distributed-tests/delete-vm.yml +++ b/distributed-tests/delete-vm.yml @@ -9,7 +9,7 @@ flavor: performance1-2 image: 8bca010c-c027-4947-b9c9-adaae6e4f020 state: absent - group: distributed-test + group: '{{ NAME }}' wait: True wait_timeout: 600 with_items: "{{ groups['all'] }}" diff --git a/distributed-tests/deploy_gluster_basic_instance.yml b/distributed-tests/deploy_gluster_basic_instance.yml index 8bdc357..f156c2f 100644 --- a/distributed-tests/deploy_gluster_basic_instance.yml +++ b/distributed-tests/deploy_gluster_basic_instance.yml @@ -1,80 +1,102 @@ --- -- name: Install basic packages - package: - state: present - name: - - automake - - autoconf - - libtool - - flex - - bison - - openssl-devel - - libxml2-devel - - python-devel - - libaio-devel - - libibverbs-devel - - librdmacm-devel - - readline-devel - - lvm2-devel - - glib2-devel - - userspace-rcu-devel - - libcmocka-devel - - libacl-devel - - sqlite-devel - - fuse-devel - - redhat-rpm-config +- name: Deploy basic instance for gluster-test + hosts: all + gather_facts: yes + handlers: + - name: run dracut + command: dracut -v -f + - name: restart sshd + service: name=sshd state=restarted + roles: + - openssh + - selinux + tasks: + - name: Install basic packages + package: + state: present + name: + - automake + - autoconf + - libtool + - flex + - bison + - openssl-devel + - libxml2-devel + - python-devel + - libaio-devel + - libibverbs-devel + - librdmacm-devel + - readline-devel + - lvm2-devel + - glib2-devel + - userspace-rcu-devel + - libcmocka-devel + - libacl-devel + - sqlite-devel + - fuse-devel + - redhat-rpm-config + - nfs-utils + - git -- name: Remove package that cause trouble with the regression suite - package: - state: absent - name: - - qemu-img - - glusterfs-libs - - glusterfs - - glusterfs-api - - glusterfs-client-xlators + - name: Remove package that cause trouble with the regression suite + package: + state: absent + name: + - qemu-img + - glusterfs-libs + - glusterfs + - glusterfs-api + - glusterfs-client-xlators -# current regression test suite do not support ipv6, so we have to disable -# it -- lineinfile: - dest: /etc/sysconfig/network-scripts/ifcfg-eth0 - regexp: ^IPV6INIT= - line: IPV6INIT=no - name: Disable ipv6 in eth0 config + # current regression test suite do not support ipv6, so we have to disable + # it + - lineinfile: + dest: /etc/sysconfig/network-scripts/ifcfg-eth0 + regexp: ^IPV6INIT= + line: IPV6INIT=no + name: Disable ipv6 in eth0 config -- lineinfile: - dest: /etc/sysconfig/network - regexp: ^NETWORKING_IPV6= - line: NETWORKING_IPV6=no - name: Disable ipv6 in network config + - lineinfile: + dest: /etc/sysconfig/network + regexp: ^NETWORKING_IPV6= + line: NETWORKING_IPV6=no + name: Disable ipv6 in network config -- sysctl: - name: "{{ item }}" - value: 1 - state: present - reload: yes - with_items: - - net.ipv6.conf.all.disable_ipv6 - - net.ipv6.conf.default.disable_ipv6 - name: Disable ipv6 in sysctl - notify: - - run dracut + - sysctl: + name: "{{ item }}" + value: 1 + state: present + reload: yes + with_items: + - net.ipv6.conf.all.disable_ipv6 + - net.ipv6.conf.default.disable_ipv6 + name: Disable ipv6 in sysctl + notify: + - run dracut -# use "install ipv6 /bin/true", since that's what ip6tables check to see if -# ipv6 is disabled. See reload function on /etc/init.d/ip6tables on RHEL 6. -- copy: - dest: /etc/modprobe.d/ipv6.conf - content: "options ipv6 disable=1\ninstall ipv6 /bin/true" - name: Disable ipv6 module + # use "install ipv6 /bin/true", since that's what ip6tables check to see if + # ipv6 is disabled. See reload function on /etc/init.d/ip6tables on RHEL 6. + - copy: + dest: /etc/modprobe.d/ipv6.conf + content: "options ipv6 disable=1\ninstall ipv6 /bin/true" + name: Disable ipv6 module -- name: Create various directories for tests - file: - name: "{{ item }}" - mode: "u=rwx,g=rx,o=rx" - owner: root - group: root - state: directory - with_items: - - /var/log/glusterfs - - /var/lib/glusterd - - /var/run/gluster + - name: Create various directories for tests + file: + name: "{{ item }}" + mode: "u=rwx,g=rx,o=rx" + owner: root + group: root + state: directory + with_items: + - /var/log/glusterfs + - /var/lib/glusterd + - /var/run/gluster + + - name: Make sure that root can use password + lineinfile: + dest: /etc/ssh/sshd_config + regexp: "^PermitRootLogin" + line: "PermitRootLogin yes" + state: present + notify: restart sshd diff --git a/distributed-tests/setup.yml b/distributed-tests/setup.yml index a277702..4b50b52 100755 --- a/distributed-tests/setup.yml +++ b/distributed-tests/setup.yml @@ -3,12 +3,12 @@ hosts: all gather_facts: no tasks: - - local_action: - module: wait_for + - wait_for: port: 22 - host: "{{ ansible_ssh_host }}" + host: '{{ ansible_host }}' search_regex: OpenSSH delay: 10 + connection: local - hosts: all gather_facts: yes From 75a42122878d1283b1f3652ebdd3cc764a35dcd9 Mon Sep 17 00:00:00 2001 From: Deepshikha Date: Thu, 25 Oct 2018 14:04:27 +0530 Subject: [PATCH 3/3] Add requirements.yml for the base image of gluster playbook --- ...nstance.yml => deploy-gluster-basic-instance.yml} | 12 ++++++++++++ distributed-tests/requirements.yml | 5 +++++ 2 files changed, 17 insertions(+) rename distributed-tests/{deploy_gluster_basic_instance.yml => deploy-gluster-basic-instance.yml} (91%) create mode 100644 distributed-tests/requirements.yml diff --git a/distributed-tests/deploy_gluster_basic_instance.yml b/distributed-tests/deploy-gluster-basic-instance.yml similarity index 91% rename from distributed-tests/deploy_gluster_basic_instance.yml rename to distributed-tests/deploy-gluster-basic-instance.yml index f156c2f..0c4eea7 100644 --- a/distributed-tests/deploy_gluster_basic_instance.yml +++ b/distributed-tests/deploy-gluster-basic-instance.yml @@ -37,6 +37,9 @@ - redhat-rpm-config - nfs-utils - git + - dbench + - libcurl-devel + - psmisc - name: Remove package that cause trouble with the regression suite package: @@ -92,6 +95,15 @@ - /var/log/glusterfs - /var/lib/glusterd - /var/run/gluster + - /d + - /archives + - /d/archived_builds + - /d/backends + - /d/build + - /d/logs + - /archives/archived_builds + - /archives/log + - /archives/logs - name: Make sure that root can use password lineinfile: diff --git a/distributed-tests/requirements.yml b/distributed-tests/requirements.yml new file mode 100644 index 0000000..3833108 --- /dev/null +++ b/distributed-tests/requirements.yml @@ -0,0 +1,5 @@ +--- +- src: https://github.com/OSAS/ansible-role-openssh + name: openssh +- src: https://github.com/OSAS/ansible-role-selinux + name: selinux