aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorliyingjun <yingjun.li@kylin-cloud.com>2016-10-11 10:05:07 +0800
committerliyingjun <yingjun.li@kylin-cloud.com>2016-10-11 17:43:19 +0800
commitcd0336658fa188dac7e9de625c677db57ff619c2 (patch)
tree82943f91b03adc31a3bdde3059344c79b5e2bf85 /ansible
parentb13b0aad0506d443677b138db33b442b33dc1fc7 (diff)
downloadkolla-cd0336658fa188dac7e9de625c677db57ff619c2.tar.gz
kolla-cd0336658fa188dac7e9de625c677db57ff619c2.zip
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
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/barbican/tasks/config.yml10
-rw-r--r--ansible/roles/barbican/templates/barbican-api.ini.j211
-rw-r--r--ansible/roles/barbican/templates/barbican-api.json.j26
3 files changed, 26 insertions, 1 deletions
diff --git a/ansible/roles/barbican/tasks/config.yml b/ansible/roles/barbican/tasks/config.yml
index 9bbceb42b..638563473 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 000000000..3e1fc65bb
--- /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 2b022690d..843f46e65 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"
}
]
}