Merge "Add CephExternal role for ceph-ansible" into stable/pike
[apex-tripleo-heat-templates.git] / common / deploy-steps.j2
index 8d17c22..1119fb6 100644 (file)
@@ -44,6 +44,10 @@ parameters:
     type: string
     default: ''
     description: Set to True to enable debug logging with docker-puppet.py
+  DockerPuppetProcessCount:
+    type: number
+    default: 3
+    description: Number of concurrent processes to use when running docker-puppet to generate config files.
   ctlplane_service_ips:
     type: json
 
@@ -74,6 +78,7 @@ resources:
         - name: update_identifier
         - name: bootstrap_server_id
         - name: docker_puppet_debug
+        - name: docker_puppet_process_count
       config:
         str_replace:
           template: |
@@ -177,54 +182,52 @@ resources:
                   puppet_step_config: {get_param: [role_data, {{role.name}}, step_config]}
                 tasks:
                   # Join host_prep_tasks with the other per-host configuration
-                  yaql:
-                    expression: $.data.host_prep_tasks + $.data.template_tasks
-                    data:
-                      host_prep_tasks: {get_param: [role_data, {{role.name}}, host_prep_tasks]}
-                      template_tasks:
+                  list_concat:
+                    - {get_param: [role_data, {{role.name}}, host_prep_tasks]}
+                    -
 {%- raw %}
-                        # Write the manifest for baremetal puppet configuration
-                        - name: Create /var/lib/tripleo-config directory
-                          file: path=/var/lib/tripleo-config state=directory
-                        - name: Write the puppet step_config manifest
-                          copy: content="{{puppet_step_config}}" dest=/var/lib/tripleo-config/puppet_step_config.pp force=yes
-                        # this creates a JSON config file for our docker-puppet.py script
-                        - name: Create /var/lib/docker-puppet
-                          file: path=/var/lib/docker-puppet state=directory
-                        - name: Write docker-puppet-tasks json files
-                          copy: content="{{puppet_config | to_json}}" dest=/var/lib/docker-puppet/docker-puppet.json force=yes
-                        # FIXME: can we move docker-puppet somewhere so it's installed via a package?
-                        - name: Write docker-puppet.py
-                          copy: content="{{docker_puppet_script}}" dest=/var/lib/docker-puppet/docker-puppet.py force=yes
-                        # Here we are dumping all the docker container startup configuration data
-                        # so that we can have access to how they are started outside of heat
-                        # and docker-cmd.  This lets us create command line tools to test containers.
-                        # FIXME do we need the docker-container-startup-configs.json or is the new per-step
-                        # data consumed by paunch enough?
-                        - name: Write docker-container-startup-configs
-                          copy: content="{{docker_startup_configs | to_json}}" dest=/var/lib/docker-container-startup-configs.json force=yes
-                        - name: Write per-step docker-container-startup-configs
-                          copy: content="{{item.value|to_json}}" dest="/var/lib/tripleo-config/docker-container-startup-config-{{item.key}}.json" force=yes
-                          with_dict: "{{docker_startup_configs}}"
-                        - name: Create /var/lib/kolla/config_files directory
-                          file: path=/var/lib/kolla/config_files state=directory
-                        - name: Write kolla config json files
-                          copy: content="{{item.value|to_json}}" dest="{{item.key}}" force=yes
-                          with_dict: "{{kolla_config}}"
-                        ########################################################
-                        # Bootstrap tasks, only performed on bootstrap_server_id
-                        ########################################################
-                        - name: Clean /var/lib/docker-puppet/docker-puppet-tasks*.json files
-                          file:
-                            path: "{{item}}"
-                            state: absent
-                          with_fileglob:
-                            - /var/lib/docker-puppet/docker-puppet-tasks*.json
-                          when: deploy_server_id == bootstrap_server_id
-                        - name: Write docker-puppet-tasks json files
-                          copy: content="{{item.value|to_json}}" dest=/var/lib/docker-puppet/docker-puppet-tasks{{item.key.replace("step_", "")}}.json force=yes
-                          with_dict: "{{docker_puppet_tasks}}"
-                          when: deploy_server_id == bootstrap_server_id
+                      # Write the manifest for baremetal puppet configuration
+                      - name: Create /var/lib/tripleo-config directory
+                        file: path=/var/lib/tripleo-config state=directory
+                      - name: Write the puppet step_config manifest
+                        copy: content="{{puppet_step_config}}" dest=/var/lib/tripleo-config/puppet_step_config.pp force=yes mode=0600
+                      # this creates a JSON config file for our docker-puppet.py script
+                      - name: Create /var/lib/docker-puppet
+                        file: path=/var/lib/docker-puppet state=directory
+                      - name: Write docker-puppet-tasks json files
+                        copy: content="{{puppet_config | to_json}}" dest=/var/lib/docker-puppet/docker-puppet.json force=yes mode=0600
+                      # FIXME: can we move docker-puppet somewhere so it's installed via a package?
+                      - name: Write docker-puppet.py
+                        copy: content="{{docker_puppet_script}}" dest=/var/lib/docker-puppet/docker-puppet.py force=yes mode=0600
+                      # Here we are dumping all the docker container startup configuration data
+                      # so that we can have access to how they are started outside of heat
+                      # and docker-cmd.  This lets us create command line tools to test containers.
+                      # FIXME do we need the docker-container-startup-configs.json or is the new per-step
+                      # data consumed by paunch enough?
+                      - name: Write docker-container-startup-configs
+                        copy: content="{{docker_startup_configs | to_json}}" dest=/var/lib/docker-container-startup-configs.json force=yes mode=0600
+                      - name: Write per-step docker-container-startup-configs
+                        copy: content="{{item.value|to_json}}" dest="/var/lib/tripleo-config/docker-container-startup-config-{{item.key}}.json" force=yes mode=0600
+                        with_dict: "{{docker_startup_configs}}"
+                      - name: Create /var/lib/kolla/config_files directory
+                        file: path=/var/lib/kolla/config_files state=directory
+                      - name: Write kolla config json files
+                        copy: content="{{item.value|to_json}}" dest="{{item.key}}" force=yes mode=0600
+                        with_dict: "{{kolla_config}}"
+                      ########################################################
+                      # Bootstrap tasks, only performed on bootstrap_server_id
+                      ########################################################
+                      - name: Clean /var/lib/docker-puppet/docker-puppet-tasks*.json files
+                        file:
+                          path: "{{item}}"
+                          state: absent
+                        with_fileglob:
+                          - /var/lib/docker-puppet/docker-puppet-tasks*.json
+                        when: deploy_server_id == bootstrap_server_id
+                      - name: Write docker-puppet-tasks json files
+                        copy: content="{{item.value|to_json}}" dest=/var/lib/docker-puppet/docker-puppet-tasks{{item.key.replace("step_", "")}}.json force=yes mode=0600
+                        with_dict: "{{docker_puppet_tasks}}"
+                        when: deploy_server_id == bootstrap_server_id
 {%- endraw %}
 
   {{role.name}}HostPrepDeployment:
