1 heat_template_version: pike
4 MongoDB service deployment using puppet and docker
10 DockerMongodbConfigImage:
11 description: The container image to use for the mongodb config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Dictionary packing service data
24 description: Mapping of service_name -> network name. Typically set
25 via parameter_defaults in the resource registry. This
26 mapping overrides those in ServiceNetMapDefaults.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
43 type: ../../../puppet/services/database/mongodb.yaml
45 EndpointMap: {get_param: EndpointMap}
46 ServiceData: {get_param: ServiceData}
47 ServiceNetMap: {get_param: ServiceNetMap}
48 DefaultPasswords: {get_param: DefaultPasswords}
49 RoleName: {get_param: RoleName}
50 RoleParameters: {get_param: RoleParameters}
54 description: Containerized service Mongodb using composable services.
56 service_name: {get_attr: [MongodbPuppetBase, role_data, service_name]}
59 - get_attr: [MongodbPuppetBase, role_data, config_settings]
60 - mongodb::server::fork: false
61 step_config: &step_config
64 - - "['Mongodb_database', 'Mongodb_user', 'Mongodb_replset'].each |String $val| { noop_resource($val) }"
65 - {get_attr: [MongodbPuppetBase, role_data, step_config]}
66 # BEGIN DOCKER SETTINGS #
68 config_volume: mongodb
69 puppet_tags: file # set this even though file is the default
70 step_config: *step_config
71 config_image: &mongodb_config_image {get_param: DockerMongodbConfigImage}
73 /var/lib/kolla/config_files/mongodb.json:
74 command: /usr/bin/mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongod.conf run
76 - source: "/var/lib/kolla/config_files/src/*"
79 preserve_properties: true
81 - path: /var/lib/mongodb
82 owner: mongodb:mongodb
84 - path: /var/log/mongodb
85 owner: mongodb:mongodb
90 image: {get_param: DockerMongodbImage}
93 volumes: &mongodb_volumes
94 - /var/lib/kolla/config_files/mongodb.json:/var/lib/kolla/config_files/config.json
95 - /var/lib/config-data/puppet-generated/mongodb/:/var/lib/kolla/config_files/src:ro
96 - /etc/localtime:/etc/localtime:ro
97 - /var/log/containers/mongodb:/var/log/mongodb
98 - /var/lib/mongodb:/var/lib/mongodb
100 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
102 # MySQL database initialization occurs only on single node
104 config_volume: 'mongodb_init_tasks'
105 puppet_tags: 'mongodb_database,mongodb_user,mongodb_replset'
106 step_config: 'include ::tripleo::profile::base::database::mongodb'
107 config_image: *mongodb_config_image
109 - /var/lib/mongodb:/var/lib/mongodb
110 - /var/log/containers/mongodb:/var/log/mongodb
112 - name: create persistent directories
117 - /var/log/containers/mongodb
120 - name: Stop and disable mongodb service
122 service: name=mongod state=stopped enabled=no