| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.7/site-packages/cloudinit/config/ |
Upload File : |
�
oB�]c @ s� d Z d d l m Z d d l m Z d d l m Z d d l m Z e j e � Z
e Z d d d d g Z d
d � Z
d � Z d
S( sf
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 resovlconf, and similarly RedHat
will use sysconfig, this module is likely to be of little use unless those
are configured correctly.
.. note::
For RedHat 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:** fedora, 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
i����( t log( t PER_INSTANCE( t templater( t utilt fedorat opensuset rhelt sless /etc/resolv.confc C s� g } g } d | k rq xV | d j � D]A \ } } t | t � r) | rZ | j | � qj | j | � q) q) Wn x | | D] } | d | =q| W| j d � s� i | d <n | | d <t j d | � t j | | | � d S( Nt optionst flagss$ Writing resolv.conf from template %s( t itemst
isinstancet boolt appendt gett LOGt debugR t render_to_file( t template_fnt paramst target_fnameR t false_flagst keyt valt flag( ( sC /usr/lib/python2.7/site-packages/cloudinit/config/cc_resolv_conf.pyt generate_resolv_conf= s
c C s� d | k r | j d | � d St j | d t � sI | j d | � d Sd | k re | j d � n | j d � } | s� | j d � d St d | d
| d � d S( s[
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
t manage_resolv_confsF Skipping module named %s, no 'manage_resolv_conf' key in configurationNsG Skipping module named %s, 'manage_resolv_conf' present but set to Falset resolv_confs3 manage_resolv_conf True but no parameters provided!s resolv.confs1 No template found, not rendering /etc/resolv.confR R ( R R t get_cfg_option_boolt Falset warningt get_template_filenameR ( t namet cfgt cloudR t _argsR ( ( sC /usr/lib/python2.7/site-packages/cloudinit/config/cc_resolv_conf.pyt handleT s
N( t __doc__t cloudinitR t loggingt cloudinit.settingsR R R t getLoggert __name__R t frequencyt distrosR R$ ( ( ( sC /usr/lib/python2.7/site-packages/cloudinit/config/cc_resolv_conf.pyt <module>/ s