| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 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 : |
3
��b/ � @ s U d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z
ddlmZmZm
Z
ddlmZmZ ddlmZ e
je�ad Zd
ZdZdZeZd
dgZddded�eed�ged�Zeee�Z dZdZdZdZ ddd�Z!ddd�Z"ddgZ#dd d!d"d#d$gZ$dfd%d&�Z%d'd(� Z&d)d*� Z'd+d,� Z(dgd-d.�Z)dhd/d0�Z*did1d2�Z+d3d4� Z,d5d6� Z-d7d8� Z.d9d:� Z/d;d<� Z0d=d>� Z1d?d@� Z2dAdB� Z3djdDdE�Z4dkdFdG�Z5dHdI� Z6dldJdK�Z7dLdM� Z8dNdO� Z9dPdQ� Z:dRdS� Z;dTdU� Z<dVdW� Z=dXdY� Z>dZd[� Z?d\d]� Z@dmd^d_�ZAd`da� ZBdndcdd�ZCdee,iZDdS )oz*Apt Configure: Configure apt for the user.� N)�dedent)�gpg)�log)�subp� templater�util)�
MetaSchema�get_meta_doc)�PER_INSTANCEz
^[\w-]+:\wz/etc/apt/trusted.gpgz/etc/apt/trusted.gpg.d/z/etc/apt/cloud-init.gpg.d/ZubuntuZdebianZcc_apt_configurez
Apt ConfigurezConfigure apt for the usera� This module handles both configuration of apt options and adding
source lists. There are configuration options such as
``apt_get_wrapper`` and ``apt_get_command`` that control how
cloud-init invokes apt-get. These configuration options are
handled on a per-distro basis, so consult documentation for
cloud-init's distro support for instructions on using
these config options.
.. note::
To ensure that apt configuration is valid yaml, any strings
containing special characters, especially ``:`` should be quoted.
.. note::
For more information about apt configuration, see the
``Additional apt configuration`` example.a apt:
preserve_sources_list: false
disable_suites:
- $RELEASE-updates
- backports
- $RELEASE
- mysuite
primary:
- arches:
- amd64
- i386
- default
uri: 'http://us.archive.ubuntu.com/ubuntu'
search:
- 'http://cool.but-sometimes-unreachable.com/ubuntu'
- 'http://us.archive.ubuntu.com/ubuntu'
search_dns: false
- arches:
- s390x
- arm64
uri: 'http://archive-to-use-for-arm64.example.com/ubuntu'
security:
- arches:
- default
search_dns: true
sources_list: |
deb $MIRROR $RELEASE main restricted
deb-src $MIRROR $RELEASE main restricted
deb $PRIMARY $RELEASE universe restricted
deb $SECURITY $RELEASE-security multiverse
debconf_selections:
set1: the-package the-package/some-flag boolean true
conf: |
APT {
Get {
Assume-Yes 'true';
Fix-Broken 'true';
}
}
proxy: 'http://[[user][:pass]@]host[:port]/'
http_proxy: 'http://[[user][:pass]@]host[:port]/'
ftp_proxy: 'ftp://[[user][:pass]@]host[:port]/'
https_proxy: 'https://[[user][:pass]@]host[:port]/'
sources:
source1:
keyid: 'keyid'
keyserver: 'keyserverurl'
source: 'deb [signed-by=$KEY_FILE] http://<url>/ bionic main'
source2:
source: 'ppa:<ppa-name>'
source3:
source: 'deb $MIRROR $RELEASE multiverse'
key: |
------BEGIN PGP PUBLIC KEY BLOCK-------
<key data>
------END PGP PUBLIC KEY BLOCK-------)�id�name�title�description�distrosZexamples� frequencyz/var/lib/apt/listsz'/etc/apt/apt.conf.d/94cloud-init-configz)/etc/apt/apt.conf.d/90cloud-init-aptproxyzkeyserver.ubuntu.comz!http://archive.ubuntu.com/ubuntu/z"http://security.ubuntu.com/ubuntu/)�PRIMARY�SECURITYz$http://ports.ubuntu.com/ubuntu-ports�amd64Zi386Zs390xZarm64ZarmhfZpowerpcZppc64elZriscv64c C sB | dkrt j|�} | tkr"tj� S | tkr2tj� S td| ��dS )z�returns the default mirrors for the target. These depend on the
architecture, for more see:
https://wiki.ubuntu.com/UbuntuDevelopment/PackageArchive#PortsNz#No default mirror known for arch %s)r �get_dpkg_architecture�PRIMARY_ARCHES�PRIMARY_ARCH_MIRRORS�copy�PORTS_ARCHES�
PORTS_MIRRORS�
ValueError)�arch�target� r �&/usr/lib/python3.6/cc_apt_configure.py�get_default_mirrors� s
r c C s\ d}|dk r|a t|�}|jdi �}t|t�sBtdjt|�d���t||� t |||� dS )z�process the config for apt_config. This can be called from
curthooks if a global apt config was provided or via the "apt"
standalone command.N�aptz9Expected dictionary for 'apt' config, found {config_type})Zconfig_type)
�LOG�convert_to_v3_apt_format�get�
isinstance�dictr �format�type�apply_debconf_selections� apply_apt)r Zocfg�cloudr �_r �cfgr r r �handle� s
r- c C s( t j� rdS tjd�ptjd�s$d S d
S )NF�system is snappy.zapt-getr �no apt commands.T�Apt is available.)Fr. )Fr/ )Tr0 )r Zsystem_is_snappyr Zwhichr r r r �_should_configure_on_empty_apt� s
r1 c C s* | s"t � \}}|s"tjd|� d S tjd| � tj|d�d }tj|�}t| ||d�}tjd|� tj| jdd��r�t | |� t
| |||� t|||� yt| t
t� W n" ttfk
r� tjd � Y nX d
| k�r&|}||d<