summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 19:58:19 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 19:58:19 +0000
commit88f123915209bb9dfad01019ee9444ce45ba8f43 (patch)
tree0636074aa6324930cce6578fe3b21400d83c65af
parentd10741e526f7868a2330014f35678d327b4984a2 (diff)
parentc4a247d5806aca2990cc9ac8578f264f9b185474 (diff)
Merge "Add Ec2Api to container based deployment"
-rw-r--r--docker/services/ec2-api.yaml153
-rw-r--r--environments/services-docker/ec2-api.yaml2
2 files changed, 155 insertions, 0 deletions
diff --git a/docker/services/ec2-api.yaml b/docker/services/ec2-api.yaml
new file mode 100644
index 0000000..bc3654b
--- /dev/null
+++ b/docker/services/ec2-api.yaml
@@ -0,0 +1,153 @@
1heat_template_version: pike
2
3description: >
4 OpenStack containerized EC2 API service
5
6parameters:
7 DockerNamespace:
8 description: namespace
9 default: 'tripleoupstream'
10 type: string
11 DockerEc2ApiImage:
12 description: image
13 default: 'centos-binary-ec2-api:latest'
14 type: string
15 EndpointMap:
16 default: {}
17 description: Mapping of service endpoint -> protocol. Typically set
18 via parameter_defaults in the resource registry.
19 type: json
20 ServiceNetMap:
21 default: {}
22 description: Mapping of service_name -> network name. Typically set
23 via parameter_defaults in the resource registry. This
24 mapping overrides those in ServiceNetMapDefaults.
25 type: json
26 DefaultPasswords:
27 default: {}
28 type: json
29 RoleName:
30 default: ''
31 description: Role name on which the service is applied
32 type: string
33 RoleParameters:
34 default: {}
35 description: Parameters specific to the role
36 type: json
37
38resources:
39
40 ContainersCommon:
41 type: ./containers-common.yaml
42
43 Ec2ApiPuppetBase:
44 type: ../../puppet/services/ec2-api.yaml
45 properties:
46 EndpointMap: {get_param: EndpointMap}
47 ServiceNetMap: {get_param: ServiceNetMap}
48 DefaultPasswords: {get_param: DefaultPasswords}
49 RoleName: {get_param: RoleName}
50 RoleParameters: {get_param: RoleParameters}
51
52outputs:
53 role_data:
54 description: Role data for the EC2 API role.
55 value:
56 service_name: {get_attr: [Ec2ApiPuppetBase, role_data, service_name]}
57 config_settings: {get_attr: [Ec2ApiPuppetBase, role_data, config_settings]}
58 step_config: &step_config
59 get_attr: [Ec2ApiPuppetBase, role_data, step_config]
60 service_config_settings: {get_attr: [Ec2ApiPuppetBase, role_data, service_config_settings]}
61 # BEGIN DOCKER SETTINGS
62 puppet_config:
63 config_volume: ec2api
64 puppet_tags: ec2api_api_paste_ini,ec2api_config
65 step_config: *step_config
66 config_image: &ec2_api_image
67 list_join:
68 - '/'
69 - [ {get_param: DockerNamespace}, {get_param: DockerEc2ApiImage} ]
70 kolla_config:
71 /var/lib/kolla/config_files/ec2_api.json:
72 command: /usr/bin/ec2-api
73 permissions:
74 - path: /var/log/ec2api
75 owner: ec2api:ec2api
76 recurse: true
77 /var/lib/kolla/config_files/ec2_api_metadata.json:
78 command: /usr/bin/ec2-api-metadata
79 permissions:
80 - path: /var/log/ec2api # default log dir for metadata service as well
81 owner: ec2api:ec2api
82 recurse: true
83 docker_config:
84 # db sync runs before permissions set by kolla_config
85 step_2:
86 ec2_api_init_logs:
87 image: *ec2_api_image
88 privileged: false
89 user: root
90 volumes:
91 - /var/log/containers/ec2_api:/var/log/ec2api
92 # mount ec2_api_metadata to "ec2api-metadata" only here to fix
93 # permissions of both directories in one go
94 - /var/log/containers/ec2_api_metadata:/var/log/ec2api-metadata
95 command: ['/bin/bash', '-c', 'chown -R ec2api:ec2api /var/log/ec2api /var/log/ec2api-metadata']
96 step_3:
97 ec2_api_db_sync:
98 image: *ec2_api_image
99 net: host
100 detach: false
101 privileged: false
102 user: root
103 volumes:
104 list_concat:
105 - {get_attr: [ContainersCommon, volumes]}
106 -
107 - /var/lib/config-data/ec2_api/etc/ec2api/:/etc/ec2api/:ro
108 - /var/log/containers/ec2_api:/var/log/ec2api
109 command: "/usr/bin/bootstrap_host_exec ec2_api su ec2api -s /bin/bash -c '/usr/bin/ec2-api-manage db_sync'"
110 step_4:
111 ec2_api:
112 image: *ec2_api_image
113 net: host
114 privileged: false
115 restart: always
116 volumes:
117 list_concat:
118 - {get_attr: [ContainersCommon, volumes]}
119 -
120 - /var/lib/kolla/config_files/ec2_api.json:/var/lib/kolla/config_files/config.json:ro
121 - /var/lib/config-data/ec2_api/etc/ec2api/:/etc/ec2api/:ro
122 - /var/log/containers/ec2_api:/var/log/ec2api
123 environment:
124 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
125 ec2_api_metadata:
126 image: *ec2_api_image
127 net: host
128 privileged: false
129 restart: always
130 volumes:
131 list_concat:
132 - {get_attr: [ContainersCommon, volumes]}
133 -
134 - /var/lib/kolla/config_files/ec2_api_metadata.json:/var/lib/kolla/config_files/config.json:ro
135 - /var/lib/config-data/ec2_api/etc/ec2api/:/etc/ec2api/:ro
136 - /var/log/containers/ec2_api_metadata:/var/log/ec2api
137 environment:
138 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
139 host_prep_tasks:
140 - name: create persistent log directories
141 file:
142 path: /var/log/containers/{{ item }}
143 state: directory
144 with_items:
145 - ec2_api
146 - ec2_api_metadata
147 upgrade_tasks:
148 - name: Stop and disable EC2-API services
149 tags: step2
150 service: name={{ item }} state=stopped enabled=no
151 with_items:
152 - openstack-ec2-api
153 - openstack-ec2-api-metadata
diff --git a/environments/services-docker/ec2-api.yaml b/environments/services-docker/ec2-api.yaml
new file mode 100644
index 0000000..24cbb03
--- /dev/null
+++ b/environments/services-docker/ec2-api.yaml
@@ -0,0 +1,2 @@
1resource_registry:
2 OS::TripleO::Services::Ec2Api: ../../docker/services/ec2-api.yaml