aboutsummaryrefslogblamecommitdiffhomepage
path: root/tests/test-service-deps.yml
blob: 4e848e5d138636561d1f8241f5af6a168290b99d (plain) (tree)



































                                                                                                                    
---
- name: Deploy an app & configure service dependencies on clever
  hosts: localhost
  remote_user: root
  pre_tasks:
    - file:
        state: absent
        path: ../clever-commands
  roles:
    - role: clever
      vars:
        clever_token: 123abc
        clever_secret: cba321
        clever_app: app_00000000-0000-0000-0000-000000000000
        clever_service_dependencies:
          - app_id: app_00000000-2222-2222-2222-000000000000
          - addon_id: addon_00000000-0000-0000-0000-000000000000
  post_tasks:
    - name: Check stubbed commands
      shell: "{{ item.cmd }}"
      ignore_errors: true
      vars:
        display: "{{ item.display }}"
      with_list:
        - cmd: "grep service ../clever-commands"
          display: "Expected 'clever service' command to be called"
      register: tests_results
    - name: show results
      debug:
        msg:
          - "failed_results: {{ failed_results }}"
          - "success_results: {{ success_results }}"
      failed_when: tests_results is failed
      vars:
        failed_results: "{{ tests_results.results | selectattr('failed') | map(attribute='item.display') | list }}"
        success_results: "{{ tests_results.results | rejectattr('failed') | map(attribute='item.display') | list }}"