Use a single configuration file for specifying docker containers.
[apex-tripleo-heat-templates.git] / docker / services / neutron-dhcp.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Neutron DHCP service
5
6 parameters:
7   DockerNeutronDHCPImage:
8     description: image
9     type: string
10   DockerNeutronConfigImage:
11     description: The container image to use for the neutron config_volume
12     type: string
13   EndpointMap:
14     default: {}
15     description: Mapping of service endpoint -> protocol. Typically set
16                  via parameter_defaults in the resource registry.
17     type: json
18   ServiceNetMap:
19     default: {}
20     description: Mapping of service_name -> network name. Typically set
21                  via parameter_defaults in the resource registry.  This
22                  mapping overrides those in ServiceNetMapDefaults.
23     type: json
24   DefaultPasswords:
25     default: {}
26     type: json
27   RoleName:
28     default: ''
29     description: Role name on which the service is applied
30     type: string
31   RoleParameters:
32     default: {}
33     description: Parameters specific to the role
34     type: json
35
36 resources:
37
38   ContainersCommon:
39     type: ./containers-common.yaml
40
41   NeutronBase:
42     type: ../../puppet/services/neutron-dhcp.yaml
43     properties:
44       EndpointMap: {get_param: EndpointMap}
45       ServiceNetMap: {get_param: ServiceNetMap}
46       DefaultPasswords: {get_param: DefaultPasswords}
47       RoleName: {get_param: RoleName}
48       RoleParameters: {get_param: RoleParameters}
49
50 outputs:
51   role_data:
52     description: Role data for the Neutron DHCP role.
53     value:
54       service_name: {get_attr: [NeutronBase, role_data, service_name]}
55       config_settings:
56         map_merge:
57           - get_attr: [NeutronBase, role_data, config_settings]
58       step_config: &step_config
59         get_attr: [NeutronBase, role_data, step_config]
60       service_config_settings: {get_attr: [NeutronBase, role_data, service_config_settings]}
61       # BEGIN DOCKER SETTINGS
62       puppet_config:
63         config_volume: neutron
64         puppet_tags: neutron_config,neutron_dhcp_agent_config
65         step_config: *step_config
66         config_image: {get_param: DockerNeutronConfigImage}
67       kolla_config:
68         /var/lib/kolla/config_files/neutron_dhcp.json:
69           command: /usr/bin/neutron-dhcp-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini --log-file /var/log/neutron/dhcp-agent.log --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-dhcp-agent
70           config_files:
71             - source: "/var/lib/kolla/config_files/src/*"
72               dest: "/"
73               merge: true
74               preserve_properties: true
75           permissions:
76             - path: /var/log/neutron
77               owner: neutron:neutron
78               recurse: true
79       docker_config:
80         step_4:
81           neutron_dhcp:
82             image: {get_param: DockerNeutronDHCPImage}
83             net: host
84             pid: host
85             privileged: true
86             restart: always
87             volumes:
88               list_concat:
89                 - {get_attr: [ContainersCommon, volumes]}
90                 -
91                   - /var/lib/kolla/config_files/neutron_dhcp.json:/var/lib/kolla/config_files/config.json:ro
92                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
93                   - /lib/modules:/lib/modules:ro
94                   - /run/:/run
95                   - /var/log/containers/neutron:/var/log/neutron
96             environment:
97               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
98       host_prep_tasks:
99         - name: create persistent logs directory
100           file:
101             path: /var/log/containers/neutron
102             state: directory
103       upgrade_tasks:
104         - name: Stop and disable neutron_dhcp service
105           tags: step2
106           service: name=neutron-dhcp-agent state=stopped enabled=no