def datadir_init(name,
        auth='password',
        user=None,
        password=None,
        encoding='UTF8',
        locale=None,
        runas=None):
    if salt.utils.which('initdb') is None:
        log.error('initdb not found in path')
        return False

    if datadir_exists(name):
        log.info('%s already exists', name)
        return False

    ret = _run_initdb(
        name,
        auth=auth,
        user=user,
        password=password,
        encoding=encoding,
        locale=locale,
        runas=runas)
    return ret['retcode'] == 0
.. versionadded:: 2016.3.0
dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/datadir_init