@@ -273,6 +276,7 @@ resources:
         update_identifier: {get_param: DeployIdentifier}
         bootstrap_server_id: {get_param: [servers, {{primary_role_name}}, '0']}
         docker_puppet_debug: {get_param: DockerPuppetDebug}
+        docker_puppet_process_count: {get_param: DockerPuppetProcessCount}
   {% endfor %}
   # END CONFIG STEPS
 
@@ -318,7 +322,7 @@ outputs:
               when: role_name == '{{role.name}}'
 {%- endfor %}
             - include: deploy_steps_tasks.yaml
-              with_sequence: count={{deploy_steps_max-1}}
+              with_sequence: start=0 end={{deploy_steps_max-1}}
               loop_control:
                 loop_var: step
       update_steps_tasks: |
@@ -331,11 +335,11 @@ outputs:
           serial: 1
           tasks:
             - include: update_steps_tasks.yaml
-              with_sequence: count={{update_steps_max-1}}
+              with_sequence: start=0 end={{update_steps_max-1}}
               loop_control:
                 loop_var: step
             - include: deploy_steps_tasks.yaml
-              with_sequence: count={{deploy_steps_max-1}}
+              with_sequence: start=0 end={{deploy_steps_max-1}}
               loop_control:
                 loop_var: step
       upgrade_steps_tasks: |
@@ -347,11 +351,11 @@ outputs:
         - hosts: overcloud
           tasks:
             - include: upgrade_steps_tasks.yaml
-              with_sequence: count={{upgrade_steps_max-1}}
+              with_sequence: start=0 end={{upgrade_steps_max-1}}
               loop_control:
                 loop_var: step
             - include: deploy_steps_tasks.yaml
-              with_sequence: count={{deploy_steps_max-1}}
+              with_sequence: start=0 end={{deploy_steps_max-1}}
               loop_control:
                 loop_var: step