--- - name: install docker as systemd plus add a protainer web hosts: all become: true tasks: - name: remove other files include_tasks: yaml_sub/install_docker.yaml - name: Create a volume community.docker.docker_volume: name: portainer_data state: present - name: Create portainer container community.docker.docker_container: name: portainerweb image: portainer/portainer-ce state: started recreate: no restart_policy: always published_ports: - "80:8000/tcp" - "443:9443/tcp" volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data