
    Vh~                         d dl mZmZmZ eZdZdZdZd dl	Z	d dl
Z
d dlmZ d dlmZmZ  G d d	e      Z ed
ddg      Z G d de      Zd Zd Zedk(  r e        yy)    )absolute_importdivisionprint_functiona  
module: pacman
short_description: Manage packages with I(pacman)
description:
  - Manage packages with the I(pacman) package manager, which is used by Arch Linux and its variants.
author:
  - Indrajit Raychaudhuri (@indrajitr)
  - Aaron Bull Schaefer (@elasticdog) <aaron@elasticdog.com>
  - Maxime de Roucy (@tchernomax)
  - Jean Raby (@jraby)
extends_documentation_fragment:
  - community.general.attributes
attributes:
  check_mode:
    support: full
  diff_mode:
    support: full
options:
  name:
    description:
      - Name or list of names of the package(s) or file(s) to install, upgrade, or remove. Cannot be used in combination with
        O(upgrade).
    aliases: [package, pkg]
    type: list
    elements: str

  state:
    description:
      - Whether to install (V(present) or V(installed), V(latest)), or remove (V(absent) or V(removed)) a package.
      - V(present) and V(installed) will simply ensure that a desired package is installed.
      - V(latest) will update the specified package if it is not of the latest available version.
      - V(absent) and V(removed) will remove the specified package.
    default: present
    choices: [absent, installed, latest, present, removed]
    type: str

  force:
    description:
      - When removing packages, forcefully remove them, without any checks. Same as O(extra_args="--nodeps --nodeps").
      - When combined with O(update_cache), force a refresh of all package databases. Same as O(update_cache_extra_args="--refresh
        --refresh").
    default: false
    type: bool

  remove_nosave:
    description:
      - When removing packages, do not save modified configuration files as C(.pacsave) files. (passes C(--nosave) to pacman).
    version_added: 4.6.0
    default: false
    type: bool

  executable:
    description:
      - Path of the binary to use. This can either be C(pacman) or a pacman compatible AUR helper.
      - Pacman compatibility is unfortunately ill defined, in particular, this modules makes extensive use of the C(--print-format)
        directive which is known not to be implemented by some AUR helpers (notably, C(yay)).
      - Beware that AUR helpers might behave unexpectedly and are therefore not recommended.
    default: pacman
    type: str
    version_added: 3.1.0

  extra_args:
    description:
      - Additional option to pass to pacman when enforcing O(state).
    default: ''
    type: str

  update_cache:
    description:
      - Whether or not to refresh the master package lists.
      - This can be run as part of a package installation or as a separate step.
      - If not specified, it defaults to V(false).
      - Please note that this option only had an influence on the module's C(changed) state if O(name) and O(upgrade) are
        not specified before community.general 5.0.0. See the examples for how to keep the old behavior.
    type: bool

  update_cache_extra_args:
    description:
      - Additional option to pass to pacman when enforcing O(update_cache).
    default: ''
    type: str

  upgrade:
    description:
      - Whether or not to upgrade the whole system. Cannot be used in combination with O(name).
      - If not specified, it defaults to V(false).
    type: bool

  upgrade_extra_args:
    description:
      - Additional option to pass to pacman when enforcing O(upgrade).
    default: ''
    type: str

  reason:
    description:
      - The install reason to set for the packages.
    choices: [dependency, explicit]
    type: str
    version_added: 5.4.0

  reason_for:
    description:
      - Set the install reason for V(all) packages or only for V(new) packages.
      - In case of O(state=latest) already installed packages which will be updated to a newer version are not counted as
        V(new).
    default: new
    choices: [all, new]
    type: str
    version_added: 5.4.0

notes:
  - When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly
    to the O(name) option.
  - To use an AUR helper (O(executable) option), a few extra setup steps might be required beforehand. For example, a dedicated
    build user with permissions to install packages could be necessary.
  - 'In the tests, while using C(yay) as the O(executable) option, the module failed to install AUR packages with the error:
    C(error: target not found: <pkg>).'
a  
packages:
  description:
    - A list of packages that have been changed.
    - Before community.general 4.5.0 this was only returned when O(upgrade=true). In community.general 4.5.0, it was sometimes
      omitted when the package list is empty, but since community.general 4.6.0 it is always returned when O(name) is specified
      or O(upgrade=true).
  returned: success and O(name) is specified or O(upgrade=true)
  type: list
  elements: str
  sample: [package, other-package]

cache_updated:
  description:
    - The changed status of C(pacman -Sy).
    - Useful when O(name) or O(upgrade=true) are specified next to O(update_cache=true).
  returned: success, when O(update_cache=true)
  type: bool
  sample: false
  version_added: 4.6.0

stdout:
  description:
    - Output from pacman.
  returned: success, when needed
  type: str
  sample: ":: Synchronizing package databases...  core is up to date :: Starting full system upgrade..."
  version_added: 4.1.0

stderr:
  description:
    - Error output from pacman.
  returned: success, when needed
  type: str
  sample: "warning: libtool: local (2.4.6+44+gb9b44533-14) is newer than core (2.4.6+42+gb88cebd5-15)\nwarning ..."
  version_added: 4.1.0
a	  
- name: Install package foo from repo
  community.general.pacman:
    name: foo
    state: present

- name: Install package bar from file
  community.general.pacman:
    name: ~/bar-1.0-1-any.pkg.tar.xz
    state: present

- name: Install package foo from repo and bar from file
  community.general.pacman:
    name:
      - foo
      - ~/bar-1.0-1-any.pkg.tar.xz
    state: present

- name: Install package from AUR using a Pacman compatible AUR helper
  community.general.pacman:
    name: foo
    state: present
    executable: yay
    extra_args: --builddir /var/cache/yay

- name: Upgrade package foo
  # The 'changed' state of this call will indicate whether the cache was
  # updated *or* whether foo was installed/upgraded.
  community.general.pacman:
    name: foo
    state: latest
    update_cache: true

- name: Remove packages foo and bar
  community.general.pacman:
    name:
      - foo
      - bar
    state: absent

- name: Recursively remove package baz
  community.general.pacman:
    name: baz
    state: absent
    extra_args: --recursive

- name: Run the equivalent of "pacman -Sy" as a separate step
  community.general.pacman:
    update_cache: true

- name: Run the equivalent of "pacman -Su" as a separate step
  community.general.pacman:
    upgrade: true

- name: Run the equivalent of "pacman -Syu" as a separate step
  # Since community.general 5.0.0 the 'changed' state of this call
  # will be 'true' in case the cache was updated, or when a package
  # was updated.
  #
  # The previous behavior was to only indicate whether something was
  # upgraded. To keep the old behavior, add the following to the task:
  #
  #   register: result
  #   changed_when: result.packages | length > 0
  community.general.pacman:
    update_cache: true
    upgrade: true

- name: Run the equivalent of "pacman -Rdd", force remove package baz
  community.general.pacman:
    name: baz
    state: absent
    force: true

- name: Install foo as dependency and leave reason untouched if already installed
  community.general.pacman:
    name: foo
    state: present
    reason: dependency
    reason_for: new

- name: Run the equivalent of "pacman -S --asexplicit", mark foo as explicit and install it if not present
  community.general.pacman:
    name: foo
    state: present
    reason: explicit
    reason_for: all
N)AnsibleModule)defaultdict
namedtuplec                   &    e Zd ZddZd Zd Zd Zy)Packagec                 .    || _         || _        || _        y Nnamesourcesource_is_URL)selfr   r   r   s       l/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/modules/pacman.py__init__zPackage.__init__  s    	*    c                     | j                   |j                   k(  xr4 | j                  |j                  k(  xr | j                  |j                  k(  S r   r   r   os     r   __eq__zPackage.__eq__  s>    yyAFF"ht{{ahh'>h4CUCUYZYhYhChhr   c                 4    | j                   |j                   k  S r   )r   r   s     r   __lt__zPackage.__lt__  s    yy166!!r   c                 V    d| j                   d| j                  d| j                  dS )Nz	Package("z", "z", )r   r   s    r   __repr__zPackage.__repr__  s    ,0IIt{{DDVDVWWr   N)F)__name__
__module____qualname__r   r   r   r    r   r   r
   r
     s    +
i"Xr   r
   VersionTuplecurrentlatestc                   d    e Zd Zd ZddZd ZddZd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zy)Pacmanc                 d   || _         t        d      | j                   _        | j                   j                  }g | _        g | _        g | _        d| _        i | _        | j                   j                  |d   d      | _
        d | _        |d   dk(  rd| _        y |d   d	k(  rd
| _        y |d   | _        y )NC)LC_ALLF
executableTstate	installedpresentremovedabsent)mdictrun_command_environ_updateparams_msgs_stdouts_stderrschangedexit_paramsget_bin_pathpacman_path_cached_databasetarget_state)r   moduleps      r   r   zPacman.__init__   s    ,0,<)FFMM
66..qE $ W:$ )DwZ9$ (D !'
Dr   Nc                     |r| j                   j                  |       |r| j                  j                  |       |r| j                  j                  |       y y r   )r5   appendr6   r7   )r   msgstdoutstderrs       r   add_exit_infoszPacman.add_exit_infos8  sF    JJc"MM  (MM  ( r   c                    dj                  | j                        }dj                  | j                        }dj                  | j                        }|r|| j                  d<   |r|| j                  d<   || j                  d<   y )N
rC   rD   rB   )joinr5   r6   r7   r9   )r   rB   stdoutsstderrss       r   _set_mandatory_exit_paramsz!Pacman._set_mandatory_exit_params@  sn    ii

