a )gh @sFddlmZmZmZeZdZdZddlm Z ddZ e dkrBe dS) )absolute_importdivisionprint_functiona --- module: dpkg_selections short_description: Dpkg package selection selections description: - Change dpkg package selection state via --get-selections and --set-selections. version_added: "2.0" author: - Brian Brazil (@brian-brazil) 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 won't cause any packages to be installed/removed/purged, use the C(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 ) AnsibleModulec Cstttddtgdddddd}|dd}|jd}|jd }|j|d |gdd \}}}|sjd }n |d }||k}|js|s|j|||d|j|dgd||fdd|j|||ddS)NT)required)installZholdZ deinstallpurge)choicesr)name selection)Z argument_specZsupports_check_modedpkgr r z--get-selections)check_rcz not present)changedbeforeZafterz--set-selectionsz%s %s)datar )rdictZ get_bin_pathparamsZ run_commandsplitZ check_modeZ exit_json) moduler r r rcouterrcurrentrrC/usr/lib/python3.9/site-packages/ansible/modules/dpkg_selections.pymain;s&     r__main__N) Z __future__rrrtypeZ __metaclass__Z DOCUMENTATIONZEXAMPLESZansible.module_utils.basicrr__name__rrrrs"