---
- block:
    - name: create the docker-storage config file
      template:
        src: "{{ role_path }}/templates/docker-storage-setup-overlayfs.j2"
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644
  when:
    - ansible_distribution_version | version_compare('7.4', '>=')
    - ansible_distribution == "RedHat"

- block:
    - name: create the docker-storage-setup config file
      template:
        src: "{{ role_path }}/templates/docker-storage-setup-dm.j2"
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644
  when:
    - ansible_distribution_version | version_compare('7.4', '<')
    - ansible_distribution == "RedHat"

- block:
    - name: create the docker-storage-setup config file for CentOS
      template:
        src: "{{ role_path }}/templates/docker-storage-setup-dm.j2"
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644

  # TODO(shadower): Find out which CentOS version supports overlayfs2
  when:
    - ansible_distribution == "CentOS"

---
- block:
    - name: create the docker-storage config file
      template:
        src: docker-storage-setup-overlayfs.j2
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644
  when:
    - ansible_distribution_version | version_compare('7.4', '>=')
    - ansible_distribution == "RedHat"

- block:
    - name: create the docker-storage-setup config file
      template:
        src: docker-storage-setup-dm.j2
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644
  when:
    - ansible_distribution_version | version_compare('7.4', '<')
    - ansible_distribution == "RedHat"

- block:
    - name: create the docker-storage-setup config file for CentOS
      template:
        src: docker-storage-setup-dm.j2
        dest: /etc/sysconfig/docker-storage-setup
        owner: root
        group: root
        mode: 0644

  # TODO(shadower): Find out which CentOS version supports overlayfs2
  when:
    - ansible_distribution == "CentOS"

Simplify the template paths for the storage setup
Simplify the template paths for the storage setup

Because the templates are present in a role, the `template` module is
able to look them up directly, without having to use `{{ role_path
}}/templates`.