#))DMM*))DMM*)0DX&)0DX&"%r   c                     | j                  |||       | j                          |r | j                  j                  di |  | j                  j
                  di | j                   y )Nr"   )rE   rK   r9   updater1   	fail_json)r   rB   rC   rD   kwargss        r   failzPacman.failJ  sY    C0'')#D##-f-,4++,r   c                     | j                           | j                  j                  dd| j                  i| j                   y )Nr8   r"   )rK   r1   	exit_jsonr8   r9   r   s    r   successzPacman.successQ  s4    '')BB1A1ABr   c                    | j                   j                  d   rR| j                          | j                   j                  d   s)| j                   j                  d   s| j                          | j	                         | _        | j                   j                  d   r | j                          | j                          | j                   j                  d   rb| j                         }| j                  dk(  r"| j                  |       | j                          n!| j                  |       | j                          | j                  d       | j                          y )Nupdate_cacher   upgrader0   zNothing to dorB   )r1   r4   update_package_dbrS   _build_inventory	inventoryrV   package_listr=   remove_packagesinstall_packagesrE   )r   pkgss     r   runz
Pacman.runU  s    66==(""$FFMM&)TVV]]9-E..066==#LLNLLN66== $$&D  H,$$T*%%d+ 	0r   c                     g }g }g |D ]  } j                   j                  d   r|j                   j                  d   vsR j                   j                  d   dk(  rQ j                  d   |j                      j                   j                  d   k7  rj	                  |j                         |j
                  r|j	                  |       |j                   j                  d   vs- j                  dk(  s|j                   j                  d   v s|j	                  |        t        |      dk(  r=t        |      dk(  r/t              dk(  r!g  j                  d	<    j                  d
       y  j                  dddg j                   j                  d   r(j                   j                   j                  d           fd}g }g }g }|r@ |d|      \  }}	}
