diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py index 341fdd0b7f..acb96c263b 100644 --- a/ansible/library/kolla_docker.py +++ b/ansible/library/kolla_docker.py @@ -755,6 +755,9 @@ def generate_module(): # if pid_mode = ""/None/False, remove it if not new_args.get('pid_mode', False): new_args.pop('pid_mode', None) + # if ipc_mode = ""/None/False, remove it + if not new_args.get('ipc_mode', False): + new_args.pop('ipc_mode', None) module.params = new_args return module diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 3542c36f06..638412f235 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -25,6 +25,8 @@ cinder_services: group: cinder-volume enabled: true image: "{{ cinder_volume_image_full }}" + privileged: True + ipc_mode: "host" volumes: - "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" @@ -38,6 +40,7 @@ cinder_services: group: cinder-backup enabled: true image: "{{ cinder_backup_image_full }}" + privileged: True volumes: - "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" diff --git a/ansible/roles/cinder/handlers/main.yml b/ansible/roles/cinder/handlers/main.yml index dbf5d97b9c..8e6a9ebe62 100644 --- a/ansible/roles/cinder/handlers/main.yml +++ b/ansible/roles/cinder/handlers/main.yml @@ -12,7 +12,7 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes | reject('equalto', '') | list }}" when: - action != "config" - inventory_hostname in groups[service.group] @@ -20,7 +20,7 @@ - config_json.changed | bool or cinder_conf.changed | bool or policy_json.changed | bool - or cinder_api_container.changed | + or cinder_api_container.changed | bool - name: Restart cinder-scheduler container vars: @@ -35,7 +35,7 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes | reject('equalto', '') | list }}" when: - action != "config" - inventory_hostname in groups[service.group] @@ -58,7 +58,9 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + privileged: "{{ service.privileged | default(False) }}" + ipc_mode: "{{ service.ipc_mode | default('') }}" + volumes: "{{ service.volumes | reject('equalto', '') | list }}" when: - action != "config" - inventory_hostname in groups[service.group] @@ -81,7 +83,8 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + privileged: "{{ service.privileged | default(False) }}" + volumes: "{{ service.volumes | reject('equalto', '') | list }}" when: - action != "config" - inventory_hostname in groups[service.group] diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index b64164ba84..022967736e 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -85,7 +85,9 @@ common_options: "{{ docker_common_options }}" name: "{{ item.value.container_name }}" image: "{{ item.value.image }}" - volumes: "{{ item.value.volumes }}" + volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" + privileged: "{{ item.value.privileged | default(False) }}" + ipc_mode: "{{ item.value.ipc_mode | default('') }}" register: check_cinder_containers when: - action != "config"