---
- name: Create Docker network
  docker_network:
    name: ci-net
    state: present

- name: Run Jenkins service
  become: yes
  become_user: jenkins
  include: docker.yml
  vars:
    directory: "{{ repo_dir }}/docker/{{ item }}"
  with_items:
    - jenkins
    - nginx

---
- name: Create Docker network
  docker_network:
    name: ci-net
    state: present

- name: Run Jenkins service
  become: yes
  become_user: jenkins
  include_tasks: docker.yml
  vars:
    directory: "{{ repo_dir }}/docker/{{ item }}"
  with_items:
    - jenkins
    - nginx

Use 'include_tasks' instead of 'include'
Use 'include_tasks' instead of 'include'
