- hosts: datacenter name: Install docker1 become: true become_user: root gather_facts: false tasks: - name: Install docker ansible.builtin.apt: name: docker.io state: present - name: Install telnet ansible.builtin.apt: name: telnet state: present - name: Install net-tools ansible.builtin.apt: name: net-tools state: present - name: Install curl! ansible.builtin.apt: name: curl state: present - name: Install deps... ansible.builtin.apt: name: - python3-pip - python3-dev - name: Create a directory docker.service.d ansible.builtin.file: path: /etc/systemd/system/docker.service.d/ state: directory mode: '0755' - name: Creating a file with content copy: dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375