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_mcollective.cpython-311.pyc
�

܍~c���@�UdZddlZddlZddlmZddlmZddlmZddl	m
Zddl	mZmZddl
mZdd	lmZdd
lmZmZddlmZdZd
ZdZeje��ZdZdgZdddeeed��gedgd�Zeed<ee��Zeeefd�Z de!dededede"ddfd�Z#dS) z6 Mcollective: Install, configure and start mcollective�N)�Logger)�dedent)�	ConfigObj)�log)�subp�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEz&/etc/mcollective/ssl/server-public.pemz'/etc/mcollective/ssl/server-private.pemz/etc/mcollective/server.cfga�This module installs, configures and starts mcollective. If the ``mcollective``
key is present in config, then mcollective will be installed and started.

Configuration for ``mcollective`` can be specified in the ``conf`` key under
``mcollective``. Each config value consists of a key value pair and will be
written to ``/etc/mcollective/server.cfg``. The ``public-cert`` and
``private-cert`` keys, if present in conf may be used to specify the public and
private certificates for mcollective. Their values will be written to
``/etc/mcollective/ssl/server-public.pem`` and
``/etc/mcollective/ssl/server-private.pem``.

.. note::
    The ec2 metadata service is readable by non-root users.
    If security is a concern, use include-once and ssl urls.
�all�cc_mcollective�Mcollectivez(Install, configure and start mcollectivea�            # Provide server private and public key and provide the following
            # config settings in /etc/mcollective/server.cfg:
            # loglevel: debug
            # plugin.stomp.host: dbhost

            # WARNING WARNING WARNING
            # The ec2 metadata service is a network service, and thus is
            # readable by non-root users on the system
            # (ie: 'ec2metadata --user-data')
            # If you want security for this, please use include-once + SSL urls
            mcollective:
              conf:
                loglevel: debug
                plugin.stomp.host: dbhost
                public-cert: |
                    -------BEGIN CERTIFICATE--------
                    <cert data>
                    -------END CERTIFICATE--------
                private-cert: |
                    -------BEGIN CERTIFICATE--------
                    <cert data>
                    -------END CERTIFICATE--------
            �mcollective)�id�name�title�description�distros�examples�	frequency�activate_by_schema_keys�metac��	tj|dd���}ttj|����}nV#t
$rI}|jtjkr�t�	d|��t��}Yd}~nd}~wwxYw|�
��D]�\}}|dkr"tj||d���||d<d|d	<�-|d
kr"tj||d���||d<d|d	<�Ut|t��r|||<�pt|t��r4||jvri||<|�
��D]\}	}
|
|||	<���t|��||<��	tj|d
|z��n.#t
$r!}|jtjkrn�Yd}~nd}~wwxYwtj��}|�|��tj||���d���dS)NF)�quiet�decodez4Did not find file %s (starting with an empty config)zpublic-certi�)�modezplugin.ssl_server_public�ssl�securityproviderzprivate-certi�zplugin.ssl_server_privatez%s.old)r�	load_filer�io�BytesIO�IOError�errno�ENOENT�LOG�debug�items�
write_file�
isinstance�str�dict�sections�copy�write�getvalue)�config�
server_cfg�pubcert_file�pricert_file�old_contents�mcollective_config�e�cfg_name�cfg�o�v�contentss            �A/usr/lib/python3/dist-packages/cloudinit/config/cc_mcollective.py�	configurer?^sz��-��~�j��e�L�L�L��&�r�z�,�'?�'?�@�@�����-�-�-��7�e�l�"�"���I�I�F��
�
�
�"+�������������-����"�<�<�>�>�8�8���3��}�$�$��O�L�#�E�:�:�:�:�=I��9�:�5:��1�2�2�
��
'�
'��O�L�#�E�:�:�:�:�>J��:�;�5:��1�2�2��#�s�#�#�
8�/2�"�8�,�,��C�$�(�(�	
8��#5�#>�>�>�35�&�x�0�!�i�i�k�k�8�8�F�Q��67�&�x�0��3�3�8�03�3�x�x�"�8�,�,�	�	
�	�*�h�*�5�6�6�6�6�������7�e�l�"�"���
�D�D�D�D����������z�|�|�H����X�&�&�&��O�J�� 1� 1� 3� 3�%�@�@�@�@�@�@s-�8;�
B�?B	�	B�2F�
F6�F1�1F6rr:�cloudr�args�returnc���d|vr|�d|��dS|d}|j�d��d|vrt|d���t	jgd�d���dS)	Nrz?Skipping module named %s, no 'mcollective' key in configuration)r�conf)r2)�servicer�restartF)�capture)r(�distro�install_packagesr?r)rr:r@rrA�mcollective_cfgs      r>�handlerK�s���
�C����	�	�M��	
�	
�	
�	���-�(�O�
�L�!�!�"2�3�3�3��� � ����0�1�1�1�1�	�I�3�3�3�U�C�C�C�C�C�C�)$�__doc__r%r"�loggingr�textwrapr�	configobjr�	cloudinitrrr�cloudinit.cloudr	�cloudinit.configr
�cloudinit.config.schemarr�cloudinit.settingsr
�PUBCERT_FILE�PRICERT_FILE�
SERVER_CFG�	getLogger�__name__r'�MODULE_DESCRIPTIONrr�__annotations__r?r,�listrK�rLr>�<module>r_s���=�<�<�����	�	�	�	������������� ������$�$�$�$�$�$� � � � � � � � �!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+�7��8��
*�
��g���!�!����"�'����
7�%����
�	
�	
��8� -��G$�$��j�$�$�$�L�,�t�
�
��
���	:A�:A�:A�:A�zD�

�D��D�#(�D�/5�D�=A�D�	�D�D�D�D�D�DrL