diff --git a/playbooks/roles/os_neutron/tasks/main.yml b/playbooks/roles/os_neutron/tasks/main.yml index d274629668..a5148545b0 100644 --- a/playbooks/roles/os_neutron/tasks/main.yml +++ b/playbooks/roles/os_neutron/tasks/main.yml @@ -19,7 +19,7 @@ - include: neutron_db_setup.yml when: > - inventory_hostname == groups['neutron_all'][0] + inventory_hostname == groups['neutron_server'][0] - include: neutron_service_setup.yml when: > diff --git a/playbooks/roles/os_neutron/tasks/neutron_post_install.yml b/playbooks/roles/os_neutron/tasks/neutron_post_install.yml index b6d4ba0708..aefdcccf75 100644 --- a/playbooks/roles/os_neutron/tasks/neutron_post_install.yml +++ b/playbooks/roles/os_neutron/tasks/neutron_post_install.yml @@ -27,6 +27,20 @@ - neutron-config - name: Generate neutron Config + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "{{ neutron_system_user_name }}" + group: "{{ neutron_system_group_name }}" + with_items: + - { src: "neutron.conf.j2", dest: "/etc/neutron/neutron.conf" } + - { src: "plugins/ml2/ml2_conf.ini.j2", dest: "/etc/neutron/plugins/ml2/ml2_conf.ini" } + notify: + - Restart neutron services + tags: + - neutron-config + +- name: Generate neutron agent only Config template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -38,10 +52,10 @@ - { src: "l3_agent.ini.j2", dest: "/etc/neutron/l3_agent.ini" } - { src: "metadata_agent.ini.j2", dest: "/etc/neutron/metadata_agent.ini" } - { src: "metering_agent.ini.j2", dest: "/etc/neutron/metering_agent.ini" } - - { src: "neutron.conf.j2", dest: "/etc/neutron/neutron.conf" } - - { src: "plugins/ml2/ml2_conf.ini.j2", dest: "/etc/neutron/plugins/ml2/ml2_conf.ini" } notify: - Restart neutron services + when: > + inventory_hostname in groups['neutron_agents_container'] tags: - neutron-config diff --git a/playbooks/roles/os_neutron/templates/neutron.conf.j2 b/playbooks/roles/os_neutron/templates/neutron.conf.j2 index c055dd5108..23d976385e 100644 --- a/playbooks/roles/os_neutron/templates/neutron.conf.j2 +++ b/playbooks/roles/os_neutron/templates/neutron.conf.j2 @@ -116,10 +116,12 @@ memcache_secret_key = {{ memcached_encryption_key }} # if your keystone deployment uses PKI, and you value security over performance: check_revocations_for_cached = False +{% if inventory_hostname in groups['neutron_server'] %} [database] connection = mysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ galera_address }}/{{ neutron_galera_database }}?charset=utf8 +{% endif %} [oslo_messaging_rabbit] rabbit_port = {{ rabbitmq_port }}