|j                  |       |j                  |	       |j                  |
       |r@ |d|      \  }}	}
|j                  |       |j                  |	       |j                  |
       t        |      dk(  r/t              dk(  r!g  j                  d	<    j                  d
       y d _        |rdj                  t        |            dz   nd|rdj                  t        |            dz   ndd j                  d<   D cg c]	  }||vs| }} j                   j                  rE j                  dt        |      t        |      z   z         t        ||z          j                  d	<   y  fd}|r	 |d|       |r	 |d|       r j                  ddg} j                   j                  d   dk(  r|j	                  d       n|j	                  d       |j                          j                   j!                  |d      \  }}}|dk7  r j#                  d|||         j                  ||!       t        ||z          j                  d	<    j                  d"t        |      t        |      z   z         y c c}w )#Nreasonpkg_reasons
reason_forallinstalled_pkgsr%   upgradable_pkgsr   packageszpackage(s) already installed--noconfirm--noprogressbarz--needed
extra_argsc           	      T   | ddgz   |D cg c]  }|j                    c}z   }j                  j                  |d      \  }}}|dk7  rj                  d|||       |j	                         D cg c]  }|j                          }}g }	g }
g }|D ]  }d|v sd	|v sd
|v r|j                         \  }}|j                  d   v r9|	j                  |dj                  d   |   dj                  d   |          |v r1|
j                  |d|dj                  j                  d          nQ|j                  d   v r*|
j                  |d|dj                  d   |          n|
j                  |d|       |j                  |        ||	|
fS c c}w c c}w )N--print-formatz%n %vFcheck_rcr   z$Failed to list package(s) to installcmdrC   rD   zloading packageszthere is nothing to doAvoid runningre   -rb   ra   )
r   r1   run_commandrP   
splitlinesstripsplitrZ   rA   r4   )pacman_verbpkglistr?   rp   rcrC   rD   lname_verbeforeafterto_be_installedr   versioncmd_basepkgs_to_set_reasonr   s                 r   _build_install_diffz4Pacman.install_packages.<locals>._build_install_diff  s    k+;WEE[bHcVWHccC!%!3!3C%!3!HBQw		@cRXag	h+1+<+<+>?a	?H?FE O - &*.F!.KbcOc !	g4>>*:;;MMdnnEU6VW[6\^b^l^lmz^{  }A  _B  #C  D--LLtWdffmmH>U!VWT^^M::LLtWdnn]>[\`>a!bcLLD'!:;&&t,-  $VU333 Id
 @s   F 2F%--sync	--upgradeTrG    r|   r}   diffz Would have installed %d packagesc                    | gz   |D cg c]  }|j                    c}z   }j                  j                  |d      \  }}}|dk7  rj                  d|||       j	                  ||       j                          y c c}w )NFrm   r   Failed to install package(s)ro   rC   rD   )r   r1   rs   rP   rE   _invalidate_database)	rw   rx   r?   rp   ry   rC   rD   r   r   s	          r   _install_packages_for_realz;Pacman.install_packages.<locals>._install_packages_for_real  s    k]*-H1ahh-HHC!%!3!3C%!3!HBQw		8c&Y_	`vf=%%' .Is   Bz
--database
dependencyz--asdepsz--asexplicitFrm   r   ro   r   zInstalled %d package(s))r1   r4   r   rZ   rA   r   r=   lenr9   rE   r;   extendr8   rH   sorted
check_moders   rP   )r   r^   pkgs_to_installpkgs_to_install_from_urlr?   r   r|   r}   re   bachanged_reason_pkgsr   rp   ry   rC   rD   r   r   s   `                @@r   r]   zPacman.install_packageso  s   #%  	*Avv}}X&dnn];;66==.%7NN=1!&&9TVV]]8=TT"))!&&1 )//2dnn-=>>$$0FFdnn->??&&q)#	*& 1$-E)F!)KPSTfPgklPl+-DZ( >? 	
 66==&OODFFMM,78	4< )(ODGAq!!!!$MM!LLO#)+7OPGAq!!!!$MM!LLO~!#,>(?1(D+-DZ( >? ;Adiiv/$6b8=TYYve}-42$
 
 +=XQ@WqXX66 Bc.FY\_`s\tFt uv+1.CV2V+WDZ(	( &xA#&{4LM ##]LACvv}}X&,6

:&

>*JJ)*!%!3!3C%!3!HBQw		8c&Y_	`vf='-n?R.R'S$5^9LsSfOg9ghiI Ys   0	Q+:Q+c                 V   |D cg c]*  }|j                   | j                  d   v s|j                   , }}t        |      dk(  r!g | j                  d<   | j	                  d       y d| _        | j                  dddg}|| j                  j                  d	   z  }|| j                  j                  d
   rddgng z  }|ddgz   |z   }| j                  j                  |d      \  }}}|dk7  r| j                  d|||       |j                         }	|	| j                  d<   dj                  |	      dz   dd| j                  d<   | j                  j                  r-|	| j                  d<   | j	                  dt        |	      z         y | j                  j                  d   rdgng }
