Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
1.8 KiB

  1. ---
  2. - name: Fail if required rageshake settings not defined
  3. ansible.builtin.fail:
  4. msg: >
  5. You need to define a required configuration setting (`{{ item }}`).
  6. when: "vars[item] == ''"
  7. with_items:
  8. - matrix_rageshake_hostname
  9. - matrix_rageshake_path_prefix
  10. - matrix_rageshake_container_network
  11. - name: (Deprecation) Catch and report renamed rageshake variables
  12. ansible.builtin.fail:
  13. msg: >-
  14. The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead.
  15. when: "item.old in vars"
  16. with_items:
  17. - {'old': 'matrix_rageshake_docker_image_name_prefix', 'new': 'matrix_rageshake_docker_image_registry_prefix'}
  18. - when: matrix_rageshake_container_labels_traefik_enabled | bool
  19. block:
  20. - name: Fail if required rageshake Traefik settings not defined
  21. ansible.builtin.fail:
  22. msg: >-
  23. You need to define a required configuration setting (`{{ item }}`).
  24. when: "vars[item] == ''"
  25. with_items:
  26. - matrix_rageshake_container_labels_traefik_hostname
  27. - matrix_rageshake_container_labels_traefik_path_prefix
  28. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  29. # Knowing that `matrix_rageshake_container_labels_traefik_path_prefix` does not end with a slash
  30. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  31. - name: Fail if matrix_rageshake_container_labels_traefik_path_prefix ends with a slash
  32. ansible.builtin.fail:
  33. msg: >-
  34. matrix_rageshake_container_labels_traefik_path_prefix (`{{ matrix_rageshake_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/rageshake`).
  35. when: "matrix_rageshake_container_labels_traefik_path_prefix != '/' and matrix_rageshake_container_labels_traefik_path_prefix[-1] == '/'"