---

- name: Create deployed_server_prepare script
  template:
    src: "{{ deployed_server_prepare_script }}"
    dest: "{{ working_dir }}/deployed_server_prepare.sh"
    mode: 0755

- name: Run the deployed-server_prepare script
  shell: >
    set -o pipefail &&
    {{ working_dir }}/deployed_server_prepare.sh 2>&1 {{ timestamper_cmd }} >
    {{ deployed_server_prepare_log }}
  async: 10800
  poll: 0
  environment:
    OPT_WORKDIR: "{{ lookup('env', 'OPT_WORKDIR') }}"
    http_proxy: "{{ lookup('env', 'http_proxy') }}"
    no_proxy: "{{ lookup('env', 'no_proxy') }}"
    TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
    SUBNODES_SSH_KEY: "/etc/nodepool/id_rsa"
