From 4f15ac800855ca2b5625ac6e3efbb90f7dc62c16 Mon Sep 17 00:00:00 2001 From: Ryan Hallisey Date: Mon, 28 Sep 2015 15:59:53 -0400 Subject: Neutron Agents json support Neutron Agents is a special case for json support. Since it's a fat container, there will be multiple commnds that will need to be run in the container. In order to account for this, the commands will be hardcoded until the agents are split out to their own containers. The files will be copied the normal way. Co-Authored-By: Steven Dake Change-Id: I9fc226cc7b82c2594db5814d30d453a29a4af8c0 Partially-Implements: blueprint replace-config-external Closes-Bug: #1500566 --- ansible/roles/neutron/tasks/config.yml | 6 ++++ ansible/roles/neutron/tasks/start.yml | 2 +- .../roles/neutron/templates/neutron-agents.json.j2 | 41 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/neutron/templates/neutron-agents.json.j2 (limited to 'ansible') diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml index f7b5df470..e7cc7b191 100644 --- a/ansible/roles/neutron/tasks/config.yml +++ b/ansible/roles/neutron/tasks/config.yml @@ -137,6 +137,12 @@ 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 Agents JSON configuration file + template: + src: "roles/neutron/templates/neutron-agents.json.j2" + dest: "{{ node_config_directory }}/neutron-agents/config.json" + when: inventory_hostname in groups['neutron-server'] + - name: Copying Neutron Server JSON configuration file template: src: "roles/neutron/templates/neutron-server.json.j2" diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml index 7922aee05..67af9001f 100644 --- a/ansible/roles/neutron/tasks/start.yml +++ b/ansible/roles/neutron/tasks/start.yml @@ -142,7 +142,7 @@ image: "{{ neutron_agents_image_full }}" volumes: - "/run:/run" - - "{{ node_config_directory }}/neutron-agents/:/opt/kolla/neutron-agents/:ro" + - "{{ node_config_directory }}/neutron-agents/:/opt/kolla/config_files/:ro" - "/var/lib/kolla/dev/log:/dev/log" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" diff --git a/ansible/roles/neutron/templates/neutron-agents.json.j2 b/ansible/roles/neutron/templates/neutron-agents.json.j2 new file mode 100644 index 000000000..4503acbae --- /dev/null +++ b/ansible/roles/neutron/templates/neutron-agents.json.j2 @@ -0,0 +1,41 @@ +{ + "command": "", + "config_files": [ + { + "source": "/opt/kolla/config_files/neutron.conf", + "dest": "/etc/neutron/neutron.conf", + "owner": "neutron", + "perm": "0600" + }, + { + "source": "/opt/kolla/config_files/dhcp_agent.ini", + "dest": "/etc/neutron/dhcp_agent.ini", + "owner": "neutron", + "perm": "0600" + }, + { + "source": "/opt/kolla/config_files/dnsmasq.conf", + "dest": "/etc/neutron/dnsmasq.conf", + "owner": "neutron", + "perm": "0600" + }, + { + "source": "/opt/kolla/config_files/l3_agent.ini", + "dest": "/etc/neutron/l3_agent.ini", + "owner": "neutron", + "perm": "0600" + }, + { + "source": "/opt/kolla/config_files/ml2_conf.ini", + "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini", + "owner": "neutron", + "perm": "0600" + }, + { + "source": "/opt/kolla/config_files/metadata_agent.ini", + "dest": "/etc/neutron/metadata_agent.ini", + "owner": "neutron", + "perm": "0600" + } + ] +} -- cgit v1.2.3