HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_salt_minion.cpython-311.pyc
�

܍~c$���UdZddlZddlmZddlmZddlmZmZm	Z	ddl
mZddlm
Z
ddlmZmZdd	lmZmZdd
lmZdZdd
deegeed��gdgd�Zeed<ee��ZGd�d��Zdede
dedededdfd�ZdS)z&Salt Minion: Setup and run salt minion�N)�Logger)�dedent)�safeyaml�subp�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�ALL_DISTROS�	bsd_utils)�PER_INSTANCEa.This module installs, configures and starts salt minion. If the ``salt_minion``
key is present in the config parts, then salt minion will be installed and
started. Configuration for salt minion can be specified in the ``conf`` key
under ``salt_minion``. Any conf values present there will be assigned in
``/etc/salt/minion``. The public and private keys to use for salt minion can be
specified with ``public_key`` and ``private_key`` respectively. Optionally if
you have a custom package name, service name or config directory you can
specify them with ``pkg_name``, ``service_name`` and ``config_dir``.

Salt keys can be manually generated by: ``salt-key --gen-keys=GEN_KEYS``,
where ``GEN_KEYS`` is the name of the keypair, e.g. 'minion'.  The keypair
will be copied to ``/etc/salt/pki`` on the minion instance.
�cc_salt_minionzSalt MinionzSetup and run salt miniona�            salt_minion:
                pkg_name: salt-minion
                service_name: salt-minion
                config_dir: /etc/salt
                conf:
                    master: salt.example.com
                grains:
                    role:
                        - web
                public_key: |
                    ------BEGIN PUBLIC KEY-------
                    <key data>
                    ------END PUBLIC KEY-------
                private_key: |
                    ------BEGIN PRIVATE KEY------
                    <key data>
                    ------END PRIVATE KEY-------
                pki_dir: /etc/salt/pki/minion
            �salt_minion)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�metac��eZdZdZd�ZdS)�
SaltConstantsz>
    defines default distribution specific salt variables
    c�B�tj��rd|_d|_d|_nd|_d|_d|_tj|d|j��|_tj|d|j��|_tj|d|j��|_dS)	Nzpy-saltrz/usr/local/etc/saltzsalt-minionz	/etc/salt�pkg_name�
config_dir�service_name)r�
is_FreeBSDr�srv_name�conf_dir�get_cfg_option_str)�self�cfgs  �A/usr/lib/python3/dist-packages/cloudinit/config/cc_salt_minion.py�__init__zSaltConstants.__init__Ns����?���	(�%�D�M�)�D�M�1�D�M�M�*�D�M�)�D�M�'�D�M��/��Z���O�O��
��/���t�}�
�
��
��/�����
�
��
�
�
�N)�__name__�
__module__�__qualname__�__doc__r'�r(r&rrIs-��������
�
�
�
�
r(rrr%�cloud�log�args�returnc�v�d|vr|�d|��dS|d}t|���}|j�|j��tj|j��d|vratj	�
|jd��}tj|�
d����}tj||��d|vratj	�
|jd��}	tj|�
d����}
tj|	|
��d|v�r:d|v�r5tj	�
|jd	��}tj	�|��s%tj	�
|jd
��}|�
d|��}tjd��5tj|��tj	�
|d
��}
tj	�
|d��}tj|
|d��tj||d��ddd��n#1swxYwY|jjdkrt%jdd��t)jd|jdgd���dS)Nrz?Skipping module named %s, no 'salt_minion' key in configuration)r%�conf�minion�grains�
public_key�private_keyz
pki/minion�pki�pki_dir�?z
minion.pubz
minion.pem�freebsd�salt_minion_enable�YES�service�restartF)�capture)�debugr�distro�install_packagesrr�
ensure_dirr"�os�path�joinr�dumps�get�
write_file�isdir�umask�osfamilyr
�set_rc_config_valuerr!)rr%r.r/r0�s_cfg�const�
minion_config�minion_data�
grains_config�grains_data�pki_dir_defaultr9�pub_name�pem_names               r&�handlerXes����C����	�	�M��	
�	
�	
�	���
��E��e�$�$�$�E�
�L�!�!�%�.�1�1�1�	�O�E�N�#�#�#���������U�^�X�>�>�
��n�U�Y�Y�v�%6�%6�7�7����
�{�3�3�3��5�������U�^�X�>�>�
��n�U�Y�Y�x�%8�%8�9�9����
�{�3�3�3��u����%�!7�!7��'�,�,�u�~�|�D�D���w�}�}�_�-�-�	B� �g�l�l�5�>�5�A�A�O��)�)�I��7�7��
�Z��
�
�	<�	<��O�G�$�$�$��w�|�|�G�\�:�:�H��w�|�|�G�\�:�:�H��O�H�e�L�&9�:�:�:��O�H�e�M�&:�;�;�;�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�
�|��	�)�)��%�&:�E�B�B�B�	�I�y�%�.�)�4�e�D�D�D�D�D�Ds�BI+�+I/�2I/)r,rE�loggingr�textwrapr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr	�cloudinit.config.schemar
r�cloudinit.distrosrr
�cloudinit.settingsr�MODULE_DESCRIPTIONr�__annotations__r�str�listrXr-r(r&�<module>res���
-�,�,�	�	�	�	�������������*�*�*�*�*�*�*�*�*�*�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�4�4�4�4�4�4�4�4�+�+�+�+�+�+�
�� ��
(�%��}����
�	
�	
��0!.��? � ��j� � � �D�,�t�
�
��
�
�
�
�
�
�
�
�86E�

�6E��6E�#(�6E�/5�6E�=A�6E�	�6E�6E�6E�6E�6E�6Er(