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