aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hallisey <rhallise@redhat.com>2015-09-17 13:03:52 -0400
committerSam Yaple <sam@yaple.net>2015-09-24 08:12:19 +0000
commit2c23f2d445fb6208b2fe1423845efd29b8e0408d (patch)
treed1cf47cc4e7e8d1a636c98793ce1af88ac67e3a9
parentaebb16fff9f33727aa9ce49120a1c6384544bfdc (diff)
downloadkolla-2c23f2d445fb6208b2fe1423845efd29b8e0408d.tar.gz
kolla-2c23f2d445fb6208b2fe1423845efd29b8e0408d.zip
Replace config-external with a JSON file for Neutron (thin)
This is only for the Neutron thin containers. The Neutron agents are still in a fat container. I'll replace in another patch. Change-Id: I8533af52bfa3f268aa8ffb1c16ae49f5a300da27 Partially-Implements: blueprint replace-config-external
-rw-r--r--ansible/roles/neutron/tasks/bootstrap.yml2
-rw-r--r--ansible/roles/neutron/tasks/config.yml17
-rw-r--r--ansible/roles/neutron/tasks/start.yml6
-rw-r--r--ansible/roles/neutron/templates/neutron-linuxbridge-agent.json.j217
-rw-r--r--ansible/roles/neutron/templates/neutron-openvswitch-agent.json.j217
-rw-r--r--ansible/roles/neutron/templates/neutron-server.json.j217
-rwxr-xr-xdocker/neutron/neutron-linuxbridge-agent/start.sh10
-rwxr-xr-xdocker/neutron/neutron-openvswitch-agent/start.sh10
-rwxr-xr-xdocker/neutron/neutron-server/start.sh10
9 files changed, 84 insertions, 22 deletions
diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml
index 846faf0bf..e21684e23 100644
--- a/ansible/roles/neutron/tasks/bootstrap.yml
+++ b/ansible/roles/neutron/tasks/bootstrap.yml
@@ -41,7 +41,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_neutron
image: "{{ neutron_server_image_full }}"
- volumes: "{{ node_config_directory }}/neutron-server/:/opt/kolla/neutron-server/:ro"
+ volumes: "{{ node_config_directory }}/neutron-server/:/opt/kolla/config_files/:ro"
env:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml
index f620ee018..541bd29d0 100644
--- a/ansible/roles/neutron/tasks/config.yml
+++ b/ansible/roles/neutron/tasks/config.yml
@@ -136,3 +136,20 @@
- "{{ node_templates_directory }}/{{ service_name }}/ml2_conf.ini_augment"
config_dest: "{{ node_config_directory }}/{{ service_name }}/ml2_conf.ini"
when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+
+- name: Copying Neutron Server JSON configuration file
+ template:
+ src: "roles/neutron/templates/neutron-server.json.j2"
+ dest: "{{ node_config_directory }}/neutron-server/config.json"
+
+- name: Copying Neutron OpenVSwitch JSON configuration file
+ template:
+ src: "roles/neutron/templates/neutron-openvswitch-agent.json.j2"
+ dest: "{{ node_config_directory }}/neutron-openvswitch-agent/config.json"
+ when: neutron_plugin_agent == "openvswitch"
+
+- name: Copying Neutron Linuxbridge JSON configuration file
+ template:
+ src: "roles/neutron/templates/neutron-server.json.j2"
+ dest: "{{ node_config_directory }}/neutron-linuxbridge-agent/config.json"
+ when: neutron_plugin_agent == "linuxbridge"
diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml
index e3e908627..a72cd51e8 100644
--- a/ansible/roles/neutron/tasks/start.yml
+++ b/ansible/roles/neutron/tasks/start.yml
@@ -64,7 +64,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: neutron_server
image: "{{ neutron_server_image_full }}"
- volumes: "{{ node_config_directory }}/neutron-server/:/opt/kolla/neutron-server/:ro"
+ volumes: "{{ node_config_directory }}/neutron-server/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['neutron-server']
@@ -87,7 +87,7 @@
volumes:
- "/run:/run"
- "/lib/modules:/lib/modules:ro"
- - "{{ node_config_directory }}/neutron-openvswitch-agent/:/opt/kolla/neutron-openvswitch-agent/:ro"
+ - "{{ node_config_directory }}/neutron-openvswitch-agent/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
@@ -111,7 +111,7 @@
volumes:
- "/run:/run"
- "/lib/modules:/lib/modules:ro"
- - "{{ node_config_directory }}/neutron-linuxbridge-agent/:/opt/kolla/neutron-linuxbridge-agent/:ro"
+ - "{{ node_config_directory }}/neutron-linuxbridge-agent/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
NEUTRON_BRIDGE: "br-ex"
diff --git a/ansible/roles/neutron/templates/neutron-linuxbridge-agent.json.j2 b/ansible/roles/neutron/templates/neutron-linuxbridge-agent.json.j2
new file mode 100644
index 000000000..68f3d586b
--- /dev/null
+++ b/ansible/roles/neutron/templates/neutron-linuxbridge-agent.json.j2
@@ -0,0 +1,17 @@
+{
+ "command": "/usr/bin/neutron-linuxbridge-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini",
+ "config_files": [
+ {
+ "source": "/opt/kolla/config_files/neutron.conf",
+ "dest": "/etc/neutron/neutron.conf",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "/opt/kolla/config_files/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/roles/neutron/templates/neutron-openvswitch-agent.json.j2 b/ansible/roles/neutron/templates/neutron-openvswitch-agent.json.j2
new file mode 100644
index 000000000..b0d2974a9
--- /dev/null
+++ b/ansible/roles/neutron/templates/neutron-openvswitch-agent.json.j2
@@ -0,0 +1,17 @@
+{
+ "command": "/usr/bin/neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini",
+ "config_files": [
+ {
+ "source": "/opt/kolla/config_files/neutron.conf",
+ "dest": "/etc/neutron/neutron.conf",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "/opt/kolla/config_files/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/roles/neutron/templates/neutron-server.json.j2 b/ansible/roles/neutron/templates/neutron-server.json.j2
new file mode 100644
index 000000000..de8020504
--- /dev/null
+++ b/ansible/roles/neutron/templates/neutron-server.json.j2
@@ -0,0 +1,17 @@
+{
+ "command": "/usr/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini",
+ "config_files": [
+ {
+ "source": "/opt/kolla/config_files/neutron.conf",
+ "dest": "/etc/neutron/neutron.conf",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "/opt/kolla/config_files/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/docker/neutron/neutron-linuxbridge-agent/start.sh b/docker/neutron/neutron-linuxbridge-agent/start.sh
index ab47f2dfb..f02472648 100755
--- a/docker/neutron/neutron-linuxbridge-agent/start.sh
+++ b/docker/neutron/neutron-linuxbridge-agent/start.sh
@@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
-CMD="/usr/bin/neutron-linuxbridge-agent"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
-
# Loading common functions.
source /opt/kolla/kolla-common.sh
source /opt/kolla/config-sudoers.sh
-# Execute config strategy
-set_configs
+# Generate run command
+python /opt/kolla/set_configs.py
+CMD=$(cat /run_command)
-exec $CMD $ARGS
+exec $CMD
diff --git a/docker/neutron/neutron-openvswitch-agent/start.sh b/docker/neutron/neutron-openvswitch-agent/start.sh
index 6d62ff65d..f02472648 100755
--- a/docker/neutron/neutron-openvswitch-agent/start.sh
+++ b/docker/neutron/neutron-openvswitch-agent/start.sh
@@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
-CMD="/usr/bin/neutron-openvswitch-agent"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
-
# Loading common functions.
source /opt/kolla/kolla-common.sh
source /opt/kolla/config-sudoers.sh
-# Execute config strategy
-set_configs
+# Generate run command
+python /opt/kolla/set_configs.py
+CMD=$(cat /run_command)
-exec $CMD $ARGS
+exec $CMD
diff --git a/docker/neutron/neutron-server/start.sh b/docker/neutron/neutron-server/start.sh
index 51c4c2a3d..c6ae197d4 100755
--- a/docker/neutron/neutron-server/start.sh
+++ b/docker/neutron/neutron-server/start.sh
@@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
-CMD="/usr/bin/neutron-server"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
-
# Loading common functions.
source /opt/kolla/kolla-common.sh
-# Execute config strategy
-set_configs
+# Generate run command
+python /opt/kolla/set_configs.py
+CMD=$(cat /run_command)
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -17,4 +15,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
-exec $CMD $ARGS
+exec $CMD