summaryrefslogtreecommitdiffstats
path: root/docker/services/database/mongodb.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'docker/services/database/mongodb.yaml')
-rw-r--r--docker/services/database/mongodb.yaml21
1 files changed, 16 insertions, 5 deletions
diff --git a/docker/services/database/mongodb.yaml b/docker/services/database/mongodb.yaml
index 68a64a7d..265558a4 100644
--- a/docker/services/database/mongodb.yaml
+++ b/docker/services/database/mongodb.yaml
@@ -73,7 +73,16 @@ outputs:
perm: '0600'
docker_config:
step_2:
+ mongodb_data_ownership:
+ start_order: 0
+ image: *mongodb_image
+ net: host
+ user: root
+ command: ['chown', '-R', 'mongodb:', '/var/lib/mongodb']
+ volumes:
+ - /var/lib/mongodb:/var/lib/mongodb
mongodb:
+ start_order: 1
image: *mongodb_image
net: host
privileged: false
@@ -82,7 +91,7 @@ outputs:
- /var/lib/config-data/mongodb/:/var/lib/kolla/config_files/src:ro
- /etc/localtime:/etc/localtime:ro
- logs:/var/log/kolla
- - mongodb:/var/lib/mongodb/
+ - /var/lib/mongodb:/var/lib/mongodb
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
@@ -91,13 +100,15 @@ outputs:
config_volume: 'mongodb_init_tasks'
puppet_tags: 'mongodb_database,mongodb_user,mongodb_replset'
step_config: 'include ::tripleo::profile::base::database::mongodb'
- config_image:
- list_join:
- - '/'
- - [ {get_param: DockerNamespace}, {get_param: DockerMongodbImage} ]
+ config_image: *mongodb_image
volumes:
- "mongodb:/var/lib/mongodb/"
- "logs:/var/log/kolla:ro"
+ host_prep_tasks:
+ - name: create /var/lib/mongodb
+ file:
+ path: /var/lib/mongodb
+ state: directory
upgrade_tasks:
- name: Stop and disable mongodb service
tags: step2