docker_installation.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 docker repo
  16. get_url:
  17. url: "{{ docker_repo_url }}"
  18. dest: "{{ docker_repo_dest }}"
  19. tags: install
  20. - name: Enable docker edge and test repo
  21. ini_file:
  22. dest: "{{ docker_repo_dest }}"
  23. section: "{{ item }}"
  24. option: enabled
  25. value: "{{ success }}"
  26. with_items: ['docker-ce-test', 'docker-ce-edge']
  27. tags: install
  28. - name: Install docker
  29. package:
  30. name: "{{ container_repo_install }}"
  31. state: present
  32. become: yes
  33. tags: install
  34. - name: Start services
  35. service:
  36. name: "{{ container_type }}"
  37. state: started
  38. enabled: yes
  39. become: yes
  40. tags: install
  41. - name: Uninstall docker-py using pip
  42. pip:
  43. name: ['docker-py','docker']
  44. state: absent
  45. tags: install
  46. - name: Install docker using pip
  47. pip:
  48. name: docker
  49. state: present
  50. tags: install
  51. - name: Installation using python3
  52. pip:
  53. name: "{{ docker_compose }}"
  54. executable: pip3
  55. tags: install
  56. - name: Configure docker
  57. copy:
  58. src: daemon.json
  59. dest: "{{ daemon_dest }}"
  60. tags: install
  61. - name: Restart docker
  62. service:
  63. name: docker
  64. state: restarted