forked from phips/ansible-cs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yaml
72 lines (58 loc) · 2.25 KB
/
playbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
- hosts: default
sudo: yes
vars:
myname: csmgr
mysql_cloud_password: CHANGEME
deploy-to-xen: True
tasks:
- name: Set SELinux to permissive
selinux: policy=targeted state=permissive
- name: Ensure required packages are installed
yum: name={{ item }} state=present
with_items:
- libselinux-python
- mysql-server
- nfs-utils
- name: Ensure EPEL RPM installed
yum: name=http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm state=present
- name: Ensure aliases.sh present
copy: src=files/aliases.sh dest=/etc/profile.d/aliases.sh
owner=root group=root mode=0644
- name: Ensure hostname set
hostname: name={{ myname }}
- name: Ensure hostname is in /etc/hosts
lineinfile:
dest=/etc/hosts
regexp="{{ ansible_default_ipv4.address }} {{ myname }}"
line="{{ ansible_default_ipv4.address }} {{ myname }}"
- name: Ensure MySQL running
service: name=mysqld state=started
- name: Ensure CloudStack specifc my.cnf tunings present
lineinfile: dest=/etc/my.cnf regexp="{{ item }}" line="{{ item }}"
with_items:
- skip-name-resolve
- innodb_rollback_on_timeout=1
- innodb_lock_wait_timeout=600
- max_connections=350
- log-bin=mysql-bin
- binlog-format='ROW'
notify:
- mysql restart
- name: Ensure CloudStack Yumrepo configured
copy: src=files/cloudstack.repo dest=/etc/yum.repos.d/cloudstack.repo
owner=root group=root mode=0644
- name: Ensure CloudStack Management installed
yum: name=cloudstack-management state=installed
- name: Get vhd-util (for XenServer only)
get_url: url=http://download.cloud.com.s3.amazonaws.com/tools/vhd-util
dest=/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver
mode=0755
when: deploy-to-xen
- name: Setup CloudStack database
command: /usr/bin/cloudstack-setup-databases cloud:{{ mysql_cloud_password }}@localhost --deploy-as=root
- name: Setup CloudStack manager
command: /usr/bin/cloudstack-setup-management
handlers:
- name: mysql restart
service: name=mysqld enabled=yes state=restarted