Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playbook to setup the basic instance of gluster #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distributed-tests/create-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
count: '{{ COUNT }}'
count_offset: 1
exact_count: yes
group: distributed-test
group: '{{ NAME }}'
wait: yes
register: rax

Expand Down
2 changes: 1 addition & 1 deletion distributed-tests/delete-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }}"
114 changes: 114 additions & 0 deletions distributed-tests/deploy-gluster-basic-instance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
- name: Deploy basic instance for gluster-test
hosts: all
gather_facts: yes
handlers:
- name: run dracut
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

command: dracut -v -f
- name: restart sshd
service: name=sshd state=restarted
roles:
- openssh
- selinux
tasks:
- name: Install basic packages
package:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use yum instead. The package module doesn't group tasks into one step.

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
- dbench
- libcurl-devel
- psmisc

- 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
- /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:
dest: /etc/ssh/sshd_config
regexp: "^PermitRootLogin"
line: "PermitRootLogin yes"
state: present
notify: restart sshd
5 changes: 5 additions & 0 deletions distributed-tests/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- src: https://github.com/OSAS/ansible-role-openssh
name: openssh
- src: https://github.com/OSAS/ansible-role-selinux
name: selinux
6 changes: 3 additions & 3 deletions distributed-tests/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down