||
z   |z   }| j                  j                  |d      \  }}}|dk7  r| j                  d|||       | j                          |	| j                  d<   | j	                  dt        |	      z  ||       y c c}w )Nre   r   rg   zpackage(s) already absentTz--removerh   ri   rj   forcez--nodepsrl   z%n-%vFrm   z#failed to list package(s) to removero   rG   r   r   r   zWould have removed %d packagesremove_nosavez--nosavezfailed to remove package(s)zRemoved %d package(s)r   )r   rZ   r   r9   rE   r8   r;   r1   r4   rs   rP   rv   rH   r   r   )r   r^   r?   pkg_names_to_remover   rp   ry   rC   rD   removed_pkgsnosave_argss              r   r\   zPacman.remove_packages  s/   /3b!qvvP`Aa7aqvvbb"#q(+-DZ( ;< $$j-ARSDFFMM,//g0FZ,BN *G447JJ!VV//e/DFF7II;V\bIc||~'3$ii-4$
 
 66+7DZ( @3|CT TU&*ffmmO&Dzl"$'::!VV//e/DFF7II3VTZI[!!#'3$3c,6GGPV_ef[ cs
    H&H&c                 t   t        | j                  d         dk(  r| j                  d       yd| _        ddd}| j                  d   j	                         D ]?  \  }}|dxx   |d	|j
                  d
