diff --git a/README.rst b/README.rst
index cee7261..12b231f 100644
--- a/README.rst
+++ b/README.rst
@@ -9,6 +9,9 @@
 Sample pillars
 ==============
 
+Server
+------
+
 Single artifactory OSS edition from OS package
 
 .. code-block:: yaml
@@ -47,44 +50,44 @@
           user: artifactory
           password: pass
 
+Client
+------
 
-Development and testing
-=======================
+Basic client setup
 
-Development and test workflow with `Test Kitchen <http://kitchen.ci>`_ and
-`kitchen-salt <https://github.com/simonmcc/kitchen-salt>`_ provisioner plugin.
+.. code-block:: yaml
 
-Test Kitchen is a test harness tool to execute your configured code on one or more platforms in isolation.
-There is a ``.kitchen.yml`` in main directory that defines *platforms* to be tested and *suites* to execute on them.
+    artifactory:
+      client:
+        enabled: true
+        server:
+          host: 10.10.10.148
+          port: 8081
+          user: admin
+          password: password
 
-Kitchen CI can spin instances locally or remote, based on used *driver*.
-For local development ``.kitchen.yml`` defines a `vagrant <https://github.com/test-kitchen/kitchen-vagrant>`_ or
-`docker  <https://github.com/test-kitchen/kitchen-docker>`_ driver.
+Artifactory repository definition
 
-To use backend drivers or implement your CI follow the section `INTEGRATION.rst#Continuous Integration`__.
+.. code-block:: yaml
 
-The `Busser <https://github.com/test-kitchen/busser>`_ *Verifier* is used to setup and run tests
-implementated in `<repo>/test/integration`. It installs the particular driver to tested instance
-(`Serverspec <https://github.com/neillturner/kitchen-verifier-serverspec>`_,
-`InSpec <https://github.com/chef/kitchen-inspec>`_, Shell, Bats, ...) prior the verification is executed.
-
-Usage
------
-
-.. code-block:: shell
-
-  # list instances and status
-  kitchen list
-
-  # manually execute integration tests
-  kitchen [test || [create|converge|verify|exec|login|destroy|...]] [instance] -t tests/integration
-
-  # use with provided Makefile (ie: within CI pipeline)
-  make kitchen
-
+    artifactory:
+      client:
+        enabled: true
+      repo:
+        local_artifactory_repo:
+          name: local_artifactory_repo
+          package_type: docker
+          repo_type: local
+        remote_artifactory_repo:
+          name: remote_artifactory_repo
+          package_type: generic
+          repo_type: remote
+          url: "http://totheremoterepo:80/"
 
 Read more
 =========
 
 * https://www.jfrog.com/confluence/display/RTF/Debian+Repositories
