---
  # "Install the FWD spawner."
  
  - name: "Create the spawner directory." 
    file:
       path: "{{ fwd_install_root }}/spawner"
       state: directory
       mode: 0755
       
  - name: "Check if the spawner is installed."
    find:
       paths: "{{ fwd_install_root }}/spawner/"
    register: spawn_files
    changed_when: false

  - name: "Install the spawner using this application's srv-certs.store."
    command: ./gradlew native -Dpost.build=yes -Dspawn.install.folder=/opt/spawner "-Dsrv.certs={{ fwd_install_root }}/{{ fwd_app_name }}/deploy/server/srv-certs.store"
    args:
       chdir: "{{ fwd_install_root }}/p2j/"
    when: spawn_files.matched|int == 0