iscsi.yml 646 B

12345678910111213141516171819202122232425262728293031
  1. ---
  2. - name: Install iSCSI storage plugin dependencies
  3. package:
  4. name: "{{ pkg_list | join(',') }}"
  5. state: present
  6. register: result
  7. until: result is succeeded
  8. vars:
  9. pkg_list:
  10. - iscsi-initiator-utils
  11. - device-mapper-multipath
  12. - name: restart services
  13. systemd:
  14. name: "{{ item }}"
  15. state: started
  16. enabled: True
  17. with_items:
  18. - multipathd
  19. - rpcbind
  20. - iscsid
  21. - name: Template multipath configuration
  22. template:
  23. dest: "/etc/multipath.conf"
  24. src: multipath.conf.j2
  25. backup: true
  26. #enable multipath
  27. - name: Enable and start multipath
  28. command: "mpathconf --enable --with_multipathd y"