Merge "Change HorizonSecureCookies default to False"
[apex-tripleo-heat-templates.git] / docker / services / neutron-dhcp.yaml
index fc13b3d..d14f525 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 description: >
   OpenStack containerized Neutron DHCP service
@@ -8,14 +8,14 @@ parameters:
     description: namespace
     default: 'tripleoupstream'
     type: string
-  DockerNeutronApiImage:
+  DockerNeutronDHCPImage:
     description: image
     default: 'centos-binary-neutron-dhcp-agent:latest'
     type: string
   # we configure all neutron services in the same neutron
   DockerNeutronConfigImage:
     description: image
-    default: 'centos-binary-neutron-openvswitch-agent:latest'
+    default: 'centos-binary-neutron-server:latest'
     type: string
   EndpointMap:
     default: {}
@@ -31,15 +31,28 @@ parameters:
   DefaultPasswords:
     default: {}
     type: json
+  RoleName:
+    default: ''
+    description: Role name on which the service is applied
+    type: string
+  RoleParameters:
+    default: {}
+    description: Parameters specific to the role
+    type: json
 
 resources:
 
+  ContainersCommon:
+    type: ./containers-common.yaml
+
   NeutronBase:
     type: ../../puppet/services/neutron-dhcp.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
+      RoleName: {get_param: RoleName}
+      RoleParameters: {get_param: RoleParameters}
 
 outputs:
   role_data:
@@ -49,45 +62,53 @@ outputs:
       config_settings:
         map_merge:
           - get_attr: [NeutronBase, role_data, config_settings]
-      step_config: {get_attr: [NeutronBase, role_data, step_config]}
+      step_config: &step_config
+        get_attr: [NeutronBase, role_data, step_config]
       service_config_settings: {get_attr: [NeutronBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
-      docker_image: &neutron_dhcp_image
-        list_join:
-          - '/'
-          - [ {get_param: DockerNamespace}, {get_param: DockerNeutronApiImage} ]
-      puppet_tags: neutron_config,neutron_dhcp_agent_config
-      config_volume: neutron
-      config_image:
-        list_join:
-          - '/'
-          - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
+      puppet_config:
+        config_volume: neutron
+        puppet_tags: neutron_config,neutron_dhcp_agent_config
+        step_config: *step_config
+        config_image:
+          list_join:
+            - '/'
+            - [ {get_param: DockerNamespace}, {get_param: DockerNeutronConfigImage} ]
       kolla_config:
-         /var/lib/kolla/config_files/neutron_dhcp.json:
-           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_files:
-           - dest: /etc/neutron/neutron.conf
-             owner: neutron
-             perm: '0640'
-             source: /var/lib/kolla/config_files/src/etc/neutron/neutron.conf
-           - dest: /etc/neutron/dhcp_agent.ini
-             owner: neutron
-             perm: '0640'
-             source: /var/lib/kolla/config_files/src/etc/neutron/dhcp_agent.ini
+        /var/lib/kolla/config_files/neutron_dhcp.json:
+          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
+          permissions:
+            - path: /var/log/neutron
+              owner: neutron:neutron
+              recurse: true
       docker_config:
         step_4:
           neutron_dhcp:
-            image: *neutron_dhcp_image
+            image:
+              list_join:
+                - '/'
+                - [ {get_param: DockerNamespace}, {get_param: DockerNeutronDHCPImage} ]
             net: host
             pid: host
             privileged: true
             restart: always
             volumes:
-              - /var/lib/kolla/config_files/neutron_dhcp.json:/var/lib/kolla/config_files/config.json:ro
-              - /var/lib/config-data/neutron/:/var/lib/kolla/config_files/src:ro
-              - /etc/localtime:/etc/localtime:ro
-              - /etc/hosts:/etc/hosts:ro
-              - /lib/modules:/lib/modules:ro
-              - /run/:/run
+              list_concat:
+                - {get_attr: [ContainersCommon, volumes]}
+                -
+                  - /var/lib/kolla/config_files/neutron_dhcp.json:/var/lib/kolla/config_files/config.json:ro
+                  - /var/lib/config-data/neutron/etc/neutron/:/etc/neutron/:ro
+                  - /lib/modules:/lib/modules:ro
+                  - /run/:/run
+                  - /var/log/containers/neutron:/var/log/neutron
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
+      host_prep_tasks:
+        - name: create persistent logs directory
+          file:
+            path: /var/log/containers/neutron
+            state: directory
+      upgrade_tasks:
+        - name: Stop and disable neutron_dhcp service
+          tags: step2
+          service: name=neutron-dhcp-agent state=stopped enabled=no