-* https://www.jfrog.com/confluence/display/RTF/PostgreSQL
\ No newline at end of file
+* https://www.jfrog.com/confluence/display/RTF/PostgreSQL
+* https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-REPOSITORIES
+* https://www.jfrog.com/confluence/display/RTF/Repository+Configuration+JSON
\ No newline at end of file
diff --git a/_modules/artifactory_repo.py b/_modules/artifactory_repo.py
new file mode 100644
index 0000000..674d0fc
--- /dev/null
+++ b/_modules/artifactory_repo.py
@@ -0,0 +1,328 @@
+# -*- coding: utf-8 -*-
+'''
+Module for fetching artifacts from Artifactory
+'''
+
+# Import python libs
+from __future__ import absolute_import
+import os
+import base64
+import logging
+
+# Import Salt libs
+import salt.utils
+import salt.ext.six.moves.http_client  # pylint: disable=import-error,redefined-builtin,no-name-in-module
+from salt.ext.six.moves import urllib  # pylint: disable=no-name-in-module
+from salt.ext.six.moves.urllib.error import HTTPError, URLError  # pylint: disable=no-name-in-module
+
+import json
+import requests
+
+log = logging.getLogger(__name__)
+
+__virtualname__ = 'artifactory_repo'
+
+
+def __virtual__():
+
+    return True
+
+
+repo_config = {
+    "key": "local-repo1",
+    "rclass" : "local",
+    "packageType": "generic",
+    "description": "The local repository public description",
+}
+
+#    "repoLayoutRef" : "maven-2-default",
+
+class ArtifactoryClient:
+
+    def __init__(self, config={}):
+
+        self.files = []
+
+        client_config = {
+            'artifactory_url': 'http://your-instance/artifactory/api',
+            'search_prop': 'search/prop',
+            'search_name': 'search/artifact',
+            'search_repos': 'repositories',
+            'username': 'your-user',
+            'password': 'password',
+            'headers': {'Content-type': 'application/json'}
+        }
+
+        client_config.update(config)
+
+        # Set instance variables for every value in party_config
+        for k, v in client_config.items():
+            setattr(self, '%s' % (k,), v)
+
+    def create_repository(self, name, config, **connection_args):
+        repositories = []
+
+        query = "%s/%s/%s" % (self.artifactory_url, self.search_repos, name)
+        auth = (self.username, self.password)
+
+        r = requests.put(query, auth=auth, json=config)
+        print(r.content)
+
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return []
+        response = json.loads(raw_response.text)
+        for line in response:
+            for item in line:
+                repositories.append(line)
+
+        if repositories:
+            return repositories
+
+        return []
+
+
+    def get_repositories(self, repo_type=None, **connection_args):
+        repositories = []
+
+        if repo_type is None:
+            query = "%s/%s" % (self.artifactory_url, self.search_repos)
+        else:
+            query = "%s/%s?type=%s" % (self.artifactory_url,
+                                       self.search_repos, repo_type)
+
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return []
+        response = json.loads(raw_response.text)
+        for line in response:
+            for item in line:
+                repositories.append(line)
+
+        if repositories:
+            return repositories
+
+        return []
+
+
+    def query_artifactory(self, query, query_type='get'):
+        """
+        Send request to Artifactory API endpoint.
+        @param: query - Required. The URL (including endpoint) to send to the Artifactory API
+        @param: query_type - Optional. CRUD method. Defaults to 'get'.
+        """
+
+        auth = (self.username, self.password)
+        query_type = query_type.lower()
+
+        if query_type == "get":
+            response = requests.get(query, auth=auth, headers=self.headers)
+        elif query_type == "put":
+            response = requests.put(query, data=query.split('?', 1)[1], auth=auth, headers=self.headers)
+        if query_type == "post":
+            pass
+
+        if not response.ok:
+            return None
+
+        return response
+
+    def query_file_info(self, filename):
+        """
+        Send request to Artifactory API endpoint for file details.
+        @param: filename - Required. The shortname of the artifact
+        """
+        query = "%s/storage/%s" % (self.artifactory_url, filename)
+
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return raw_response
+        response = json.loads(raw_response.text)
+
+        return response
+
+    def find_by_properties(self, properties):
+        """
+        Look up an artifact, or artifacts, in Artifactory by using artifact properties.
+        @param: properties - List of properties to use as search criteria.
+        """
+        query = "%s/%s?%s" % (self.artifactory_url,
+                              self.search_prop, urlencode(properties))
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return raw_response
+
+        response = json.loads(raw_response.text)
+
+        for item in response['results']:
+            for k, v in item.items():
+                setattr(self, '%s' % (k,), v)
+
+        if not response['results']:
+            return None
+
+        artifact_list = []
+        for u in response['results']:
+            artifact_list.append(os.path.basename(u['uri']))
+
+        self.files = artifact_list
+        setattr(self, 'count', len(artifact_list))
+
+        return "OK"
+
+    def find(self, filename):
+        """
+        Look up an artifact, or artifacts, in Artifactory by
+        its filename.
+        @param: filename - Filename of the artifact to search.
+        """
+        query = "%s/%s?name=%s" % (self.artifactory_url,
+                                   self.search_name, filename)
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return raw_response
+        response = json.loads(raw_response.text)
+        if len(response['results']) < 1:
+            return None
+
+        setattr(self, 'name', filename)
+        setattr(self, 'url', json.dumps(response))
+
+        return "OK"
+
+    def get_properties(self, filename, properties=None):
+        """
+        Get an artifact's properties, as defined in the Properties tab in
+        Artifactory.
+        @param: filename - Filename of artifact of which to get properties.
+        @param: properties - Optional. List of properties to help filter results.
+        """
+        if properties:
+            query = "%s?properties=%s" % (filename, ",".join(properties))
+        else:
+            query = "%s?properties" % filename
+
+        raw_response = self.query_artifactory(query)
+        if raw_response is None:
+            return raw_response
+        response = json.loads(raw_response.text)
+        for key, value in response.items():
+            setattr(self, '%s' % (key,), value)
+
+        return "OK"
+
+
+def _client(**connection_args):
+    '''
+    Set up artifactory credentials
+
+    '''
+   
+    prefix = "artifactory"
+
+    # look in connection_args first, then default to config file
+    def get(key, default=None):
+        return connection_args.get('connection_' + key,
+            __salt__['config.get'](prefix, {})).get(key, default)
+
+    client_config = {
+      'artifactory_url': 'http://%s:%s/artifactory/api' % (get('host', 'localhost'), get('port', '8080'))
+    }
+
+    user = get('user', False)
+    password = get('password', False)
+    if user and password:
+      client_config['username'] = user
+      client_config['password'] = password
+
+    artifactory_client = ArtifactoryClient(client_config) 
+
+    return artifactory_client
+
+
+def repo_list(repo_type=None, **connection_args):
+    '''
+    Return a list of available repositories
+
+    CLI Example:
+
+    .. code-block:: bash
+
+        salt '*' artifactory_repo.repo_list
+        salt '*' artifactory_repo.repo_list REMOTE
+        salt '*' artifactory_repo.repo_list LOCAL
+    '''
+    ret = {}
+
+    artifactory = _client(**connection_args)
+    repos = artifactory.get_repositories(repo_type)
+
+    for repo in repos:
+        if 'key' in repo:
+            ret[repo.get('key')] = repo
+    return ret
+
+
+def repo_get(name, **connection_args):
+    '''
+    Return a list of available repositories
+
+    CLI Example:
+
+    .. code-block:: bash
+
+        salt '*' artifactory_repo.repo_get reponame
+    '''
+
+    ret = {}
+
+    repos = repo_list(None, **connection_args)
+    if not name in repos:
+        return {'Error': "Error retrieving repository {0}".format(name)}
+    ret[name] = repos[name]
+    return ret
+
+
+def repo_create(name, repo_type="local", package="generic", url=None, **connection_args):
+    '''
+    Create a artifactory repository
+
+    :param name: new repo name
+    :param repo_type: new repo type
+    :param package: new repo package type
+        "gradle" | "ivy" | "sbt" | "nuget" | "gems" | "npm" | "bower" |
+        "debian" | "pypi" | "docker" | "vagrant" | "gitlfs" | "yum" |
+        "generic"
+
+
+    CLI Examples:
+
+    .. code-block:: bash
+
+        salt '*' artifactory_repo.repo_create projectname remote generic
+    
+    '''
+    ret = {}
+
+    if url in connection_args and url == None:
+        url = connection_args['url']
+
+    repo = repo_get(name, **connection_args)
+
+    if repo and not "Error" in repo:
+        log.debug("Repository {0} exists".format(name))
+        return repo
+
+    repo_config = {
+        "key": name,
+        "rclass" : repo_type,
+        "packageType": package,
+        "description": "The local repository public description",
+    }
+
+    if repo_type == "remote":
+        repo_config['url'] = url
+
+    artifactory = _client(**connection_args)
+    artifactory.create_repository(name, repo_config)
+    return repo_get(name, **connection_args)
diff --git a/_states/artifactory_repo.py b/_states/artifactory_repo.py
new file mode 100644
index 0000000..e6265c5
--- /dev/null
+++ b/_states/artifactory_repo.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+'''
+Management of artifactory repositories
+======================================
+
+:depends:   - requests Python module
+:configuration: See :py:mod:`salt.modules.artifactory` for setup instructions.
+
+.. code-block:: yaml
+
+    local_artifactory_repo:
+      artifactory_repo.repo_present:
+      - name: remote_artifactory_repo
+      - package_type: generic
+      - repo_type: local
+    remote_artifactory_repo:
+      artifactory_repo.repo_present:
+      - name: remote_artifactory_repo
+      - repo_type: remote
+      - url: "http://totheremoterepo:80/"
+
+'''
+
+def __virtual__():
+    '''
+    Only load if the artifactory module is in __salt__
+    '''
+    return True
+
+
+def repo_present(name, repo_type, package_type, url=None, **kwargs):
+    '''
+    Ensures that the artifactory repo exists
+    
+    :param name: new repo name
+    :param description: short repo description
+    '''
+    ret = {'name': name,
+           'changes': {},
+           'result': True,
+           'comment': 'Repository "{0}" already exists'.format(name)}
+
+    # Check if repo is already present
+    repo = __salt__['artifactory_repo.repo_get'](name=name, **kwargs)
+
+    if 'Error' not in repo:
+        #update repo
+        pass
+    else:
+        # Create repo
+        __salt__['artifactory_repo.repo_create'](name, repo_type, package_type, url, **kwargs)
+        ret['comment'] = 'Repository "{0}" has been added'.format(name)
+        ret['changes']['repo'] = 'Created'
+    return ret
diff --git a/artifactory/client.sls b/artifactory/client.sls
new file mode 100644
index 0000000..3aad497
--- /dev/null
+++ b/artifactory/client.sls
@@ -0,0 +1,26 @@
+{% from "artifactory/map.jinja" import client with context %}
+{%- if client.enabled %}
+
+artifactory_client_install:
+  pkg.installed:
+  - names: {{ client.pkgs }}
+
+/etc/salt/minion.d/_artifactory.conf:
+  file.managed:
+  - source: salt://artifactory/files/_artifactory.conf
+  - template: jinja
+
+{%- for repo_name, repo in client.repo.iteritems() %}
+
+artifactory_client_repo_{{ repo_name }}:
+  artifactory_repo.repo_present:
+  - name: {{ repo_name }}
+  - repo_type: {{ repo.repo_type }}
+  - package_type: {{ repo.package_type }}
+  {%- if repo.url is defined %}
+  - url: {{ repo.url }}
+  {%- endif %}
+
+{%- endfor %}
+
+{%- endif %}
diff --git a/artifactory/files/_artifactory.conf b/artifactory/files/_artifactory.conf
new file mode 100644
index 0000000..776bf37
--- /dev/null
+++ b/artifactory/files/_artifactory.conf
@@ -0,0 +1,8 @@
+{%- from "artifactory/map.jinja" import client with context %}
+artifactory:
+  host: {{ client.server.host }}
+  port: {{ client.server.port }}
+  {%- if client.server.user is defined %}
+  user: {{ client.server.user }}
+  password: {{ client.server.password }}
+  {%- endif %}
diff --git a/artifactory/init.sls b/artifactory/init.sls
index 2d0d13c..b3128fa 100644
--- a/artifactory/init.sls
+++ b/artifactory/init.sls
@@ -1,6 +1,10 @@
+
 {%- if pillar.artifactory is defined %}
 include:
 {%- if pillar.artifactory.server is defined %}
 - artifactory.server
 {%- endif %}
+{%- if pillar.artifactory.client is defined %}
+- artifactory.client
+{%- endif %}
 {%- endif %}
diff --git a/artifactory/map.jinja b/artifactory/map.jinja
index cbe71cb..9decf29 100644
--- a/artifactory/map.jinja
+++ b/artifactory/map.jinja
@@ -21,3 +21,12 @@
 {%- endload %}
 
 {%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('artifactory:server')) %}
+
+{%- load_yaml as client_defaults %}
+default:
+  pkgs:
+  - python-requests
+  repo: {}
+{%- endload %}
+
+{%- set client = salt['grains.filter_by'](client_defaults, merge=salt['pillar.get']('artifactory:client')) %}
