docker_init.yml 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---
  2. - name: Install Library
  3. apt: "name={{ item }} state=latest update_cache=yes"
  4. with_items:
  5. - libltdl7
  6. - python
  7. - python3-pip
  8. tags: docker_init
  9. - name: Pip Install docker-py Module
  10. pip:
  11. name: docker-py
  12. tags: docker_init
  13. - name: Copy Install File
  14. copy: src=docker.deb dest=/tmp/docker.deb owner=root group=root mode=0744
  15. tags: docker_init
  16. - name: Install dokcer.deb package
  17. apt:
  18. deb: /tmp/docker.deb
  19. tags: docker_init
  20. - name: Restart Docker Service
  21. systemd:
  22. state: restarted
  23. daemon_reload: yes
  24. enabled: yes
  25. name: docker.service
  26. tags: docker_init
  27. - name: Log into registry.myregistry.com:5000
  28. docker_login:
  29. registry: registry.myregistry.com:5000
  30. username: username
  31. password: password
  32. reauthorize: yes
  33. tags: docker_init
  34. - name: Pull app Image
  35. docker_image:
  36. name: registry.myregistry.com:5000/app:1.0
  37. tags: docker_init
  38. - name: Retag image
  39. shell: docker tag registry.myregistry.com:5000/app:1.0 app:1.0
  40. tags: docker_init