def item_create(item, item_id, item_type, create='create', extra_args=None, cibfile=None):
    '''
    Create an item via pcs command
    (mainly for use with the pcs state module)

    item
        config, property, resource, constraint etc.
    item_id
        id of the item
    item_type
        item type
    create
        create command (create or set f.e., default: create)
    extra_args
        additional options for the pcs command
    cibfile
        use cibfile instead of the live CIB
    '''
    cmd = ['pcs']
    if isinstance(cibfile, six.string_types):
        cmd += ['-f', cibfile]

    if isinstance(item, six.string_types):
        cmd += [item]
    elif isinstance(item, (list, tuple)):
        cmd += item

    # constraint command follows a different order
    if item in ['constraint']:
        if isinstance(item_type, six.string_types):
            cmd += [item_type]

    if isinstance(create, six.string_types):
        cmd += [create]
    elif isinstance(create, (list, tuple)):
        cmd += create

    # constraint command needs item_id in format 'id=<id' after all params
    # constraint command follows a different order
    if item not in ['constraint']:
        cmd += [item_id]
        if isinstance(item_type, six.string_types):
            cmd += [item_type]

    if isinstance(extra_args, (list, tuple)):
        # constraint command needs item_id in format 'id=<id' after all params
        if item in ['constraint']:
            extra_args = extra_args + ['id={0}'.format(item_id)]
        cmd += extra_args

    return __salt__['cmd.run_all'](cmd, output_loglevel='trace', python_shell=False)
Create an item via pcs command
    (mainly for use with the pcs state module)

    item
        config, property, resource, constraint etc.
    item_id
        id of the item
    item_type
        item type
    create
        create command (create or set f.e., default: create)
    extra_args
        additional options for the pcs command
    cibfile
        use cibfile instead of the live CIB