main.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: add kubernetes repo
  16. copy: src=kubernetes.repo dest=/etc/yum.repos.d/ owner=root group=root mode=644
  17. tags: install
  18. # add ElRepo GPG Key
  19. - name: add ElRepo GPG Key
  20. rpm_key:
  21. state: present
  22. key: https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  23. tags: install
  24. - name: add ElRepo (Nvidia kmod drivers)
  25. yum:
  26. name: http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
  27. state: present
  28. tags: install
  29. - name: Add Docker Community Edition Repo
  30. get_url:
  31. url: https://download.docker.com/linux/centos/docker-ce.repo
  32. dest: /etc/yum.repos.d/docker-ce.repo
  33. - name: update sysctl to handle incorrectly routed traffic when iptables is bypassed
  34. copy: src=k8s.conf dest=/etc/sysctl.d/ owner=root group=root mode=644
  35. tags: install
  36. - name: update sysctl
  37. command: /sbin/sysctl --system
  38. tags: install
  39. - name: Install EPEL Repository
  40. yum: name=epel-release state=present
  41. tags: install
  42. - name: disable swap
  43. command: /sbin/swapoff -a
  44. tags: install
  45. - name: Disable SELinux
  46. selinux:
  47. state: disabled
  48. tags: install
  49. - name: install common packages
  50. package:
  51. name:
  52. - yum-plugin-versionlock
  53. - gcc
  54. - nfs-utils
  55. - python-pip
  56. - docker-ce
  57. - bash-completion
  58. - kubelet-1.16.7
  59. - kubeadm-1.16.7
  60. - kubectl-1.16.7
  61. - nvidia-detect
  62. state: present
  63. tags: install
  64. - name: versionlock kubernetes
  65. command: yum versionlock kubelet-1.16.7 kubectl-1.16.7 kubeadm-1.16.7
  66. tags: install
  67. - name: install InfiniBand Support
  68. package:
  69. name: "@Infiniband Support"
  70. state: present
  71. - name: upgrade pip
  72. command: /bin/pip install --upgrade pip
  73. tags: install
  74. - name: Start and Enable docker service
  75. service:
  76. name: docker
  77. state: restarted
  78. enabled: yes
  79. tags: install
  80. - name: Start and Enable Kubernetes - kubelet
  81. service:
  82. name: kubelet
  83. state: restarted
  84. enabled: yes
  85. tags: install