1.. _proxy-minion-states:
2
3.. versionadded:: 2015.8.2
4
5===================
6Proxy Minion States
7===================
8
9
10Salt proxy state can be used to deploy, configure and run
11a ``salt-proxy`` instance on your minion. Configure proxy settings
12on the master side and the state configures and runs ``salt-proxy``
13on the remote end.
14
151. On your salt-master, ensure that pillar is configured properly.  Select an ID
16   for your proxy (in this example we will name the proxy 'p8000').
17   In your pillar topfile, place an entry for your proxy:
18
19.. code-block:: yaml
20
21   base:
22     'p8000':
23       - p8000
24
25This says that Salt's pillar should load some values for the proxy ``p8000``
26from the file ``/srv/pillar/p8000.sls`` (if you have not changed your default pillar_roots)
27
282. In the pillar root for your base environment, create the ``p8000.sls`` file with the
29   following contents:
30
31.. code-block:: yaml
32
33   proxy:
34     # set proxytype for your proxymodule
35     proxytype: ssh_sample
36     host: saltyVM
37     username: salt
38     password: badpass
39
403. Create the following state in your state tree
41   (let's name it salt_proxy.sls)
42
43.. code-block:: yaml
44
45  salt-proxy-configure:
46    salt_proxy.configure_proxy:
47      - proxyname: p8000
48      - start: True # start the process if it isn't running
49
504. Make sure your salt-master and salt-minion are running.
51
525. Run the state salt_proxy on the minion where you want to run ``salt-proxy``
53
54Example using ``state.sls`` to configure and run ``salt-proxy``
55
56.. code-block:: bash
57
58  # salt device_minion state.sls salt_proxy
59
60This starts salt-proxy on ``device_minion``
61
626. Accept your proxy's key on your salt-master
63
64.. code-block:: bash
65
66   salt-key -y -a p8000
67   The following keys are going to be accepted:
68   Unaccepted Keys:
69   p8000
70   Key for minion p8000 accepted.
71
727. Now you should be able to run commands on your proxy.
73
74.. code-block:: bash
75
76    salt p8000 pkg.list_pkgs
77