z  cc<   |dxx   |d	|j                  d
z  cc<   A || j                  d<   | j                  d   j                         | j                  d<   | j                  j                  r+| j                  dt        | j                  d         z         y| j                  ddddg}| j                  j                  d   r|| j                  j                  d   z  }| j                  j                  |d      \  }}}| j                          |dk(  r| j                  d||       y| j                  d|||       y)z@Runs pacman --sync --sysupgrade if there are upgradable packagesrf   r   zNothing to upgradeNTr   r   r|   rr   rG   r}   r   rg   z$%d packages would have been upgradedr   z--sysupgradez--quietrh   upgrade_extra_argsFrm   zSystem upgradedr   zCould not upgradero   )r   rZ   rE   r8   itemsr$   r%   r9   keysr1   r   r;   r4   rs   r   rP   )r   r   pkgversionsrp   ry   rC   rD   s           r   rV   zPacman.upgrade%  s    t~~/01Q6 45 r*!^^,=>DDF 	@MCN30@0@AANM#x??M	@ $( '+~~6G'H'M'M'O$666#dnnM^>_:`a
   C vv}}12tvv}}%9::!%!3!3C%!3!HB%%'Qw##$5fV#T		-3vf	Ur   c                     | j                   C| j                  j                  | j                  ddgd      \  }}}|j	                         | _         | j                   S )z+runs pacman --sync --list with some cachingr   z--listTrm   )r<   r1   rs   r;   rt   )r   dummyrg   s      r   _list_databasezPacman._list_databaseK  sZ      (%)VV%7%79I9I8U]8^im%7%n"E8U$,$7$7$9D!$$$r   c                     d| _         y)z*invalidates the pacman --sync --list cacheN)r<   r   s    r   r   zPacman._invalidate_databaseR  s
     $r   c                    | j                   j                  r(| j                  d       d| _        d| j                  d<   y| j
                  ddg}| j                   j                  d   r|| j                   j                  d   z  }| j                   j                  d   r|dgz  }nt        | j                               }| j                   j                  |d	
      \  }}}| j                          | j                   j                  d   rd| j                  d<   n+t        | j                               }|k7  | j                  d<   | j                  d   rd| _        |dk(  r| j                  d||       y| j                  d|||       y)zruns pacman --sync --refreshz!Would have updated the package dbTcache_updatedNr   z	--refreshupdate_cache_extra_argsr   Frm   r   zUpdated package dbr   zcould not update package dbro   )r1   r   rE   r8   r9   r;   r4   r   r   rs   r   rP   )r   rp   	pre_statery   rC   rD   
