To create a directory using Ansible, you need to set two parameters:
Path - absolute path, where you want to create the directory
state - by default, this is set to file, change it to directory since you need to create a directory.
Something like this:
- hosts: all
  tasks:
  - name: directory-name
    file:
      path: absolute-path
      state: directory