
    Vh                     b    d dl mZmZmZ eZdZdZdZd dl	m
Z
 d dlZd Zd Zed	k(  r e        yy)
    )absolute_importdivisionprint_functiona  
module: lbu

short_description: Local Backup Utility for Alpine Linux

version_added: '0.2.0'

description:
  - Manage Local Backup Utility of Alpine Linux in run-from-RAM mode.
extends_documentation_fragment:
  - community.general.attributes

attributes:
  check_mode:
    support: full
  diff_mode:
    support: none

options:
  commit:
    description:
      - Control whether to commit changed files.
    type: bool
  exclude:
    description:
      - List of paths to exclude.
    type: list
    elements: str
  include:
    description:
      - List of paths to include.
    type: list
    elements: str

author:
  - Kaarle Ritvanen (@kunkku)
a}  
# Commit changed files (if any)
- name: Commit
  community.general.lbu:
    commit: true

# Exclude path and commit
- name: Exclude directory
  community.general.lbu:
    commit: true
    exclude:
      - /etc/opt

# Include paths without committing
- name: Include file and directory
  community.general.lbu:
    include:
      - /root/.ssh/authorized_keys
      - /var/lib/misc
zG
msg:
  description: Error message.
  type: str
  returned: on failure
)AnsibleModuleNc                  J   t        ddidddddddd      d	fd
} d	}d	}dD ]h  }j                  |   s | |d      j                  d      }j                  |   D ],  }t        j                  j                  d|z         dd  |vs+d}. j j                  d   r|xs  | d      dkD  }j                  rj                  |xs |       |r/dD ]*  }j                  |   s | |gj                  |     d, |r
 | d       dj                         y )Ntypeboolliststr)r   elements)commitexcludeincludeT)argument_specsupports_check_modeFc                      j                  j                  dd      gt        |       z         \  }}}|rj                  |       |S )NlbuT)required)changedmsg)run_commandget_bin_pathr
   	fail_json)argscodestdoutstderrr   modules       i/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/modules/lbu.pyrun_lbuzrun_module.<locals>.run_lbu^   sV    %11   67$t*D 
ff W&9    )r   r   z-l
/   r   status )r   )r   paramssplitospathnormpath
check_mode	exit_json)r    updater   parampathsr*   r   r   s         @@r   
run_moduler1   R   sU   v& &E: &E:

 !F G FF' "==E4(..t4Ee, "77##C$J/35@!F"" }}X178,r1!162+ 	E}}U#5e 45	
 
W%r!   c                      t                y )N)r1    r!   r   mainr4      s    Lr!   __main__)
__future__r   r   r   r   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   os.pathr)   r1   r4   __name__r3   r!   r   <module>r>      sP    A @$L*
 5 .&b zF r!   