---
- name: include os-specific variables
  include_vars: "{{ ansible_os_family }}.yml"

- name: create minio group
  group:
    name: "{{ minio_group }}"
    state: present

- name: create minio user
  user:
    name: "{{ minio_user }}"
    group: "{{ minio_group }}"
    shell: /bin/bash

- name: create minio config dir
  file: path=/home/ubuntu/.minio state=directory owner=minio group=users mode=g+rw

- name: generate the minio config
  template:
    src: minio_config.json.j2
    dest: /home/ubuntu/.minio/config.json

- stat: path={{ minio_server_datadir }}/minio.log
  register: p

- name: create minio.log
  file: path={{ minio_server_datadir }}/minio.log state=touch owner=minio group=sys
  when: p.stat.exists is defined and not p.stat.exists

- include: server.yml
  when: not skip_server

- include: client.yml
  when: not skip_client

- name: Install S3 client
  apt: name=s3cmd

- name: Configure s3cmd config file
  template: src=s3cfg.j2
            dest="/home/ubuntu/.s3cfg"
  tags: ["s3cmd_config"]

---
- name: include os-specific variables
  include_vars: "{{ ansible_os_family }}.yml"

- name: create minio group
  group:
    name: "{{ minio_group }}"
    state: present

- name: create minio user
  user:
    name: "{{ minio_user }}"
    group: "{{ minio_group }}"
    shell: /bin/bash

- name: create minio config dir
  file: path=/home/ubuntu/.minio state=directory owner=minio group=users mode=g+rw

- name: create minio server data dir
  file: path={{ minio_server_datadir }} state=directory owner=minio group=users mode=g+rw

- name: generate the minio config
  template:
    src: minio_config.json.j2
    dest: /home/ubuntu/.minio/config.json

- stat: path={{ minio_server_datadir }}/minio.log
  register: p

- name: create minio.log
  file: path={{ minio_server_datadir }}/minio.log state=touch owner=minio group=users
  when: p.stat.exists is defined and not p.stat.exists

- include: server.yml
  when: not skip_server

- include: client.yml
  when: not skip_client

- name: Install S3 client
  apt: name=s3cmd

- name: Configure s3cmd config file
  template: src=s3cfg.j2
            dest="/home/ubuntu/.s3cfg"
  tags: ["s3cmd_config"]

Make sure the data dir for minio server exists. Correct the group to which the folder should belong.
Make sure the data dir for minio server exists. Correct the group to which the folder should belong.
