docker_installation.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: latest
  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: Installation using python3
  42. pip:
  43. name: "{{ docker_compose }}"
  44. executable: pip3
  45. tags: install
  46. - name: Configure docker
  47. copy:
  48. src: daemon.json
  49. dest: "{{ daemon_dest }}"
  50. tags: install
  51. - name: Restart docker
  52. service:
  53. name: docker
  54. state: restarted