--- - hosts: all become: yes tasks: - name: install additional packages apt: name: - vim - htop - curl state: present update_cache: yes - name: get hostname command: hostname register: realHostName - name: fix host rename lineinfile: dest: '/etc/hosts' regexp: '^127.0.1.1' line: "127.0.1.1 {{ realHostName.stdout }}" state: present - name: add folder for generating host.key failure file: path: '/var/lib/rancher/etc/ssl' owner: root group: root state: directory - name: fix resolv.conf copy: dest: /etc/resolv.conf content: 'nameserver 10.0.2.3' - name: install dependencies for docker apt: update_cache: yes name: - apt-transport-https - ca-certificates - gnupg2 state: latest - name: add apt key shell: curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add - - name: create source list for docker copy: dest: /etc/apt/sources.list.d/docker.list content: "deb https://apt.dockerproject.org/repo debian-jessie main" mode: 0644 - name: install docker apt: update_cache: yes name: - docker-engine state: latest - name: make local docker repo inscure so it still works without https copy: dest: /etc/docker/daemon.json content: !unsafe '{ "insecure-registries":["192.168.123.1:5000"] }'