Merge "Adds network/cidr mapping into a new service property"
[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   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNeutronDHCPImage:
12     description: image
13     default: 'centos-binary-neutron-dhcp-agent:latest'
14     type: string
15   DockerNeutronConfigImage:
16     description: The container image to use for the neutron config_volume
17     default: 'centos-binary-neutron-server:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceData:
25     default: {}
26     description: Dictionary packing service data
27     type: json
28   ServiceNetMap:
29     default: {}
30     description: Mapping of service_name -> network name. Typically set
31                  via parameter_defaults in the resource registry.  This
32                  mapping overrides those in ServiceNetMapDefaults.
33     type: json
34   DefaultPasswords:
35     default: {}
36     type: json
37   RoleName:
38     default: ''
39     description: Role name on which the service is applied
40     type: string
41   RoleParameters:
42     default: {}
43     description: Parameters specific to the role
44     type: json
45
46 resources:
47
48   ContainersCommon:
49     type: ./containers-common.yaml
50
51   NeutronBase:
52     type: ../../puppet/services/neutron-dhcp.yaml
53     properties:
54       EndpointMap: {get_param: EndpointMap}
55       ServiceData: {get_param: ServiceData}
56       ServiceNetMap: {get_param: ServiceNetMap}
57       DefaultPasswords: {get_param: DefaultPasswords}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61 outputs:
62   role_data:
63     description: Role data for the Neutron DHCP role.
64     value:
65       service_name: {get_attr: [NeutronBase, role_data, service_name]}
66       config_settings:
67         map_merge:
68           - get_attr: [NeutronBase, role_data, config_settings]
69       step_config: &step_config
70         get_attr: [NeutronBase, role_data, step_config]
71       service_config_settings: {get_attr: [NeutronBase, role_data, service_config_settings]}
72       # BEGIN DOCKER SETTINGS
73       puppet_config:
74         config_volume: neutron
75         puppet_tags: neutron_config,neutron_dhcp_agent_config
76         step_config: *step_config
77         config_image:
78           list_join:
79             - '/'
80             - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
81       kolla_config:
82         /var/lib/kolla/config_files/neutron_dhcp.json:
83           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
84           config_files:
85             - source: "/var/lib/kolla/config_files/src/*"
86               dest: "/"
87               merge: true
88               preserve_properties: true
89           permissions:
90             - path: /var/log/neutron
91               owner: neutron:neutron
92               recurse: true
93       docker_config:
94         step_4:
95           neutron_dhcp:
96             image:
97               list_join:
98                 - '/'
99                 - [ {get_param: DockerNamespace}, {get_param: DockerNeutronDHCPImage} ]
100             net: host
101             pid: host
102             privileged: true
103             restart: always
104             volumes:
105               list_concat:
106                 - {get_attr: [ContainersCommon, volumes]}
107                 -
108                   - /var/lib/kolla/config_files/neutron_dhcp.json:/var/lib/kolla/config_files/config.json:ro
109                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
110                   - /lib/modules:/lib/modules:ro
111                   - /run/:/run
112                   - /var/log/containers/neutron:/var/log/neutron
113             environment:
114               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
115       host_prep_tasks:
116         - name: create persistent logs directory
117           file:
118             path: /var/log/containers/neutron
119             state: directory
120       upgrade_tasks:
121         - name: Stop and disable neutron_dhcp service
122           tags: step2
123           service: name=neutron-dhcp-agent state=stopped enabled=no