post_states          r   rX   zPacman.update_package_dbV  sj   66 CDDL04D_- 

 66==23466==!:;;C66==!K= C t2245I!VV//e/DFF!!#66==!04D_-   3 3 56J09Z0GD_-O,DL7 4VFSII3VTZI[r   c                    g }| j                   j                  d   D ]f  }|sd}|| j                  d   v r4| j                  d   |   D ]  }|j                  t	        ||               N|| j                  d   v s|| j                  d   v r|j                  t	        ||             | j
                  ddd	|g}| j                   j                  |d
      \  }}}|dk7  rv| j
                  ddd	|g}| j                   j                  |d
      \  }}}|dk7  r*| j                  dk(  r| j                  d|z  ||||       |j                         d   }d}|j                         }	|j                  t	        |	||             i |S )a  Takes the input package list and resolves packages groups to their package list using the inventory,
        extracts package names from packages given as files or URLs using calls to pacman

        Returns the expanded/resolved list as a list of Package
        r   Favailable_groups)r   r   available_pkgsre   r   rl   z%nrm   r   r   r0   zFailed to list package %s)rB   rp   rC   rD   ry   Tr   )r1   r4   rZ   rA   r
   r;   rs   r=   rP   rt   ru   )
r   pkg_listr   is_URLgroup_memberrp   ry   rC   rD   pkg_names
             r   r[   zPacman.package_list~  s    66==( (	ZCFdnn%788$(NN3E$Fs$K ULOOGl$STU'788C4>>RbCc<c S => ''3CT3O%)VV%7%7e%7%L"FF7++[:JDRUVC)-););C%);)P&BQw,,8$ II$?3$G$''-'-#% &  $..04F!F!<<>XcQW XYQ(	ZT r   c                    i }| j                   j                  | j                  dgd      \  }}}t        j                  d      }|j                         D ].  }|j                  |      }|s|j                         \  }}|||<   0 t        t              }	| j                   j                  | j                  ddgd      \  }}}t        j                  d      }
|j                         D ]=  }|
j                  |      }|s|j                         \  }}|	|   j                  |       ? i }| j                         }|D ]1  }|j                         }|s|j                         dd \  }}}|||<   3 t        t              }| j                   j                  | j                  d	ddgd      \  }}}t        j                  d      }|j                         D ]=  }|j                  |      }|s|j                         \  }}||   j                  |       ? i }| j                   j                  | j                  dd
gd      \  }}}|j                         }|rd|d   v r|dd }dj                  |      }|dk(  r|sn|dk(  r|j                         D ]p  }|j                         }|sd|v sd|v r|j                         }t        |      dk7  r| j!                  d|z         |d   }|d   }|d   }t#        ||      ||<   r n| j!                  d|||       i }| j                   j                  | j                  ddgd      \  }}}|j                         D ]-  }|j                         }|s|j                         d   }d||<   / | j                   j                  | j                  ddgd      \  }}}|j                         D ]-  }|j                         }|s|j                         d   }d||<   / t%        ||	||||      S )a  Build a cache datastructure used for all pkg lookups
        Returns a dict:
        {
            "installed_pkgs": {pkgname: version},
            "installed_groups": {groupname: set(pkgnames)},
            "available_pkgs": {pkgname: version},
            "available_groups": {groupname: set(pkgnames)},
            "upgradable_pkgs": {pkgname: (current_version,latest_version)},
            "pkg_reasons": {pkgname: reason},
        }

        Fails the module if a package requested for install cannot be found
        z--queryTrm   z#^\s*(?P<pkg>\S+)\s+(?P<ver>\S+)\s*$z--groupsz%^\s*(?P<group>\S+)\s+(?P<pkg>\S+)\s*$N   r   z
