--- # This playbook contains plays that will run on all nodes #- name: Upgrade APT to the lastest packages # apt: upgrade=dist - name: Update apt apt: update_cache=yes - name: Install standard programs apt: name={{ item }} state=present force=yes with_items: - apt-transport-https - htop - curl - openssh-server - git - rsync - zip - unzip - fail2ban - ntp - mysql-client - wget - nfs-common - sshpass - ack-grep - dnsutils - nmon - build-essential - tmux - sudo - name: Add docker key apt_key: url: https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg state: present - name: Add docker repo apt_repository: repo: deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable state: present - name: Update apt apt: update_cache=yes - name: Install docker-ce shell: > apt-get install -y -qq docker-ce=$(apt-cache madison docker-ce | grep "{{ docker_ce_version_to_install }}" | awk {'print $3'}) - name: Add standard_user to docker group user: name: "{{ standard_user }}" groups: docker append: yes - name: Set timezone to NewYork timezone: name: "{{ chosen_timezone }}" ignore_errors: true - name: Replace sudoers file template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers - name: Create /etc/docker file: path: /etc/docker group: root owner: root mode: 700 state: directory - name: Replace docker daemon file template: src=../roles/common/templates/docker-daemon.json.j2 dest=/etc/docker/daemon.json register: dockerdaemon - name: Restart docker if daemon changes service: name: docker state: restarted when: dockerdaemon.changed - name: Creates directory file: path=/data state=directory