
    Vh
                    P    d dl mZ dZdZd dlmZ d dlmZ d Ze	dk(  r e        yy)	    )annotationsa  
---
module: dpkg_selections
short_description: Dpkg package selection selections
description:
    - Change dpkg package selection state via C(--get-selections) and C(--set-selections).
version_added: "2.0"
author:
- Brian Brazil (@brian-brazil)  <brian.brazil@boxever.com>
options:
    name:
        description:
            - Name of the package.
        required: true
        type: str
    selection:
        description:
            - The selection state to set the package to.
        choices: [ 'install', 'hold', 'deinstall', 'purge' ]
        required: true
        type: str
extends_documentation_fragment:
- action_common_attributes
attributes:
    check_mode:
        support: full
    diff_mode:
        support: full
    platform:
        support: full
        platforms: debian
notes:
    - This module will not cause any packages to be installed/removed/purged, use the M(ansible.builtin.apt) module for that.
z
- name: Prevent python from being upgraded
  ansible.builtin.dpkg_selections:
    name: python
    selection: hold

- name: Allow python to be upgraded
  ansible.builtin.dpkg_selections:
    name: python
    selection: install
)AnsibleModule)get_best_parsable_localec            	     R   t        t        t        d      t        g dd            d      } | j                  dd      }t        |       }t        |||||      }|| _        | j
                  d	   }| j
                  d
   }| j                  |d|gd      \  }}}d|v r| j                  d|d|d       n|sd}	n|j                         d   }		|k7  }
| j                  s|
s| j                  |
|	|       | j                  |dg|d|d       | j                  |
|	|       y )NT)required)installhold	deinstallpurge)choicesr   )name	selection)argument_specsupports_check_modedpkg)LANGLC_ALLLC_MESSAGESLC_CTYPELANGUAGEr   r   z--get-selections)check_rczno packages found matchingzFailed to find package 'z' to perform selection 'z'.)msgznot present   )changedbeforeafterz--set-selections )datar   )r   dictget_bin_pathr   run_command_environ_updateparamsrun_command	fail_jsonsplit
check_mode	exit_json)moduler   localeDPKG_ENVr   r   rcouterrcurrentr   s              O/home/dcms/DCMS/lib/python3.12/site-packages/ansible/modules/dpkg_selections.pymainr0   ;   s?   t$#LW[\
 !F vt,D%f-FFV^deH(0F%== Dk*I %%t-?&FQU%VLBS#s*Y]_hij))+a."G	J
0148S^bc
WWIF    __main__N)

__future__r   DOCUMENTATIONEXAMPLESansible.module_utils.basicr   "ansible.module_utils.common.localer   r0   __name__ r1   r/   <module>r:      s<    #!D
 5 G!GH zF r1   