--- - name: Create docker volume become: true community.docker.docker_volume: name: "{{ docker_volume }}" - name: Run redis container become: true community.docker.docker_container: name: "{{ container_name }}" image: "{{ image }}" command: "{{ shared_cmd }}" networks: "{{ docker_networks }}" volumes: - "{{ docker_volume }}:/data" restart_policy: unless-stopped