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