summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/nova-db.yml
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/usr/share/openstack/nova-db.yml')
-rw-r--r--openstack/usr/share/openstack/nova-db.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/nova-db.yml b/openstack/usr/share/openstack/nova-db.yml
new file mode 100644
index 0000000..e7dc5b1
--- /dev/null
+++ b/openstack/usr/share/openstack/nova-db.yml
@@ -0,0 +1,51 @@
+---
+- hosts: localhost
+ vars_files:
+ - "/etc/openstack/nova.conf"
+ tasks:
+ - name: Create nova service user in service tenant
+ keystone_user:
+ user: "{{ NOVA_SERVICE_USER }}"
+ password: "{{ NOVA_SERVICE_PASSWORD }}"
+ tenant: service
+ token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"
+
+ - name: Assign admin role to nova service user in the service tenant
+ keystone_user:
+ role: admin
+ user: "{{ NOVA_SERVICE_USER }}"
+ tenant: service
+ token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"
+
+ - name: Add nova endpoint
+ keystone_service:
+ name: nova
+ type: compute
+ description: Openstack Compute Service
+ publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s'
+ internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s'
+ adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s'
+ region: 'regionOne'
+ token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}"
+
+ - name: Create postgresql user for nova
+ postgresql_user:
+ name: "{{ NOVA_DB_USER }}"
+ login_host: "{{ CONTROLLER_HOST_ADDRESS }}"
+ password: "{{ NOVA_DB_PASSWORD }}"
+ sudo: yes
+ sudo_user: nova
+
+ - name: Create database for nova services
+ postgresql_db:
+ name: nova
+ owner: "{{ NOVA_DB_USER }}"
+ login_host: "{{ CONTROLLER_HOST_ADDRESS }}"
+ sudo: yes
+ sudo_user: nova
+
+ - name: Initiate nova database
+ nova_manage:
+ action: dbsync
+ sudo: yes
+ sudo_user: nova