---

- name: validate url or base
  fail:
    msg: "One of URL or BASE are required."
  when: not url and not base

- name: validate request method
  fail:
    msg: "Invalid method."
  when: method not in [ "DELETE", "GET", "POST", "PUT" ]

- name: validate user and password
  fail:
    msg: "Username and password are required."
  when: not user or not password

- name: validate file and directory options
  fail:
    msg: "File and directory are mutually exclusive for all request types."
  when: file and directory

---

- name: validate url or base
  fail:
    msg: "One of URL or BASE are required."
  when: not url and not base

- name: validate request method
  fail:
    msg: "Method must be DELETE, GET, POST or PUT."
  when: method not in [ "DELETE", "GET", "POST", "PUT" ]

- name: validate user and password
  fail:
    msg: "Username and password are required."
  when: not user or not password

- name: validate file and directory options
  fail:
    msg: "File and directory are mutually exclusive for all request types."
  when: file and directory

Check request method is supported type
Check request method is supported type
