---

- name: 'Waiting jenkins started'
  command: "curl --head --silent {{ jenkins_base_url }}/"
  register: 'jenkins_check_available'
  until: "{{ (jenkins_check_available.stdout.find('200 OK') != -1) or
             (jenkins_check_available.stdout.find('403 Forbidden') != -1) }}"
  retries: "{{ jenkins_waiting_available_retries }}"
  delay: "{{ jenkins_waiting_available_delay }}"
  changed_when: False

---

- name: 'Waiting jenkins started'
  uri:
    url: "{{ jenkins_base_url }}/"
    status_code: '200,403'
  register: 'jenkins_check_available'
  until: "{{
    (jenkins_check_available.status == 200)
    or (jenkins_check_available.status == 403) }}"
  retries: "{{ jenkins_waiting_available_retries }}"
  delay: "{{ jenkins_waiting_available_delay }}"
  changed_when: False

Replace curl command by uri module for Jenkins waiting task
Replace curl command by uri module for Jenkins waiting task
