403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_resolv_conf.cpython-36.pyc
3

��b�@shdZddlmZddlmZmZddlmZeje	�Z
eZddddd	d
gZddd
�Z
dd�Zdd�ZdS)ax
Resolv Conf
-----------
**Summary:** configure resolv.conf

This 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.

.. 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.

**Internal name:** ``cc_resolv_conf``

**Module frequency:** per instance

**Supported distros:** alpine, fedora, photon, rhel, sles

**Config keys**::

    manage_resolv_conf: <true/false>
    resolv_conf:
        nameservers: ['8.8.4.4', '8.8.8.8']
        searchdomains:
            - foo.example.com
            - bar.example.com
        domain: example.com
        options:
            rotate: <true/false>
            timeout: 1
�)�log)�	templater�util)�PER_INSTANCEZalpineZfedoraZopensuseZphotonZrhelZsleszresolv.confzsystemd.resolved.conf)z/etc/resolv.confz/etc/systemd/resolved.confcCs�g}g}d|krNx<|dj�D],\}}t|t�r|r@|j|�q|j|�qWx||D]}|d|=qXW|jd�s|i|d<||d<tjd|�tj|||�dS)NZoptions�flagsz$Writing resolv.conf from template %s)	�items�
isinstance�bool�append�get�LOG�debugrZrender_to_file)�template_fn�params�target_fnamerZfalse_flags�key�val�flag�r�$/usr/lib/python3.6/cc_resolv_conf.py�generate_resolv_confAs

rc
Cs�d|kr|jd|�dStj|dd�s6|jd|�dSd|krL|jd�dSy|jt|jj�}Wntk
r�|jd�dSXt	||d|jjd	�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
    Zmanage_resolv_confzFSkipping module named %s, no 'manage_resolv_conf' key in configurationNFzGSkipping module named %s, 'manage_resolv_conf' present but set to FalseZresolv_confz3manage_resolv_conf True but no parameters provided!z0No template found, not rendering resolve configs)rrr)
r
rZget_cfg_option_boolZwarningZget_template_filename�RESOLVE_CONFIG_TEMPLATE_MAPZdistroZresolve_conf_fn�KeyErrorr)�nameZcfgZcloudrZ_argsrrrr�handleXs0


rN)�__doc__Z	cloudinitrZloggingrrZcloudinit.settingsrZ	getLogger�__name__rZ	frequencyZdistrosrrrrrrr�<module>/s


Youez - 2016 - github.com/yon3zu
LinuXploit