Add role specific information to the service template
[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   # 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   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     default: {}
35     description: Parameters specific to the role
36   EndpointMap:
37     default: {}
38     description: Mapping of service endpoint -> protocol. Typically set
39                  via parameter_defaults in the resource registry.
40     type: json
41
42 resources:
43
44   ContainersCommon:
45     type: ./containers-common.yaml
46
47   NeutronL3Base:
48     type: ../../puppet/services/neutron-l3.yaml
49     properties:
50       EndpointMap: {get_param: EndpointMap}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       RoleName: {get_param: RoleName}
54       RoleParameters: {get_param: RoleParameters}
55
56 outputs:
57   role_data:
58     description: Role data for Neutron L3 agent
59     value:
60       service_name: {get_attr: [NeutronL3Base, role_data, service_name]}
61       config_settings: {get_attr: [NeutronL3Base, role_data, config_settings]}
62       step_config: &step_config
63         get_attr: [NeutronL3Base, role_data, step_config]
64       puppet_config:
65         puppet_tags: neutron_config,neutron_l3_agent_config
66         config_volume: neutron
67         step_config: *step_config
68         config_image:
69           list_join:
70             - '/'
71             - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
72       kolla_config:
73         /var/lib/kolla/config_files/neutron-l3-agent.json:
74           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
75           permissions:
76             - path: /var/log/neutron
77               owner: neutron:neutron
78               recurse: true
79       docker_config:
80         step_4:
81           neutronl3agent:
82             image:
83               list_join:
84                 - '/'
85                 - [ {get_param: DockerNamespace}, {get_param: DockerNeutronL3AgentImage} ]
86             net: host
87             pid: host
88             privileged: true
89             restart: always
90             volumes:
91               list_concat:
92                 - {get_attr: [ContainersCommon, volumes]}
93                 -
94                   - /var/lib/kolla/config_files/neutron-l3-agent.json:/var/lib/kolla/config_files/config.json:ro
95                   - /var/lib/config-data/neutron/etc/neutron/:/etc/neutron/:ro
96                   - /lib/modules:/lib/modules:ro
97                   - /run:/run
98                   - /var/log/containers/neutron:/var/log/neutron
99             environment:
100               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
101       host_prep_tasks:
102         - name: create persistent logs directory
103           file:
104             path: /var/log/containers/neutron
105             state: directory