Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.11/site-packages/ansible/modules/__pycache__/ |
Upload File : |
� ���c�q � � � d dl mZmZmZ eZdZdZdZd dl Z d dl Z d dlZd dlZd dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZmZmZ d dlmZ d d lmZ d d lmZ d dlZd dlZd dl m!Z" e"j# � � Z!dZ$n# e%$ r dxZxZxZ"Z!dZ$Y nw xY wg d �Z&dZ'dZ(d� Z) G d� de*� � Z+ G d� de,� � Z- G d� de-� � Z.d� Z/d� Z0e1dk r e0� � dS dS )� )�absolute_import�division�print_functiona� --- module: apt_repository short_description: Add and remove APT repositories description: - Add or remove an APT repositories in Ubuntu and Debian. extends_documentation_fragment: action_common_attributes attributes: check_mode: support: full diff_mode: support: full platform: platforms: debian notes: - This module supports Debian Squeeze (version 6) as well as its successors and derivatives. options: repo: description: - A source string for the repository. type: str required: true state: description: - A source string state. type: str choices: [ absent, present ] default: "present" mode: description: - The octal mode for newly created files in sources.list.d. - Default is what system uses (probably 0644). type: raw version_added: "1.6" update_cache: description: - Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes. type: bool default: "yes" aliases: [ update-cache ] update_cache_retries: description: - Amount of retries if the cache update fails. Also see I(update_cache_retry_max_delay). type: int default: 5 version_added: '2.10' update_cache_retry_max_delay: description: - Use an exponential backoff delay for each retry (see I(update_cache_retries)) up to this max delay in seconds. type: int default: 12 version_added: '2.10' validate_certs: description: - If C(false), SSL certificates for the target repo will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool default: 'yes' version_added: '1.8' filename: description: - Sets the name of the source list file in sources.list.d. Defaults to a file name based on the repository source url. The .list extension will be automatically added. type: str version_added: '2.1' codename: description: - Override the distribution codename to use for PPA repositories. Should usually only be set when working with a PPA on a non-Ubuntu target (for example, Debian or Mint). type: str version_added: '2.3' install_python_apt: description: - Whether to automatically try to install the Python apt library or not, if it is not already installed. Without this library, the module does not work. - Runs C(apt-get install python-apt) for Python 2, and C(apt-get install python3-apt) for Python 3. - Only works with the system Python 2 or Python 3. If you are using a Python on the remote that is not the system Python, set I(install_python_apt=false) and ensure that the Python apt library for your Python version is installed some other way. type: bool default: true author: - Alexander Saltanov (@sashka) version_added: "0.7" requirements: - python-apt (python 2) - python3-apt (python 3) - apt-key or gpg a! - name: Add specified repository into sources list ansible.builtin.apt_repository: repo: deb http://archive.canonical.com/ubuntu hardy partner state: present - name: Add specified repository into sources list using specified filename ansible.builtin.apt_repository: repo: deb http://dl.google.com/linux/chrome/deb/ stable main state: present filename: google-chrome - name: Add source repository into sources list ansible.builtin.apt_repository: repo: deb-src http://archive.canonical.com/ubuntu hardy partner state: present - name: Remove specified repository from sources list ansible.builtin.apt_repository: repo: deb http://archive.canonical.com/ubuntu hardy partner state: absent - name: Add nginx stable repository from PPA and install its signing key on Ubuntu target ansible.builtin.apt_repository: repo: ppa:nginx/stable - name: Add nginx stable repository from PPA and install its signing key on Debian target ansible.builtin.apt_repository: repo: 'ppa:nginx/stable' codename: trusty - name: One way to avoid apt_key once it is removed from your distro block: - name: somerepo |no apt key ansible.builtin.get_url: url: https://download.example.com/linux/ubuntu/gpg dest: /etc/apt/trusted.gpg.d/somerepo.asc - name: somerepo | apt source ansible.builtin.apt_repository: repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/myrepo.asc] https://download.example.com/linux/ubuntu {{ ansible_distribution_release }} stable" state: present �#N)� AnsibleModule)� has_respawned�probe_interpreters_for_module�respawn_module)� to_native)�PY3)� fetch_urlTF)z/etc/apt/keyringsz/etc/apt/trusted.gpg.dz/usr/share/keyringsi� )�debzdeb-srcc �� � | j s�| � d� � }|r�| � |dg� � \ }}}|dk r/| � d|�d|� � � �d��� � | � |d|d d g� � \ }}}|dk r3| � d|�d|� � � �d��� � d S d S d S | � d|z �� � d S )Nzapt-get�updater zFailed to auto-install z. Error was: '�'��msg�installz-yz-qz&%s must be installed to use check mode)� check_mode�get_bin_path�run_command� fail_json�strip)�module�apt_pkg_name�apt_get_path�rc�so�ses �C/usr/lib/python3.11/site-packages/ansible/modules/apt_repository.py�install_python_aptr! � s0 � ��� V��*�*�9�5�5��� p��+�+�\�8�,D�E�E�J�B��B��Q�w�w�� � � �Ua�Ua�Ua�ce�ck�ck�cm�cm�cm�cm�%n� �o�o�o��+�+�\�9�l�TX�Z^�,_�`�`�J�B��B��Q�w�w�� � � �Ua�Ua�Ua�ce�ck�ck�cm�cm�cm�cm�%n� �o�o�o�o�o� p� p� �w� ���E��T��U�U�U�U�U� c � � e Zd ZdS )� InvalidSourceN)�__name__� __module__�__qualname__� r"