--- - hosts: docker_hosts become: true tasks: - name: Install required system packages apt: name: "{{item}}" state: present update_cache: yes loop: - apt-transport-https - ca-certificates - curl - gnupg-agent - software-properties-common - name: Add Docker GPG apt Key apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: Add Docker Repository apt_repository: repo: deb https://download.docker.com/linux/ubuntu focal stable state: present - name: installa docker apt: name: "{{item}}" state: latest update_cache: yes loop: - docker-ce - docker-ce-cli - containerd.io - docker-compose-plugin - name: Creates directory file: path: /etc/systemd/system/docker.service.d state: directory # - name: copy config files - name: copying files copy: src: nebula-v2/remote-api.conf dest: /etc/systemd/system/docker.service.d/remote-api.conf - name: Allow TCP 4243 ansible.builtin.iptables: action: insert chain: INPUT protocol: tcp match: tcp destination_port: 4243 jump: ACCEPT - name: assicurati che docker sia attivo service: name: docker state: started enabled: yes