--- # file: roles/tg_sut/tasks/ubuntu.yaml - name: Install python-dev apt: name: 'python-dev' state: 'present' update_cache: True tags: install-python-dev - name: Install python-virtualenv apt: name: 'python-virtualenv' state: 'present' update_cache: True tags: install-python-virtualenv - name: Install python pip apt: name: 'python-pip' state: 'present' update_cache: True tags: install-python-pip - name: Install libpcap-dev apt: name: 'libpcap-dev' state: 'present' update_cache: True tags: install-libpcap-dev - name: Install cpufrequtils apt: name: 'cpufrequtils' state: 'present' update_cache: True tags: install-cpufrequtils - name: Install cgroup-support apt: name: 'cgroup-bin' state: 'present' update_cache: True tags: install-cgroup-support - name: Install zlib1g-dev apt: name: 'zlib1g-dev' state: 'present' update_cache: True tags: install-zlib1g-dev - name: Install libnuma-dev apt: name: 'libnuma-dev' state: 'present' update_cache: True tags: install-libnuma-dev - name: Install Docker and role dependencies apt: name: "{{ item }}" state: "present" install_recommends: False with_items: - "apt-transport-https" - "ca-certificates" - "software-properties-common" - "cron" tags: install-docker - name: Install Docker APT GPG key apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: "present" tags: install-docker - name: Install Docker APT repository apt_repository: repo: "{{ docker_repository }}" state: "present" update_cache: True tags: install-docker - name: Install Docker apt: name: "docker-{{ docker_edition }}={{ docker_apt_package_name }}" state: "present" update_cache: True install_recommends: False cache_valid_time: "{{ apt_cache_time }}" tags: install-docker - name: Remove Upstart docker config file file: path: "/etc/default/docker" state: "absent" tags: docker - name: Ensure systemd directory exists file: path: "/etc/systemd/system" state: "directory" owner: "root" group: "root" mode: "0755" tags: ensure-docker - name: Copy systemd docker unit file template: src: "templates/docker.service.j2" dest: "/etc/systemd/system/docker.service" owner: "root" group: "root" mode: "0644" register: docker_register_systemd_service tags: copy-docker - name: Reload systemd daemon command: "systemctl daemon-reload" notify: ["Restart Docker"] when: (docker_register_systemd_service and docker_register_systemd_service is changed) tags: restart-docker - name: Set specific users to "docker" group user: name: "{{ item }}" groups: "docker" append: True with_items: "{{ docker_users }}" when: docker_users tags: set-docker - name: Install kubernetes APT GPG key apt_key: url: https://packages.cloud.google.com/apt/doc/apt-key.gpg state: "present" tags: install-kubernetes - name: Install kubernetes APT repository apt_repository: repo: "{{ kubernetes_repository }}" state: "present" update_cache: True tags: install-kubernetes - name: Install kubeadm apt: name: "kubeadm={{ kubernetes_apt_package_name }}" state: "present" force: yes update_cache: True install_recommends: False cache_valid_time: "{{ apt_cache_time }}" tags: install-kubernetes - name: Install kubectl apt: name: "kubectl={{ kubernetes_apt_package_name }}" state: "present" force: yes update_cache: True install_recommends: False cache_valid_time: "{{ apt_cache_time }}" tags: install-kubernetes - name: Install kubelet apt: name: "kubelet={{ kubernetes_apt_package_name }}" state: "present" force: yes update_cache: True install_recommends: False cache_valid_time: "{{ apt_cache_time }}" tags: install-kubernetes - name: Apply kubelet parameter lineinfile: path: '/etc/default/kubelet' state: 'present' regexp: '^KUBELET_EXTRA_ARGS=*' line: 'KUBELET_EXTRA_ARGS=--feature-gates HugePages=false' tags: install-kubernetes