??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó ßUdac@`s$ddlmZmZmZeZidd6dgd6dd6ZdZd Zd Z dd l Z dd l Z dd l Z dd l mZdZd ZdZe jdƒZe jdƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zd„Zedkr eƒnd S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bys --- module: luks_device short_description: Manage encrypted (LUKS) devices version_added: "2.8" description: - "Module manages L(LUKS,https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup) on given device. Supports creating, destroying, opening and closing of LUKS container and adding or removing new keys." options: device: description: - "Device to work with (e.g. C(/dev/sda1)). Needed in most cases. Can be omitted only when I(state=closed) together with I(name) is provided." type: str state: description: - "Desired state of the LUKS container. Based on its value creates, destroys, opens or closes the LUKS container on a given device." - "I(present) will create LUKS container unless already present. Requires I(device) and I(keyfile) options to be provided." - "I(absent) will remove existing LUKS container if it exists. Requires I(device) or I(name) to be specified." - "I(opened) will unlock the LUKS container. If it does not exist it will be created first. Requires I(device) and I(keyfile) to be specified. Use the I(name) option to set the name of the opened container. Otherwise the name will be generated automatically and returned as a part of the result." - "I(closed) will lock the LUKS container. However if the container does not exist it will be created. Requires I(device) and I(keyfile) options to be provided. If container does already exist I(device) or I(name) will suffice." type: str default: present choices: [present, absent, opened, closed] name: description: - "Sets container name when I(state=opened). Can be used instead of I(device) when closing the existing container (i.e. when I(state=closed))." type: str keyfile: description: - "Used to unlock the container and needed for most of the operations. Parameter value is the path to the keyfile with the passphrase." - "BEWARE that working with keyfiles in plaintext is dangerous. Make sure that they are protected." type: path new_keyfile: description: - "Adds additional key to given container on I(device). Needs I(keyfile) option for authorization. LUKS container supports up to 8 keys. Parameter value is the path to the keyfile with the passphrase." - "NOTE that adding additional keys is I(not idempotent). A new keyslot will be used even if another keyslot already exists for this keyfile." - "BEWARE that working with keyfiles in plaintext is dangerous. Make sure that they are protected." type: path remove_keyfile: description: - "Removes given key from the container on I(device). Does not remove the keyfile from filesystem. Parameter value is the path to the keyfile with the passphrase." - "NOTE that removing keys is I(not idempotent). Trying to remove a key which no longer exists results in an error." - "NOTE that to remove the last key from a LUKS container, the I(force_remove_last_key) option must be set to C(yes)." - "BEWARE that working with keyfiles in plaintext is dangerous. Make sure that they are protected." type: path force_remove_last_key: description: - "If set to C(yes), allows removing the last key from a container." - "BEWARE that when the last key has been removed from a container, the container can no longer be opened!" type: bool default: no requirements: - "cryptsetup" - "wipefs" - "lsblk" author: "Jan Pokorny (@japokorn)" s¾ - name: create LUKS container (remains unchanged if it already exists) luks_device: device: "/dev/loop0" state: "present" keyfile: "/vault/keyfile" - name: (create and) open the LUKS container; name it "mycrypt" luks_device: device: "/dev/loop0" state: "opened" name: "mycrypt" keyfile: "/vault/keyfile" - name: close the existing LUKS container "mycrypt" luks_device: state: "closed" name: "mycrypt" - name: make sure LUKS container exists and is closed luks_device: device: "/dev/loop0" state: "closed" keyfile: "/vault/keyfile" - name: create container if it does not exist and add new key to it luks_device: device: "/dev/loop0" state: "present" keyfile: "/vault/keyfile" new_keyfile: "/vault/keyfile2" - name: add new key to the LUKS container (container has to exist) luks_device: device: "/dev/loop0" keyfile: "/vault/keyfile" new_keyfile: "/vault/keyfile2" - name: remove existing key from the LUKS container luks_device: device: "/dev/loop0" remove_keyfile: "/vault/keyfile2" - name: completely remove the LUKS container and its contents luks_device: device: "/dev/loop0" state: "absent" só name: description: When I(state=opened) returns (generated or given) name of LUKS container. Returns None if no name is supplied. returned: success type: str sample: "luks-c1da9a58-2fde-4256-9d9f-6ab008b4dd1b" N(t AnsibleModuleiis\s*crypt\s+([^\s]*)\s*s\s*device:\s+([^\s]*)\s*tHandlercB`s#eZd„Zd„Zd„ZRS(cC`s%||_|jjdtƒ|_dS(Ntlsblk(t_modulet get_bin_pathtTruet _lsblk_bin(tselftmodule((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt__init__¼s cC`s|jj|ƒS(N(R t run_command(Rtcommand((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt _run_commandÀscC`sf|j|jd|ddgƒ}|tdkrNtd||tfƒ‚n|tjƒ}d|S(s‚ Generate name for luks based on device UUID ('luks-'). Raises ValueError when obtaining of UUID fails. s-ns-otUUIDis+Error while generating LUKS name for %s: %ssluks-%s(RRt RETURN_CODEt ValueErrortSTDERRtSTDOUTtstrip(Rtdevicetresulttdev_uuid((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytgenerate_luks_nameÃs !(t__name__t __module__RRR(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyR ºs  t CryptHandlercB`seeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z e d „Z RS( cC`s2tt|ƒj|ƒ|jjdtƒ|_dS(Nt cryptsetup(tsuperR!RR R R t_cryptsetup_bin(RR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyRÒscC`s|j|j|ddgƒ}|tdkrKtd||tfƒ‚ntj|tƒ}y|jdƒ}Wnt k rŠd}nX|S(s¥ obtain LUKS container name based on the device where it is located return None if not found raise ValueError if lsblk command fails s-nlos type,nameis*Error while obtaining LUKS name for %s: %siN( RRRRRtLUKS_NAME_REGEXtsearchRtgrouptAttributeErrortNone(RRRtmtname((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytget_container_name_by_deviceÖs  cC`sU|j|jd|gƒ}|tdkr/dStj|tƒ}|jdƒ}|S(s– obtain device name based on the LUKS container name return None if not found raise ValueError if lsblk command fails RiiN(RR$RR)tLUKS_DEVICE_REGEXR&RR'(RR+RR*R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytget_container_device_by_nameès cC`s)|j|jd|gƒ}|tdkS(s0 check if the LUKS container does exist tisLuksi(RR$R(RRR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytis_luksöscC`sR|j|jdd||gƒ}|tdkrNtd||tfƒ‚ndS(Nt luksFormats-qis#Error while creating LUKS on %s: %s(RR$RRR(RRtkeyfileR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytrun_luks_createüs c C`s[|j|jd|ddd||gƒ}|tdkrWtd||tfƒ‚ndS(Ns --key-filetopens--typetluksis,Error while opening LUKS container on %s: %s(RR$RRR(RRR2R+R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt run_luks_opens cC`sB|j|jd|gƒ}|tdkr>td|ƒ‚ndS(Ntcloseis%Error while closing LUKS container %s(RR$RR(RR+R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytrun_luks_close scC`s‰|jjdtƒ}|j|ƒ}|dk r@|j|ƒn|j|d|gƒ}|tdkr…td||t fƒ‚ndS(Ntwipefss--allis(Error while wiping luks container %s: %s( R R R R,R)R8RRRR(RRt wipefs_binR+R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytrun_luks_removes cC`sU|j|jd||d|gƒ}|tdkrQtd||tfƒ‚ndS(s} Add new key to given 'device'; authentication done using 'keyfile' Raises ValueError when command fails t luksAddKeys --key-fileis)Error while adding new LUKS key to %s: %sN(RR$RRR(RRR2t new_keyfileR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytrun_luks_add_keys c C`s||s'|j|jd|gƒ}|tdkrGtd|fƒ‚nd}t}tjdƒ}x™|tjƒD]‡}|j dƒr‘t }qs|j dƒrÆ|rú|ddkrú|d 7}qúqs|j d ƒrØqs|j |ƒrô|d 7}qst}qsW|dkr'|j j d d |ƒq'n|j|jd |dd|gƒ}|tdkrxtd||tfƒ‚ndS(sW Remove key from given device Raises ValueError when command fails tluksDumpis'Error while dumping LUKS header from %ss^Key Slot [0-9]+: ENABLEDs Keyslots:s it 0123456789is tmsgszLUKS device %s has less than two active keyslots. To be able to remove a key, please set `force_remove_last_key` to `yes`.t luksRemoveKeys-qs --key-files)Error while removing LUKS key from %s: %sN(RR$RRtFalsetretcompileRt splitlinest startswithR tmatchR t fail_jsonR( RRR2tforce_remove_last_keyRt keyslot_countt keyslot_areat keyslot_retline((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytrun_luks_remove_key%s6    ( RR RR,R.R0R3R6R8R;R>RCRO(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyR!Ðs        tConditionsHandlercB`sPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(cC`s#tt|ƒj|ƒ||_dS(N(R#RPRt _crypthandler(RRt crypthandler((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyRPscC`s]|jjddk o\|jjddk o\|jjddko\|jj|jjdƒ S(NRR2tstatetpresenttopenedtclosed(RTRUsclosed(R tparamsR)RQR0(R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt luks_createTs   cC`s”|jjddkrdS|jj|jjdƒ}|dkrFdS|jjddkr`|S||jjdkr|jjdd|ƒn|S(s· If luks is already opened, return its name. If 'name' parameter is specified and differs from obtained value, fail. Return None otherwise RSRURR+RAs;LUKS container is already opened under different name '%s'.N(R RWR)RQR,RI(RR+((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytopened_luks_name\s   cC`sf|jjddksB|jjddksB|jjddkrFtS|jƒ}|dkrbtStS(NRR2RSRU(R RWR)RCRYR (RR+((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt luks_openzs  cC`sÌ|jjddkr,|jjddksB|jjddkrFtS|jjddk r‡|jj|jjdƒ}|dk }n|jjddk rÈ|jj|jjdƒ}|dk }n|S(NR+RRSRV(R RWR)RCRQR,R.(RR+t luks_is_openR((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt luks_close‡s  cC`sv|jjddksB|jjddksB|jjddkrFtS|jjddkrr|jjddƒntS(NRR2R=RStabsentRAs;Contradiction in setup: Asking to add a key to absent LUKS.(R RWR)RCRIR (R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt luks_add_keyœscC`s`|jjddks,|jjddkr0tS|jjddkr\|jjddƒntS(NRtremove_keyfileRSR]RAs@Contradiction in setup: Asking to remove a key from absent LUKS.(R RWR)RCRIR (R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytluks_remove_key©s cC`sF|jjddk oE|jjddkoE|jj|jjdƒS(NRRSR](R RWR)RQR0(R((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt luks_removeµs( RR RRXRYRZR\R^R`Ra(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyRPNs     c C`s»tdtddddddddd gƒd tddƒd tddƒd tdd ƒdtdd ƒdtdd ƒdtdddtƒƒ}tdtd dƒ}td|dtƒ}|jd dk r^ybtj|jd ƒ}|j}tj |ƒ r.tj |ƒ r.t dj |jd ƒƒ‚nWq^t k rZ}|j dt|ƒƒq^Xnt|ƒ}t||ƒ}|jƒr|jsÝy"|j|jd |jd ƒWqÝtk rÙ}|j dd|ƒqÝXnt|d<|jr|j|qn|jƒ}|dk r(||d R`RORaR;( t module_argsRRtstatinfotmodetetcryptt conditionsR+((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyt run_module»sÌ'     #                                    cC`s tƒdS(N(R{(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pytmain@st__main__(t __future__RRRRbt __metaclass__tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLEStRETURNRlRDRmtansible.module_utils.basicRRRRRER%R-tobjectR R!RPR{R|R(((sF/usr/lib/python2.7/site-packages/ansible/modules/crypto/luks_device.pyts.   `2    ~m …