You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

9 years ago
  1. ---
  2. - name: gather os specific variables
  3. include_vars: "{{ item }}"
  4. with_first_found:
  5. - files:
  6. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
  7. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
  8. - "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
  9. - "{{ ansible_distribution|lower }}.yml"
  10. - "{{ ansible_os_family|lower }}.yml"
  11. - defaults.yml
  12. paths:
  13. - ../vars
  14. - name: check for minimum kernel version
  15. fail:
  16. msg: >
  17. docker requires a minimum kernel version of
  18. {{ docker_kernel_min_version }} on
  19. {{ ansible_distribution }}-{{ ansible_distribution_version }}
  20. when: ansible_kernel|version_compare(docker_kernel_min_version, "<")
  21. - name: ensure docker requirements packages are installed
  22. action: "{{ docker_package_info.pkg_mgr }}"
  23. args: docker_package_info.args
  24. with_items: docker_package_info.pre_pkgs
  25. when: docker_package_info.pre_pkgs|length > 0
  26. - name: ensure docker repository public key is installed
  27. action: "{{ docker_repo_key_info.pkg_key }}"
  28. args: docker_repo_key_info.args
  29. with_items: docker_repo_key_info.repo_keys
  30. when: docker_repo_key_info.repo_keys|length > 0
  31. - name: ensure docker repository is enabled
  32. action: "{{ docker_repo_info.pkg_repo }}"
  33. args: docker_repo_info.args
  34. with_items: docker_repo_info.repos
  35. when: docker_repo_info.repos|length > 0
  36. - name: ensure docker packages are installed
  37. action: "{{ docker_package_info.pkg_mgr }}"
  38. args: docker_package_info.args
  39. with_items: docker_package_info.pkgs
  40. when: docker_package_info.pkgs|length > 0
  41. - name: ensure docker service is started and enabled
  42. service:
  43. name: "{{ item }}"
  44. enabled: yes
  45. state: started
  46. with_items:
  47. - docker