
{% set common = salt['grains.filter_by']({
    'Debian': {
        'pkgs': ['swift']
    },
    'RedHat': {
        'pkgs': ['openstack-swift']
    },
}, merge=salt['pillar.get']('swift:common')) %}

{% set proxy = salt['grains.filter_by']({
    'Debian': {
        'pkgs': ['swift', 'python-swiftclient', 'swift-proxy', 'python-keystone'],
        'services': ['swift-proxy'],
        'workers': 5,
        'bind': {
            'address': '0.0.0.0',
            'port': '8080'
        }
    },
    'RedHat': {
        'pkgs': ['openstack-swift', 'python-swiftclient', 'openstack-swift-proxy', 'python-keystone'],
        'services': ['openstack-swift-proxy'],
        'workers': 5,
        'bind': {
            'address': '0.0.0.0',
            'port': '8080'
        }
    },
}, merge=salt['pillar.get']('swift:proxy')) %}

{% set object = salt['grains.filter_by']({
    'Debian': {
        'pkgs': ['swift', 'swift-object'],
        'services': ['swift-object', 'swift-object-auditor', 'swift-object-updater'],
    },
    'RedHat': {
        'pkgs': ['openstack-swift', 'openstack-swift-object'],
        'services': ['openstack-swift-object', 'openstack-swift-object-auditor', 'openstack-swift-object-replicator', 'openstack-swift-object-updater', 'xfsprogs'] ,
    },
}, merge=salt['pillar.get']('swift:object')) %}


{% set container = salt['grains.filter_by']({
    'Debian': {
        'pkgs': ['swift', 'swift-container'],
        'services': ['swift-container-auditor', 'swift-container-updater', 'swift-container-replicator'],
    },
    'RedHat': {
        'pkgs': ['openstack-swift', 'openstack-swift-container'],
        'services': ['openstack-swift-container', 'openstack-swift-container-auditor', 'openstack-swift-container-replicator', 'openstack-swift-container-updater']
    },
}, merge=salt['pillar.get']('swift:container')) %}

{% set account = salt['grains.filter_by']({
    'Debian': {
        'pkgs': ['swift', 'swift-account'],
        'services': ['swift-account', 'swift-account-auditor', 'swift-account-reaper', 'swift-account-replicator'],
    },
    'RedHat': {
        'pkgs': ['openstack-swift', 'openstack-swift-account'],
        'services': ['openstack-swift-account', 'openstack-swift-account-auditor', 'openstack-swift-account-reaper', 'openstack-swift-account-replicator'],
    },
}, merge=salt['pillar.get']('swift:account')) %}

{#
    'Debian': {
      $swift3 = 'swift-plugin-s3'
    }
    'RedHat': {
      $swift3 = 'openstack-swift-plugin-swift3'
    }
#}
