From cd0336658fa188dac7e9de625c677db57ff619c2 Mon Sep 17 00:00:00 2001 From: liyingjun Date: Tue, 11 Oct 2016 10:05:07 +0800 Subject: [PATCH] Fix 'Address already in use' for barbican-api By default barbican uwsgi is configured to listen all address on host [1], we need to change this to the ip address of the host. [1]: https://github.com/openstack/barbican/blob/master/etc/barbican/vassals/barbican-api.ini Change-Id: I4a1f9fb44ad55caf21f82c1b6d272a9743d65fd8 Closes-bug: #1632177 --- ansible/roles/barbican/tasks/config.yml | 10 +++++++++- ansible/roles/barbican/templates/barbican-api.ini.j2 | 11 +++++++++++ ansible/roles/barbican/templates/barbican-api.json.j2 | 6 ++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/barbican/templates/barbican-api.ini.j2 diff --git a/ansible/roles/barbican/tasks/config.yml b/ansible/roles/barbican/tasks/config.yml index 9bbceb42b1..6385634730 100644 --- a/ansible/roles/barbican/tasks/config.yml +++ b/ansible/roles/barbican/tasks/config.yml @@ -5,7 +5,7 @@ state: "directory" recurse: yes with_items: - - "barbican-api" + - "barbican-api/vassals" - "barbican-keystone-listener" - "barbican-worker" @@ -18,6 +18,14 @@ - "barbican-worker" - "barbican-keystone-listener" +- name: Copying over barbican-api.ini + merge_configs: + sources: + - "{{ role_path }}/templates/barbican-api.ini.j2" + - "{{ node_custom_config }}/barbican-api/barbican-api.ini" + - "{{ node_custom_config }}/barbican-api/{{ inventory_hostname }}/barbican-api.ini" + dest: "{{ node_config_directory }}/barbican-api/vassals/barbican-api.ini" + - name: Copying over barbican.conf merge_configs: vars: diff --git a/ansible/roles/barbican/templates/barbican-api.ini.j2 b/ansible/roles/barbican/templates/barbican-api.ini.j2 new file mode 100644 index 0000000000..3e1fc65bb6 --- /dev/null +++ b/ansible/roles/barbican/templates/barbican-api.ini.j2 @@ -0,0 +1,11 @@ +[uwsgi] +socket = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ barbican_api_port }} +protocol = http +processes = {{ openstack_service_workers }} +lazy = true +vacuum = true +no-default-app = true +memory-report = true +plugins = python +paste = config:/etc/barbican/barbican-api-paste.ini +add-header = Connection: close diff --git a/ansible/roles/barbican/templates/barbican-api.json.j2 b/ansible/roles/barbican/templates/barbican-api.json.j2 index 2b022690df..843f46e65f 100644 --- a/ansible/roles/barbican/templates/barbican-api.json.j2 +++ b/ansible/roles/barbican/templates/barbican-api.json.j2 @@ -6,6 +6,12 @@ "dest": "/etc/barbican/barbican.conf", "owner": "barbican", "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/vassals/barbican-api.ini", + "dest": "/etc/barbican/vassals/barbican-api.ini", + "owner": "barbican", + "perm": "0600" } ] }