summaryrefslogtreecommitdiff
path: root/openstack/usr
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-14 18:54:57 +0000
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-04-16 16:30:44 +0000
commitc975815f5810553709ca967e52bbfa5fc61d3216 (patch)
treed28d95ac5925bbd1736691a45c9d62dc859e5b60 /openstack/usr
parent0aa33ca0596dcb6a388c1228707f69112be4c052 (diff)
downloaddefinitions-c975815f5810553709ca967e52bbfa5fc61d3216.tar.gz
OpenStack: Split nova into control and compute
This adds NOVA_ENABLE_{CONTROLLER,COMPUTE}. Both are enabled by deafult, but if CONTROLLER is enabled but COMPUTE isn't, then the conductor service is enabled. Change-Id: I523a7270d4afdcd1e2a30eaac42ea499581fe971
Diffstat (limited to 'openstack/usr')
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-api.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-cert.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-compute.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-conductor.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-config-setup.service (renamed from openstack/usr/lib/systemd/system/openstack-nova-setup.service)6
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-consoleauth.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-db-setup.service11
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-novncproxy.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-scheduler.service3
-rw-r--r--openstack/usr/lib/systemd/system/openstack-nova-serialproxy.service3
-rw-r--r--openstack/usr/share/openstack/nova-config.yml34
-rw-r--r--openstack/usr/share/openstack/nova-db.yml (renamed from openstack/usr/share/openstack/nova.yml)51
12 files changed, 64 insertions, 62 deletions
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-api.service b/openstack/usr/lib/systemd/system/openstack-nova-api.service
index 8ee9cefa..d06afcaa 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-api.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-api.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Compute Service (code-named Nova) API server
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-cert.service b/openstack/usr/lib/systemd/system/openstack-nova-cert.service
index b2a2e1cc..418b060c 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-cert.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-cert.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Nova Cert
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-compute.service b/openstack/usr/lib/systemd/system/openstack-nova-compute.service
index 95a3a872..c9c6924c 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-compute.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-compute.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Compute Service (code-named Nova) compute server
-After=syslog.target network-online.target libvirtd.service
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target libvirtd.service openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
Requires=libvirtd.service
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-conductor.service b/openstack/usr/lib/systemd/system/openstack-nova-conductor.service
index 1d2ece69..bf8e0631 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-conductor.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-conductor.service
@@ -1,6 +1,7 @@
[Unit]
Description=Database-access support for Compute nodes (nova-conductor)
-After=syslog.target network-online.target libvirtd.service
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target libvirtd.service openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
Requires=libvirtd.service
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-setup.service b/openstack/usr/lib/systemd/system/openstack-nova-config-setup.service
index a4ad6ae7..0ba467ad 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-setup.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-config-setup.service
@@ -1,9 +1,9 @@
[Unit]
-Description=Run nova-setup Ansible scripts
-After=local-fs.target libvirtd.service openstack-keystone-setup.service postgres-server.service
+Description=Run nova-config-setup Ansible scripts
+ConditionPathExists=/etc/openstack/neutron.conf
[Service]
-ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/nova.yml
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/nova-config.yml
[Install]
WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-consoleauth.service b/openstack/usr/lib/systemd/system/openstack-nova-consoleauth.service
index 66442d11..68607354 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-consoleauth.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-consoleauth.service
@@ -1,6 +1,7 @@
[Unit]
Description=Openstack Console Auth (nova-consoleauth)
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-db-setup.service b/openstack/usr/lib/systemd/system/openstack-nova-db-setup.service
new file mode 100644
index 00000000..ebe7e2bc
--- /dev/null
+++ b/openstack/usr/lib/systemd/system/openstack-nova-db-setup.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Run nova-db-setup Ansible scripts
+ConditionPathExists=/etc/openstack/neutron.conf
+After=postgres-server.service openstack-keystone.service openstack-keystone-setup.service
+Wants=postgres-server.service openstack-keystone.service
+
+[Service]
+ExecStart=/usr/bin/ansible-playbook -v -M /usr/share/ansible/ansible-openstack-modules -i /usr/share/openstack/hosts /usr/share/openstack/nova-db.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-novncproxy.service b/openstack/usr/lib/systemd/system/openstack-nova-novncproxy.service
index 597f357a..ecdadde2 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-novncproxy.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-novncproxy.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Nova NoVNC proxy
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-scheduler.service b/openstack/usr/lib/systemd/system/openstack-nova-scheduler.service
index d317b624..9009d49a 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-scheduler.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-scheduler.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Nova Scheduler
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/lib/systemd/system/openstack-nova-serialproxy.service b/openstack/usr/lib/systemd/system/openstack-nova-serialproxy.service
index 2d95c1fa..5f5a5b41 100644
--- a/openstack/usr/lib/systemd/system/openstack-nova-serialproxy.service
+++ b/openstack/usr/lib/systemd/system/openstack-nova-serialproxy.service
@@ -1,6 +1,7 @@
[Unit]
Description=OpenStack Nova Serial Proxy
-After=syslog.target network-online.target
+ConditionPathExists=/etc/nova/nova.conf
+After=network-online.target openstack-nova-config-setup.service openstack-nova-db-setup.service
Wants=network-online.target
[Service]
diff --git a/openstack/usr/share/openstack/nova-config.yml b/openstack/usr/share/openstack/nova-config.yml
new file mode 100644
index 00000000..4f43db39
--- /dev/null
+++ b/openstack/usr/share/openstack/nova-config.yml
@@ -0,0 +1,34 @@
+---
+- hosts: localhost
+ vars_files:
+ - "/etc/openstack/nova.conf"
+ tasks:
+ - name: Create the nova user.
+ user:
+ name: nova
+ comment: Openstack Nova Daemons
+ shell: /sbin/nologin
+ home: /var/lib/nova
+ groups: libvirt
+ append: yes
+
+ - name: Create the /var folders for nova
+ file:
+ path: "{{ item }}"
+ state: directory
+ owner: nova
+ group: nova
+ with_items:
+ - /var/run/nova
+ - /var/lock/nova
+ - /var/log/nova
+ - /var/lib/nova
+ - /var/lib/nova/instances
+
+ - file: path=/etc/nova state=directory
+ - name: Add the configuration needed for nova in /etc/nova using templates
+ template:
+ src: /usr/share/openstack/nova/{{ item }}
+ dest: /etc/nova/{{ item }}
+ with_lines:
+ - cd /usr/share/openstack/nova && find -type f
diff --git a/openstack/usr/share/openstack/nova.yml b/openstack/usr/share/openstack/nova-db.yml
index c1122c60..e7dc5b10 100644
--- a/openstack/usr/share/openstack/nova.yml
+++ b/openstack/usr/share/openstack/nova-db.yml
@@ -3,36 +3,6 @@
vars_files:
- "/etc/openstack/nova.conf"
tasks:
- - name: Create the nova user.
- user:
- name: nova
- comment: Openstack Nova Daemons
- shell: /sbin/nologin
- home: /var/lib/nova
- groups: libvirt
- append: yes
-
- - name: Create the /var folders for nova
- file:
- path: "{{ item }}"
- state: directory
- owner: nova
- group: nova
- with_items:
- - /var/run/nova
- - /var/lock/nova
- - /var/log/nova
- - /var/lib/nova
- - /var/lib/nova/instances
-
- - file: path=/etc/nova state=directory
- - name: Add the configuration needed for nova in /etc/nova using templates
- template:
- src: /usr/share/openstack/nova/{{ item }}
- dest: /etc/nova/{{ item }}
- with_lines:
- - cd /usr/share/openstack/nova && find -type f
-
- name: Create nova service user in service tenant
keystone_user:
user: "{{ NOVA_SERVICE_USER }}"
@@ -79,24 +49,3 @@
action: dbsync
sudo: yes
sudo_user: nova
-
-
-
-# [1] Never enable openstack-nova-conductor service in a node with
-# openstack-nova-compute or the security benefits of removing
-# database access from nova-compute will be negated
-#systemctl start openstack-nova-conductor
- - name: Enable and start openstack-nova services
- service:
- name: "{{ item }}"
- enabled: yes
- state: started
- with_items:
- - openstack-nova-api.service
- - openstack-nova-cert.service
- - openstack-nova-compute.service
- - openstack-nova-consoleauth.service
- - openstack-nova-novncproxy.service
- - openstack-nova-scheduler.service
- - openstack-nova-serialproxy.service
-# - openstack-nova-conductor.service