403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/debconfmod.cpython-310.pyc
o

;jM�@s&dZdZdd�Zd	dd�Zdd�ZdS)
a�
Management of debconf selections
================================

:depends:   - debconf-utils package

The debconfmod state module manages the enforcement of debconf selections,
this state can set those selections prior to package installation.

Available Functions
-------------------

The debconfmod state has two functions, the ``set`` and ``set_file`` functions

set
    Set debconf selections from the state itself

set_file
    Set debconf selections from a file

.. code-block:: yaml

    nullmailer-debconf:
      debconf.set:
        - name: nullmailer
        - data:
            'shared/mailname': {'type': 'string', 'value': 'server.domain.tld'}
            'nullmailer/relayhost': {'type': 'string', 'value': 'mail.domain.tld'}

    ferm-debconf:
      debconf.set:
        - name: ferm
        - data:
            'ferm/enable': {'type': 'boolean', 'value': True}

.. note::
    Due to how PyYAML imports nested dicts (see :ref:`here <yaml-idiosyncrasies>`),
    the values in the ``data`` dict must be indented four spaces instead of two.

If you're setting debconf values that requires `dpkg-reconfigure`, you can use
the ``onchanges`` requisite to reconfigure your package:

.. code-block:: yaml

    set-default-shell:
      debconf.set:
        - name: dash
        - data:
            'dash/sh': {'type': 'boolean', 'value': false}

    reconfigure-dash:
      cmd.run:
        - name: dpkg-reconfigure -f noninteractive dash
        - onchanges:
          - debconf: set-default-shell

Every time the ``set-default-shell`` state changes, the ``reconfigure-dash``
state will also run.

.. note::
    For boolean types, the value should be ``true`` or ``false``, not
    ``'true'`` or ``'false'``.
ZdebconfcCs tddkrdSdtvrdStS)z9
    Confirm this module is on a Debian based system
    Z	os_familyZDebian)Fz)debconf state only runs on Debian systems�debconf.show)Fz"debconf module could not be loaded)Z
__grains__�__salt__�__virtualname__�rr�J/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/debconfmod.py�__virtual__Es
rNcKs�|iddd�}|duri}nt|t�sd|d<d|d<|S|dur$i}nt|t�s3d|d<d	|d<|Std
rAd|d<d|d<|S|rQtd||||fi|��}n
td
|fi|��}|rcd|d<|Sd|d<d|d<|S)a�
    Set debconf selections from a file or a template

    .. code-block:: yaml

        <state_id>:
          debconf.set_file:
            - source: salt://pathto/pkg.selections

        <state_id>:
          debconf.set_file:
            - source: salt://pathto/pkg.selections?saltenv=myenvironment

        <state_id>:
          debconf.set_file:
            - source: salt://pathto/pkg.selections.jinja2
            - template: jinja
            - context:
                some_value: "false"

    source:
        The location of the file containing the package selections

    template
        If this setting is applied then the named templating engine will be
        used to render the package selections file, currently jinja, mako, and
        wempy are supported

    context
        Overrides default context variables passed to the template.

    defaults
        Default context passed to the template.
    T���name�changes�result�commentNFrz Context must be formed as a dictrz!Defaults must be formed as a dict�testz'Debconf selections would have been set.zdebconf.set_templatezdebconf.set_filezDebconf selections were set.z+Unable to set debconf selections from file.)�
isinstance�dict�__opts__r)r	�source�template�context�defaults�kwargs�retrrrr�set_fileRs<#

���rcKs>|iddd�}td|�}|��D]�\}}|ddkr%|dr!dnd	|d<|d
urL||dt|d�g|vrL|ddkr@d|d<|d|�d
�7<qtdr`d
|d<d�|d�|d|<qtd|||d|d�r�|ddkrzd|d|<qd�|d�|d|<qd|d<d|d<d|d|<q|ds�d|d<|S)a�
    Set debconf selections

    .. code-block:: yaml

        <state_id>:
          debconf.set:
            - name: <name>
            - data:
                <question>: {'type': <type>, 'value': <value>}
                <question>: {'type': <type>, 'value': <value>}

    name:
        The package name to set answers for.

    data:
        A set of questions/answers for debconf. Note that everything under
        this must be indented twice.

    question:
        The question the is being pre-answered

    type:
        The type of question that is being asked (string, boolean, select, etc.)

    value:
        The answer to the question
    Trrr�typeZboolean�value�true�falseNrzUnchanged answers: � r
rz
New value: {}r
zdebconf.set�passwordz(password hidden)z{}Fz#Some settings failed to be applied.zFailed to set!z%All specified answers are already set)r�items�strr�format)r	�datarr�current�key�argsrrr�set�s,"r%)NNN)�__doc__rrrr%rrrr�<module>s
A

H

Youez - 2016 - github.com/yon3zu
LinuXploit