HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/sysrc.cpython-310.pyc
o

�N�g�@s$dZdZdd�Zdd�Zdd�ZdS)	z
State to work with sysrc

�sysrccCstdd�rdSdS)z.
    Only load if sysrc executable exists
    zcmd.has_execrT)FzCommand not found: sysrc)�__salt__�rr�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/sysrc.py�__virtual__
srcKs�|iddd�}tddd|i|��}|dur4|��D]\}}|||kr3d|d<|�d	�|d
<|SqtddurUd|�d
�|d
<||d|dd�|d<d|d<|Stdd||d�|��}d|�d�|d
<||d�|d<d|d<|S)a�
    Ensure a sysrc variable is set to a specific value.

    name
        The variable name to set
    value
        Value to set the variable to
    file
        (optional) The rc file to add the variable to.
    jail
        (option) the name or JID of the jail to set the value in.

    Example:

    .. code-block:: yaml

        syslogd:
          sysrc.managed:
            - name: syslogd_flags
            - value: -ss
    F���name�changes�result�comment�	sysrc.getrNTr
z% is already set to the desired value.r�testzThe value of "z" will be changed!z = z
 will be set.��old�newr	z	sysrc.set)r�valuez" was changed!r)r�items�__opts__)rr�kwargs�ret�
current_stateZrcnameZrcdict�	new_staterrr�manageds*�
�rcKs�|iddd�}tddd|i|��}|dur$d|d<d	|�d
�|d<|StddurCd	|�d
�|d<|d	|�d�d�|d<d|d<|Stddd|i|��}d	|�d�|d<||d�|d<d|d<|S)z�
    Ensure a sysrc variable is absent.

    name
        The variable name to set
    file
        (optional) The rc file to add the variable to.
    jail
        (option) the name or JID of the jail to set the value in.
    FrrrrNTr
�"z" is already absent.rr
z" will be removed!z" will be removed.rr	zsysrc.removez" was removed!r)rr)rrrrrrrr�absentLs$

�rN)�__doc__Z__virtualname__rrrrrrr�<module>s
	9