--upgradesFrq   r      rG   z	[ignored]   zInvalid line: %srW   )r$   r%   z3Couldn't get list of packages available for upgrade)rC   rD   ry   z
--explicitexplicitz--depsr   )re   installed_groupsr   r   rf   rb   )r1   rs   r;   recompilert   matchgroupsr   setaddr   ru   rv   rH   r   rP   r#   r2   )r   re   r   rC   query_rerz   query_matchr   verr   query_groups_requery_groups_matchgrouppkgnamer   databaserepor   sync_groups_resync_groups_matchrf   ry   rD   sr$   r%   rb   s                              r   rY   zPacman._build_inventory  sq    #vv1143C3CY2OZ^1_vu::DE""$ 	&A"..+K"))+HC"%N3	& 's+#vv11y*5  2  
vu **%MN""$ 	1A!0!6!6q!9%/668NE7U#''0	1 &&( 	&A	AWWYr]ND#s"%N3	& 's+#vv11xZ@4  2  
vu $LM""$ 	-A . 4 4Q 7$*113JE3U#'',	- !VV//y,7% 0 
FF ""$o2ABZF6" 761W &&( TGGI!#!';GGIq6Q;II"4q"8I9dA$1'3GF'S$T  IIE	   #vv1143C3CYP\2]hl1mvu""$ 	*A	A'')A,C)K	*  $vv1143C3CYPX2Ydh1ivu""$ 	,A	A'')A,C+K	, )-)-+#
 	
r   )NNN)r   r    r!   r   rE   rK   rP   rS   r_   r]   r\   rV   r   r   rX   r[   rY   r"   r   r   r'   r'     sT    +0)&-C4CjJ/gb$VL%%&\P1fG
r   r'   c                     t        t        t        ddddg      t        ddg d      t        d	d
      t        d	d
      t        dd      t        dd      t        d	      t        dd      t        d	      t        dd      t        dddg      t        ddddg            g dgddggd      } dD ]1  }t        j                  | j                  |         | j                  |<   3 | S )Nliststrr   package)typeelementsaliasesr.   )r.   r-   r%   r0   r/   )r   defaultchoicesboolF)r   r   pacmanr   )r   r   r   )r   r   newrd   )r   r,   r   r   r+   rj   rV   r   rU   r   ra   rc   )r   rU   rV   r   rV   T)argument_specrequired_one_ofmutually_exclusivesupports_check_mode)rj   r   r   )r   r2   shlexrv   r4   )r>   str_argss     r   setup_moduler   ;  s    6EE9;MN!O
 FE2FE:93f%#;6*$(eR$@UZ,FGu~N!
$ ==#Y/0 +F2 T G"'++fmmH.E"FhG Mr   c                  F    t        t                     j                          y r   )r'   r   r_   r"   r   r   mainr   [  s    
<> r   __main__)
__future__r   r   r   r   __metaclass__DOCUMENTATIONRETURNEXAMPLESr   r   ansible.module_utils.basicr   collectionsr   r   objectr
   r#   r'   r   r   r   r"   r   r   <module>r      s    A @vp$
LWr 
  4 /Xf X  .9h*?@Y
V Y
x@!
 zF r   