summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/glance
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-08-06 02:37:33 -0400
committerbaigk <baiguoku@huawei.com>2015-08-09 22:47:56 -0400
commit87612abc0e24cafd89a49e350165b08fe1608233 (patch)
tree07b156c0268fd189f92e8a0730118edc51b8073f /deploy/adapters/ansible/roles/glance
parent5aedf594112c0749b6e9039d15b9fe70d210a942 (diff)
support deployment openstack juno with ansible for compass in centos7.1
JIRA: COMPASS-6 Change-Id: I8ef865e8acfe29c3ff5c7e9030e4cebabed3457b Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/glance')
-rw-r--r--deploy/adapters/ansible/roles/glance/handlers/main.yml8
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/glance_config.yml4
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/glance_install.yml11
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/nfs.yml4
-rw-r--r--deploy/adapters/ansible/roles/glance/templates/glance-api.conf4
-rw-r--r--deploy/adapters/ansible/roles/glance/vars/Debian.yml12
-rw-r--r--deploy/adapters/ansible/roles/glance/vars/RedHat.yml11
-rw-r--r--deploy/adapters/ansible/roles/glance/vars/main.yml5
8 files changed, 35 insertions, 24 deletions
diff --git a/deploy/adapters/ansible/roles/glance/handlers/main.yml b/deploy/adapters/ansible/roles/glance/handlers/main.yml
index d8eaa44a..7fdaea55 100644
--- a/deploy/adapters/ansible/roles/glance/handlers/main.yml
+++ b/deploy/adapters/ansible/roles/glance/handlers/main.yml
@@ -1,6 +1,4 @@
---
-- name: restart glance-api
- service: name=glance-api state=restarted enabled=yes
-
-- name: restart glance-registry
- service: name=glance-registry state=restarted enabled=yes
+- name: restart glance services
+ service: name={{ item }} state=restarted enabled=yes
+ with_items: services | union(services_noarch)
diff --git a/deploy/adapters/ansible/roles/glance/tasks/glance_config.yml b/deploy/adapters/ansible/roles/glance/tasks/glance_config.yml
index 008595dc..0960acfc 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/glance_config.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/glance_config.yml
@@ -1,6 +1,7 @@
---
- name: init glance db version
shell: glance-manage db_version_control 0
+ when: ansible_os_family == "Debian"
- name: sync glance db
shell: sleep 15; su -s /bin/sh -c "glance-manage db_sync" glance
@@ -9,8 +10,7 @@
retries: 5
delay: 3
notify:
- - restart glance-registry
- - restart glance-api
+ - restart glance services
- meta: flush_handlers
diff --git a/deploy/adapters/ansible/roles/glance/tasks/glance_install.yml b/deploy/adapters/ansible/roles/glance/tasks/glance_install.yml
index d9d15db3..294b35e8 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/glance_install.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/glance_install.yml
@@ -1,13 +1,11 @@
---
-- include_vars: "{{ ansible_os_family }}.yml"
-
- name: install glance packages
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest force=yes"
- with_items: glance_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
+ with_items: packages | union(packages_noarch)
- name: generate glance service list
shell: echo {{ item }} >> /opt/service
- with_items: glance_services
+ with_items: services | union(services_noarch)
- name: update glance conf
template: src={{ item }} dest=/etc/glance/{{ item }}
@@ -16,8 +14,7 @@
- glance-api.conf
- glance-registry.conf
notify:
- - restart glance-registry
- - restart glance-api
+ - restart glance services
- name: remove default sqlite db
shell: rm /var/lib/glance/glance.sqlite || touch glance.sqllite.db.removed
diff --git a/deploy/adapters/ansible/roles/glance/tasks/nfs.yml b/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
index 70ed91d5..dc1be977 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
@@ -1,7 +1,7 @@
---
- name: install packages
- action: "{{ ansible_pkg_mgr }} name=nfs-common state=present"
- with_items: nfs-packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: nfs_packages
- name: install nfs
local_action: yum name=nfs-utils state=present
diff --git a/deploy/adapters/ansible/roles/glance/templates/glance-api.conf b/deploy/adapters/ansible/roles/glance/templates/glance-api.conf
index 2ce74797..3046ab37 100644
--- a/deploy/adapters/ansible/roles/glance/templates/glance-api.conf
+++ b/deploy/adapters/ansible/roles/glance/templates/glance-api.conf
@@ -1,9 +1,9 @@
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
-#verbose = False
+verbose = {{ VERBOSE }}
# Show debugging output in logs (sets DEBUG log level output)
-#debug = False
+debug = {{ DEBUG }}
# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
diff --git a/deploy/adapters/ansible/roles/glance/vars/Debian.yml b/deploy/adapters/ansible/roles/glance/vars/Debian.yml
index feacea1e..b295ff28 100644
--- a/deploy/adapters/ansible/roles/glance/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/glance/vars/Debian.yml
@@ -1,11 +1,11 @@
---
-glance_packages:
+
+packages:
- glance
- - python-glanceclient
-glance_services:
+nfs_packages:
+ - nfs-common
+
+services:
- glance-registry
- glance-api
-
-nfs-packages:
- - nfs-common
diff --git a/deploy/adapters/ansible/roles/glance/vars/RedHat.yml b/deploy/adapters/ansible/roles/glance/vars/RedHat.yml
new file mode 100644
index 00000000..e26b7034
--- /dev/null
+++ b/deploy/adapters/ansible/roles/glance/vars/RedHat.yml
@@ -0,0 +1,11 @@
+---
+packages:
+ - openstack-glance
+
+nfs_packages:
+ - nfs-utils
+ - rpcbind
+
+services:
+ - openstack-glance-api
+ - openstack-glance-registry
diff --git a/deploy/adapters/ansible/roles/glance/vars/main.yml b/deploy/adapters/ansible/roles/glance/vars/main.yml
new file mode 100644
index 00000000..83e90ff1
--- /dev/null
+++ b/deploy/adapters/ansible/roles/glance/vars/main.yml
@@ -0,0 +1,5 @@
+---
+packages_noarch:
+ - python-glanceclient
+
+services_noarch: []