%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/host.pyo |
�
���^c @@ s` d Z d d l m Z m Z m Z d d l m Z d d l Z e d � Z
d � Z d � Z d S( u}
Management of addresses and names in hosts file
===============================================
The ``/etc/hosts`` file can be managed to contain definitions for specific hosts:
.. code-block:: yaml
salt-master:
host.present:
- ip: 192.168.0.42
Or using the ``names`` directive, you can put several names for the same IP.
(Do not try one name with space-separated values).
.. code-block:: yaml
server1:
host.present:
- ip: 192.168.0.42
- names:
- server1
- florida
.. note::
Changing the ``names`` in ``host.present`` does not cause an
update to remove the old entry.
.. code-block:: yaml
server1:
host.present:
- ip:
- 192.168.0.42
- 192.168.0.43
- 192.168.0.44
- names:
- server1
You can replace all existing names for a particular IP address:
.. code-block:: yaml
127.0.1.1:
host.only:
- hostnames:
- foo.example.com
- foo
Or delete all existing names for an address:
.. code-block:: yaml
203.0.113.25:
host.only:
- hostnames: []
i ( t absolute_importt print_functiont unicode_literals( t sixNc
C@ s- i | d 6i d 6t d 6d d 6} t | t � s= | g } n t d � } g } t � } t � } | j g | D] } | | k ro | | f ^ qo � x� t j | � D]� \ } } | | k r| | k r�| r� | j | | f � q| j d g � j
d j | | � � q�q� | | k r7| j
d j | | � � q� t j
j j j | � re| j | | f � q� t | d <| j
d
j | | � � q� Wx� | D]� \ } } t d r�d | d <| j
d j | | � � nU t d
| | � r�| j
d j | | � � n&