%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/roster/ |
| Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/roster/cloud.pyc |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l
Z d d l Z d d l m
Z
d d � Z d � Z d S( u�
Use the cloud cache on the master to derive IPv4 addresses based on minion ID.
This roster requires that the minion in question was created using at least the
2015.5.0 version of Salt Cloud. Starting with the 2015.5.0 release, Salt Cloud
maintains an index of minions that it creates and deletes. This index tracks the
provider and profile configuration used to provision the minion, including
authentication information. So long as this configuration remains current, it can
be used by Salt SSH to log into any minion in the index.
To connect as a user other than root, modify the cloud configuration file
usually located at /etc/salt/cloud. For example, add the following:
.. code-block:: yaml
ssh_username: my_user
sudo: True
i ( t absolute_importt print_functiont unicode_literalsN( t string_typesu globc K@ s� i } t j j t j j t j j t d � d � � } t d | � } xG| j � D]9\ } } | j
d d � | j
d d � } } i | d 6| d 6}
| j
d g � } | j
d g � } g }
xO | | f D]A } t | t
� r� |
| }
q� t | t � r� |
j | � q� q� Wt j
d d � } t | |
� } t j t j
d
i � � | | <| | j i | d 6� t j j j |
| � } t | t � r�| | | d <n7 t | t
� r�| d d k r�| d | | d <q�n t j j d |
| d t d d �} | r| | | d <n t j j d |
| d t d d �} | rR| | | d <n t j j d |
| d t d d �} | rT | | | d <qT qT W| S( us
Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster
u conf_fileu cloudu cache.cloudu profileu provideru driveru
public_ipsu private_ipsu roster_orderu publicu privateu localu roster_defaultsu hostu useri u rootu ssh_passwordt
search_globalt defaultu passwordu private_keyu privu sudoN( u publicu privateu local( t saltt configt cloud_configt ost patht joint dirnamet __opts__t
__runner__t itemst gett Nonet
isinstancet listR t appendt extract_ipv4t copyt deepcopyt updatet utilst cloudt
ssh_usernamest get_cloud_config_valuet False( t tgtt tgt_typet kwargst rett
cloud_optst minionst minion_idt full_infot profilet providert vm_t
public_ipst private_ipst ip_listt itemt roster_ordert preferred_ipt ssh_usernamet passwordt key_filenamet sudo( ( s5 /usr/lib/python2.7/site-packages/salt/roster/cloud.pyt targets"