summaryrefslogtreecommitdiffstats
path: root/common/deploy-steps.j2
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2017-08-30 15:43:16 +0200
committerEmilien Macchi <emilien@redhat.com>2017-09-02 15:54:49 +0000
commitfe975e8626b27817842eea0e4babbb7d72a919bf (patch)
treefbc00dd961e94901a0f8562164f2752093514297 /common/deploy-steps.j2
parent79bd4a5c576829470ee0605551cee89233732021 (diff)
Use list_concat in place of yaql
Where applicable, use list_concat instead of yaql to build new lists: it should be more resilient to errors, easier to debug, and less expensive. Change-Id: I6d3dbc7ee8eac50f46023a35af4ec7f2d378fd87 Related-Bug: #1714005 (cherry picked from commit 8008089de24437757d3ba10299bb1041b4aa627a)
Diffstat (limited to 'common/deploy-steps.j2')
-rw-r--r--common/deploy-steps.j292
1 files changed, 45 insertions, 47 deletions
diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2
index 32d1afcf..3af48464 100644
--- a/common/deploy-steps.j2
+++ b/common/deploy-steps.j2
@@ -182,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
+ # 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
{%- endraw %}
{{role.name}}HostPrepDeployment: