aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/heat
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2015-11-23 15:22:28 +0800
committerQiLiang <liangqi1@huawei.com>2015-12-02 11:58:45 +0800
commit065da65479888dcf5340a8d15d7d8a4cadce6264 (patch)
tree805b621e5117f721069a92c8986c6dd106b7253d /deploy/adapters/ansible/roles/heat
parent3c48d787b3caa3a12153257abf66e3211109b8f5 (diff)
compass4nfv support heat
JIRA: COMPASS-52 Change-Id: I0cab3ba4d435b2b28eff9a1a73c3d829be731e3d Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/heat')
-rw-r--r--deploy/adapters/ansible/roles/heat/handlers/main.yml8
-rw-r--r--deploy/adapters/ansible/roles/heat/tasks/heat_config.yml9
-rw-r--r--deploy/adapters/ansible/roles/heat/tasks/heat_install.yml19
-rw-r--r--deploy/adapters/ansible/roles/heat/tasks/main.yml14
-rw-r--r--deploy/adapters/ansible/roles/heat/templates/heat.j222
-rw-r--r--deploy/adapters/ansible/roles/heat/vars/Debian.yml12
-rw-r--r--deploy/adapters/ansible/roles/heat/vars/RedHat.yml5
-rw-r--r--deploy/adapters/ansible/roles/heat/vars/main.yml5
8 files changed, 94 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/heat/handlers/main.yml b/deploy/adapters/ansible/roles/heat/handlers/main.yml
new file mode 100644
index 00000000..74bcd10a
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/handlers/main.yml
@@ -0,0 +1,8 @@
+---
+- name: restart heat service
+ service: name={{ item }} state=restarted enabled=yes
+ with_items: services | union(services_noarch)
+
+- name: remove heat-sqlite-db
+ shell: rm /var/lib/heat/heat.sqlite || touch heat.sqlite.db.removed
+
diff --git a/deploy/adapters/ansible/roles/heat/tasks/heat_config.yml b/deploy/adapters/ansible/roles/heat/tasks/heat_config.yml
new file mode 100644
index 00000000..739d1aae
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/tasks/heat_config.yml
@@ -0,0 +1,9 @@
+---
+- name: heat db sync
+ shell: su -s /bin/sh -c "heat-manage db_sync" heat
+ ignore_errors: True
+ notify:
+ - restart heat service
+
+- meta: flush_handlers
+
diff --git a/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml b/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
new file mode 100644
index 00000000..ab23f873
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/tasks/heat_install.yml
@@ -0,0 +1,19 @@
+---
+- include_vars: "{{ ansible_os_family }}.yml"
+
+- name: install heat related packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: packages | union(packages_noarch)
+
+- name: generate heat service list
+ shell: echo {{ item }} >> /opt/service
+ with_items: services | union(services_noarch)
+
+- name: update heat conf
+ template: src=heat.j2
+ dest=/etc/heat/heat.conf
+ backup=yes
+ notify:
+ - restart heat service
+ - remove heat-sqlite-db
+
diff --git a/deploy/adapters/ansible/roles/heat/tasks/main.yml b/deploy/adapters/ansible/roles/heat/tasks/main.yml
new file mode 100644
index 00000000..cf259eb5
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- include: heat_install.yml
+ tags:
+ - install
+ - heat_install
+ - heat
+
+- include: heat_config.yml
+ when: HA_CLUSTER is not defined or HA_CLUSTER[inventory_hostname] == ''
+ tags:
+ - config
+ - heat_config
+ - heat
+
diff --git a/deploy/adapters/ansible/roles/heat/templates/heat.j2 b/deploy/adapters/ansible/roles/heat/templates/heat.j2
new file mode 100644
index 00000000..67beb1ca
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/templates/heat.j2
@@ -0,0 +1,22 @@
+[DEFAULT]
+heat_metadata_server_url = http://{{ internal_vip.ip }}:8000
+heat_waitcondition_server_url = http://{{ internal_vip.ip }}:8000/v1/waitcondition
+rpc_backend = rabbit
+rabbit_host = {{ rabbit_host }}
+rabbit_userid = {{ RABBIT_USER }}
+rabbit_password = {{ RABBIT_PASS }}
+log_dir = /var/log/heat
+
+[database]
+connection = mysql://heat:{{ HEAT_DBPASS }}@{{ db_host }}/heat
+
+[ec2authtoken]
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+
+[keystone_authtoken]
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
+admin_tenant_name = service
+admin_user = heat
+admin_password = {{ HEAT_PASS }}
+
diff --git a/deploy/adapters/ansible/roles/heat/vars/Debian.yml b/deploy/adapters/ansible/roles/heat/vars/Debian.yml
new file mode 100644
index 00000000..03787bcb
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/vars/Debian.yml
@@ -0,0 +1,12 @@
+---
+packages:
+ - heat-api
+ - heat-api-cfn
+ - heat-engine
+ - python-heatclient
+
+services:
+ - heat-api
+ - heat-api-cfn
+ - heat-engine
+
diff --git a/deploy/adapters/ansible/roles/heat/vars/RedHat.yml b/deploy/adapters/ansible/roles/heat/vars/RedHat.yml
new file mode 100644
index 00000000..25b318d0
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/vars/RedHat.yml
@@ -0,0 +1,5 @@
+---
+services: []
+
+packages: []
+
diff --git a/deploy/adapters/ansible/roles/heat/vars/main.yml b/deploy/adapters/ansible/roles/heat/vars/main.yml
new file mode 100644
index 00000000..05d75010
--- /dev/null
+++ b/deploy/adapters/ansible/roles/heat/vars/main.yml
@@ -0,0 +1,5 @@
+---
+packages_noarch: []
+
+services_noarch: []
+