---
- name: Provision the server
  hosts: localhost
  tags: always
  become: false
  vars_files:
    - config.cfg

  tasks:
    - block:
      - name: Local pre-tasks
        import_tasks: playbooks/cloud-pre.yml

      - name: Include a provisioning role
        include_role:
          name: "{{ 'local' if algo_provider == 'local' else 'cloud-' + algo_provider }}"

      - name: Local post-tasks
        import_tasks: playbooks/cloud-post.yml
      rescue:
        - include_tasks: playbooks/rescue.yml
