Matrix Docker Ansible eploy
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.
 
 

41 lines
1.0 KiB

  1. ---
  2. - name: Ensure Docker repository is enabled (CentOS)
  3. template:
  4. src: "{{ role_path }}/files/yum.repos.d/{{ item }}"
  5. dest: "/etc/yum.repos.d/{{ item }}"
  6. owner: "root"
  7. group: "root"
  8. mode: 0644
  9. with_items:
  10. - docker-ce.repo
  11. when: ansible_distribution == 'CentOS'
  12. - name: Ensure Docker's RPM key is trusted
  13. rpm_key:
  14. state: present
  15. key: https://download.docker.com/linux/centos/gpg
  16. when: ansible_distribution == 'CentOS'
  17. - name: Ensure yum packages are installed (base)
  18. yum: name="{{ item }}" state=latest update_cache=yes
  19. with_items:
  20. - bash-completion
  21. - docker-ce
  22. - docker-python
  23. - firewalld
  24. - ntp
  25. when: ansible_distribution == 'CentOS'
  26. - name: Ensure firewalld is started and autoruns
  27. service: name=firewalld state=started enabled=yes
  28. - name: Ensure Docker is started and autoruns
  29. service: name=docker state=started enabled=yes
  30. - name: Ensure ntpd is started and autoruns
  31. service: name=ntpd state=started enabled=yes
  32. - name: Ensure SELinux disabled
  33. selinux: state=disabled