Merge "Make neutron dhcp agents per network conditional"
[apex-tripleo-heat-templates.git] / docker / services / neutron-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Neutron API service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNeutronApiImage:
12     description: image
13     default: 'centos-binary-neutron-server:latest'
14     type: string
15   # we configure all neutron services in the same neutron
16   DockerNeutronConfigImage:
17     description: image
18     default: 'centos-binary-neutron-openvswitch-agent:latest'
19     type: string
20   EndpointMap:
21     default: {}
22     description: Mapping of service endpoint -> protocol. Typically set
23                  via parameter_defaults in the resource registry.
24     type: json
25   ServiceNetMap:
26     default: {}
27     description: Mapping of service_name -> network name. Typically set
28                  via parameter_defaults in the resource registry.  This
29                  mapping overrides those in ServiceNetMapDefaults.
30     type: json
31   DefaultPasswords:
32     default: {}
33     type: json
34
35 resources:
36
37   NeutronBase:
38     type: ../../puppet/services/neutron-api.yaml
39     properties:
40       EndpointMap: {get_param: EndpointMap}
41       ServiceNetMap: {get_param: ServiceNetMap}
42       DefaultPasswords: {get_param: DefaultPasswords}
43
44 outputs:
45   role_data:
46     description: Role data for the Neutron API role.
47     value:
48       service_name: {get_attr: [NeutronBase, role_data, service_name]}
49       config_settings:
50         map_merge:
51           - get_attr: [NeutronBase, role_data, config_settings]
52       step_config: &step_config
53         get_attr: [NeutronBase, role_data, step_config]
54       service_config_settings: {get_attr: [NeutronBase, role_data, service_config_settings]}
55       # BEGIN DOCKER SETTINGS
56       docker_image: &neutron_api_image
57         list_join:
58           - '/'
59           - [ {get_param: DockerNamespace}, {get_param: DockerNeutronApiImage} ]
60       puppet_config:
61         config_volume: neutron
62         puppet_tags: neutron_config,neutron_api_config
63         step_config: *step_config
64         config_image:
65           list_join:
66             - '/'
67             - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
68       kolla_config:
69          /var/lib/kolla/config_files/neutron_api.json:
70            command: /usr/bin/neutron-server --config-file /usr/share/neutron/neutron-dist.conf --config-dir /usr/share/neutron/server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini
71            config_files:
72            - dest: /etc/neutron/neutron.conf
73              owner: neutron
74              perm: '0640'
75              source: /var/lib/kolla/config_files/src/etc/neutron/neutron.conf
76            - dest: /etc/neutron/plugin.ini
77              owner: neutron
78              perm: '0640'
79              source: /var/lib/kolla/config_files/src/etc/neutron/plugins/ml2/ml2_conf.ini
80       docker_config:
81         step_3:
82           neutron_db_sync:
83             image: *neutron_api_image
84             net: host
85             privileged: false
86             detach: false
87             # FIXME: we should make config file permissions right
88             # and run as neutron user
89             user: root
90             volumes:
91               - /var/lib/config-data/neutron/etc/neutron:/etc/neutron:ro
92               - /var/lib/config-data/neutron/usr/share/neutron:/usr/share/neutron:ro
93               - /etc/hosts:/etc/hosts:ro
94               - /etc/localtime:/etc/localtime:ro
95             command: ['neutron-db-manage', 'upgrade', 'heads']
96         step_4:
97           neutron_api:
98             image: *neutron_api_image
99             net: host
100             privileged: false
101             restart: always
102             volumes:
103               - /var/lib/kolla/config_files/neutron_api.json:/var/lib/kolla/config_files/config.json:ro
104               - /var/lib/config-data/neutron/:/var/lib/kolla/config_files/src:ro
105               - /etc/hosts:/etc/hosts:ro
106               - /etc/localtime:/etc/localtime:ro
107             environment:
108               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS