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

܍~c���UdZddlmZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZmZdd	lmZeje��Zd
dd�Zd
Zdddegd�eed��gdgd�Zeed<ee��Zd�Zdedede
dededdfd�ZdS)z"Resolv Conf: configure resolv.conf�)�Logger)�dedent)�log)�	templater�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEzresolv.confzsystemd.resolved.conf)z/etc/resolv.confz/etc/systemd/resolved.confaThis module is intended to manage resolv.conf in environments where early
configuration of resolv.conf is necessary for further bootstrapping and/or
where configuration management such as puppet or chef own DNS configuration.
As Debian/Ubuntu will, by default, utilize resolvconf, and similarly Red Hat
will use sysconfig, this module is likely to be of little use unless those
are configured correctly.

When using a :ref:`datasource_config_drive` and a RHEL-like system,
resolv.conf will also be managed automatically due to the available
information provided for DNS servers in the :ref:`network_config_v2` format.
For those that with to have different settings, use this module.

In order for the ``resolv_conf`` section to be applied, ``manage_resolv_conf``
must be set ``true``.

.. note::
    For Red Hat with sysconfig, be sure to set PEERDNS=no for all DHCP
    enabled NICs.

.. note::
    And, in Ubuntu/Debian it is recommended that DNS be configured via the
    standard /etc/network/interfaces configuration file.
�cc_resolv_confzResolv ConfzConfigure resolv.conf)�alpine�fedora�mariner�opensuse�photon�rhel�slesa�            manage_resolv_conf: true
            resolv_conf:
              nameservers:
                - 8.8.8.8
                - 8.8.4.4
              searchdomains:
                - foo.example.com
                - bar.example.com
              domain: example.com
              sortlist:
                - 10.0.0.1/255
                - 10.0.0.2
              options:
                rotate: true
                timeout: 1
            �manage_resolv_conf)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�metac��g}g}d|vrb|d���D]G\}}t|t��r-|r|�|���2|�|���H||zD]}|d|=�|�d��si|d<||d<t
�d|��tj|||��dS)N�options�flagsz$Writing resolv.conf from template %s)	�items�
isinstance�bool�append�get�LOG�debugr�render_to_file)�template_fn�params�target_fnamer!�false_flags�key�val�flags        �A/usr/lib/python3/dist-packages/cloudinit/config/cc_resolv_conf.py�generate_resolv_confr2_s����E��K��F����y�)�/�/�1�1�	,�	,�H�C���#�t�$�$�
,��,��L�L��%�%�%�%��&�&�s�+�+�+����#�$�$���9��d�#�#��:�:�i� � ����y���F�7�O��I�I�4�k�B�B�B�
��[�,��?�?�?�?�?�r�cfg�cloudr�args�returnNc��d|vr|�d|��dStj|dd��s|�d|��dSd|vr|�d��dS	|�t
|jj��}n&#t$r|�d��YdSwxYwt||d|jj�	��dS)
a[
    Handler for resolv.conf

    @param name: The module name "resolv-conf" from cloud.cfg
    @param cfg: A nested dict containing the entire cloud config contents.
    @param cloud: The L{CloudInit} object in use.
    @param log: Pre-initialized Python logger object to use for logging.
    @param args: Any module arguments from cloud.cfg
    rzFSkipping module named %s, no 'manage_resolv_conf' key in configurationNFzGSkipping module named %s, 'manage_resolv_conf' present but set to False�resolv_confz3manage_resolv_conf True but no parameters provided!z0No template found, not rendering resolve configs)r*r+r,)
r(r�get_cfg_option_bool�warning�get_template_filename�RESOLVE_CONFIG_TEMPLATE_MAP�distro�resolve_conf_fn�KeyErrorr2)rr4r5rr6r*s      r1�handlerAvs'���3�&�&��	�	�
<��	
�	
�	
�
	���#�C�)=�u�E�E���	�	�
=��	
�	
�	
�
	���C������I�J�J�J�����1�1�'���(D�E�
�
�����������F�G�G�G�����������=�!��\�1�����
�Fs�'*B�B5�4B5)�__doc__�loggingr�textwrapr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr	�cloudinit.config.schemar
r�cloudinit.settingsr�	getLogger�__name__r'r=�MODULE_DESCRIPTIONr�__annotations__r2�str�listrA�r3r1�<module>rQs���)�(�(�������������$�$�$�$�$�$�%�%�%�%�%�%�%�%�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+��g���!�!��&�"9����
��4��
$�%�������
�	
�	
��*!5�5�I%�%��j�%�%�%�N�,�t�
�
��@�@�@�.-�

�-��-�#(�-�/5�-�=A�-�	�-�-�-�-�-�-r3