aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Dake <stdake@cisco.com>2015-07-15 13:15:10 -0700
committerSteven Dake <stdake@cisco.com>2015-07-15 13:24:35 -0700
commit9c5e708fe247234459d153b77893b172e45760de (patch)
tree14f7c689c1a8dd3e56a1de0c7c0d3da2287196e4
parent613cdfe9461a6b4d17aac90578ab527c725291d6 (diff)
downloadkolla-9c5e708fe247234459d153b77893b172e45760de.tar.gz
kolla-9c5e708fe247234459d153b77893b172e45760de.zip
Add pid_mode to libvirt
Libvirt requires pid_mode to Host to operate on Fedora Hosts. Further we will need this for libvirt upgrade. I am not entirely sure why libvirt running with pid=host gets things working, but it definately has something to do with CentOS's libvirt's integration with systemd. Nailing down the problem, the interface to the Docker module accepts only None or "host". There is no way to generate a None type except with !!null in yml, but this does not work in the jinja2 parser. As a result, one solution is this conditional. A better long term solution would be for the Docker module to take some other argument to indicate None that can be expressed in a string. Change-Id: I54eb87e8ce8679bbf12f671527280c73e195b2e4 Closes-Bug: #1473270
-rw-r--r--ansible/roles/nova/tasks/start.yml1
-rw-r--r--ansible/roles/start.yml25
2 files changed, 26 insertions, 0 deletions
diff --git a/ansible/roles/nova/tasks/start.yml b/ansible/roles/nova/tasks/start.yml
index 18b2f0e8c..1d1c92356 100644
--- a/ansible/roles/nova/tasks/start.yml
+++ b/ansible/roles/nova/tasks/start.yml
@@ -6,6 +6,7 @@
container_image: "{{ docker_nova_libvirt_image_full }}"
container_name: "nova_libvirt"
container_privileged: "True"
+ container_pid: "True"
container_volumes:
- "/run:/run"
- "/lib/modules:/lib/modules:ro"
diff --git a/ansible/roles/start.yml b/ansible/roles/start.yml
index 4e202da3e..26262bd3d 100644
--- a/ansible/roles/start.yml
+++ b/ansible/roles/start.yml
@@ -30,3 +30,28 @@
volumes: "{{ container_volumes }}"
volumes_from: "{{ container_volumes_from | default([]) }}"
run_once: "{{ run_once | default('False') }}"
+ when: not container_pid|default(False)
+
+- name: Starting container(s)
+ docker:
+ command: "{{ container_command | default(None) }}"
+ detach: "{{ container_detach | default('True') }}"
+ env: "{{ container_environment | default({}) }}"
+ docker_api_version: "{{ docker_api_version }}"
+ image: "{{ container_image }}"
+ insecure_registry: "{{ docker_insecure_registry }}"
+ name: "{{ container_name }}"
+ net: "host"
+ pid: "host"
+ password: "{{ docker_registry_password }}"
+ privileged: "{{ container_privileged | default('False') }}"
+ pull: "{{ docker_pull_policy }}"
+ registry: "{{ docker_registry }}"
+ restart_policy: "{{ container_restart_policy | default(docker_restart_policy) }}"
+ restart_policy_retry: "{{ docker_restart_policy_retry }}"
+ state: "reloaded"
+ username: "{{ docker_registry_username }}"
+ volumes: "{{ container_volumes }}"
+ volumes_from: "{{ container_volumes_from | default([]) }}"
+ run_once: "{{ run_once | default('False') }}"
+ when: container_pid|default(False)