Module Expr Str Import alias Assign NameStore Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num For NameStore NameLoad body AugAssignAdd NameStore Call NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call NameLoad BinOpMult BinOpDiv Call NameLoad AttributeLoad NameLoad attr NameLoad BinOpDiv NameLoad Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AugAssignSub NameStore BinOpMult NameLoad AttributeLoad NameLoad attr AugAssignSub NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Assign NameStore NameLoad If BoolOpAnd NameLoad CompareGt Call NameLoad AttributeLoad NameLoad attr Num UnaryOpNot NameLoad body Print Str NameLoad Return Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num For NameStore NameLoad body For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr AugAssignAdd NameStore AttributeLoad NameLoad attr AugAssignAdd NameStore Num TryExcept body If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr body Pass Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad For NameStore NameLoad body If UnaryOpNot CompareIn Str NameLoad body AugAssignAdd NameStore Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Dict Str Str Str Str Num BinOpLShift Num Num BinOpLShift Num Num BinOpLShift Num Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Num orelse Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad Call NameLoad BinOpMult NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Dict Str Str NameLoad BinOpMult Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad keyword Call NameLoad keyword Call NameLoad keyword NameLoad keyword Str keyword Call NameLoad keyword NameLoad keyword Str keyword Str keyword Call NameLoad keyword NameLoad keyword Str keyword NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore ListLoad Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr Str body TryExcept body AugAssignAdd NameStore Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call NameLoad NameLoad Raise AugAssignAdd NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword CompareGt NameLoad Num keyword Dict Str NameLoad decorator_list ImportFrom alias Expr Call NameLoad
N/A N/A 
Ansible module for partitioning.
 N/A parted N/A DOCUMENTATION 
---
module: partitionpool
short_description; Partition a disk into parititions.
description:
  - Creates partitions on given disk based on partition sizes and their weights.
    Unless 'force' option is set to True, it ignores already partitioned disks.

    When the disk is empty or 'force' is set to True, it always creates a new
    GPT partition table on the disk. Then it creates number of partitions, based
    on their weights.

    This module should be used when a system admin wants to split existing disk(s)
    into pools of partitions of specific sizes. It is not intended as generic disk
    partitioning module!

    Independent on 'force' parameter value and actual disk state, the task
    always fills 'partition_pool' fact with all partitions on given disks,
    together with their sizes (in bytes). E.g.:
    partition_sizes = [
        { name: sda1, Size: 1048576000 },
        { name: sda2, Size: 1048576000 },
        { name: sdb1, Size: 1048576000 },
        ...
    ]

options:
  disk:
    description:
      - Disk to partition.
  size:
    description:
      - Sizes of partitions to create and their weights. Has form of:
        <size1>[:<weigth1>][,<size2>[:<weight2>][,...]]
      - Any <size> can end with 'm' or 'M' for megabyte, 'g/G' for gigabyte
        and 't/T' for terabyte. Megabyte is used when no unit is specified.
      - If <weight> is missing, 1.0 is used.
      - From each specified partition <sizeX>, number of these partitions are
        created so they occupy spaces represented by <weightX>, proportionally to
        other weights.

      - Example 1: size=100G says, that the whole disk is split in number of 100 GiB
        partitions. On 1 TiB disk, 10 partitions will be created.

      - Example 2: size=100G:1,10G:1 says that ratio of space occupied by 100 GiB
        partitions and 10 GiB partitions is 1:1. Therefore, on 1 TiB disk, 500 GiB 
        will be split into five 100 GiB partition and 500 GiB will be split into fifty
        10GiB partitions.
      - size=100G:1,10G:1 = 5x 100 GiB and 50x 10 GiB partitions (on 1 TiB disk).

      - Example 3: size=200G:1,100G:2 says that the ratio of space occupied by 200 GiB
        partitions and 100GiB partition is 1:2. Therefore, on 1 TiB disk, 1/3
        (300 GiB) should be occupied by 200 GiB partitions. Only one fits there,
        so only one is created (we always round nr. of partitions *down*). Teh rest
        (800 GiB) is split into eight 100 GiB partitions, even though it's more
        than 2/3 of total space - free space is always allocated as much as possible.
      - size=200G:1,100G:2 = 1x 200 GiB and 8x 100 GiB partitions (on 1 TiB disk).

      - Example: size=200G:1,100G:1,50G:1 says that the ratio of space occupied by
        200 GiB, 100 GiB and 50 GiB partitions is 1:1:1. Therefore 1/3 of 1 TiB disk
        is dedicated to 200 GiB partitions. Only one fits there and only one is
        created. The rest (800 GiB) is distributed according to remaining weights:
        100 GiB vs 50 GiB is 1:1, we create four 100 GiB partitions (400 GiB in total)
        and eight 50 GiB partitions (again, 400 GiB).
      - size=200G:1,100G:1,50G:1 = 1x 200 GiB, 4x 100 GiB and 8x 50 GiB partitions
        (on 1 TiB disk).
        
  force:
    description:
      - If True, it will always overwite partition table on the disk and create new one.
      - If False (default), it won't change existing partition tables.

 PartitionSpec N/A object N/A N/A  Simple class to represent required partitions. __init__ N/A N/A self size weight N/A N/A N/A  Initialize the partition specifications. N/A N/A self size size N/A N/A self weight weight N/A N/A self count -1 N/A set_count N/A N/A self count N/A N/A N/A  Set count of parititions of this specification.  N/A N/A self count count N/A N/A assign_space N/A N/A total_size specs N/A N/A N/A 
    Satisfy all the PartitionSpecs according to their weight.
    In other words, calculate spec.count of all the specs.
     N/A total_weight 0.0 N/A spec specs N/A N/A total_weight N/A float N/A spec weight N/A spec specs N/A N/A num_blocks N/A int N/A N/A N/A float N/A spec weight total_weight N/A total_size N/A float N/A spec size N/A N/A N/A spec set_count num_blocks N/A total_size N/A num_blocks N/A spec size N/A total_weight N/A spec weight N/A partition N/A N/A diskname specs force check_mode N/A False False N/A N/A 
    Create requested partitions.
    Returns nr. of created partitions or 0 when the disk was already partitioned.
     N/A count 0 N/A dev N/A N/A parted getDevice diskname N/A N/A N/A disk N/A N/A parted newDisk dev N/A N/A N/A N/A parted DiskException N/A N/A disk None N/A N/A disk N/A N/A len N/A disk partitions 0 N/A force N/A N/A skipping diskname N/A 0 N/A disk N/A N/A parted freshDisk dev gpt N/A N/A assign_space N/A N/A dev getSize specs N/A last_megabyte 1 N/A spec specs N/A N/A _ N/A range N/A spec count N/A N/A start N/A N/A parted sizeToSectors last_megabyte MiB N/A dev sectorSize N/A length N/A N/A parted sizeToSectors N/A spec size MiB N/A dev sectorSize N/A geo N/A N/A parted Geometry device dev start start length length N/A filesystem N/A N/A parted FileSystem type ext4 geometry geo N/A part N/A N/A parted Partition disk disk type N/A parted PARTITION_NORMAL fs filesystem geometry geo N/A N/A N/A disk addPartition partition part constraint N/A dev optimalAlignedConstraint N/A last_megabyte N/A spec size N/A count 1 N/A N/A N/A N/A check_mode N/A N/A N/A N/A disk commit N/A N/A N/A N/A parted IOException N/A N/A N/A count N/A parse_spec N/A N/A text N/A N/A N/A  Parse string with partition specification.  N/A tokens N/A N/A text split , N/A specs N/A N/A token tokens N/A N/A N/A N/A : token N/A N/A token :1 N/A N/A sizespec weight N/A N/A token split : N/A weight N/A float weight N/A units N/A m g t p 1 N/A 1 10 N/A 1 20 N/A 1 30 N/A unit N/A N/A units get N/A N/A N/A sizespec N/A -1 lower None N/A N/A unit N/A N/A size N/A float sizespec N/A unit 1 N/A N/A size N/A float N/A sizespec N/A -1 N/A spec N/A PartitionSpec N/A int N/A size unit weight N/A N/A N/A specs append spec N/A specs N/A get_partitions N/A N/A diskpath N/A N/A N/A  Return array of partition names for given disk  N/A dev N/A N/A parted getDevice diskpath N/A disk N/A N/A parted newDisk dev N/A partitions N/A N/A part N/A disk partitions N/A N/A N/A _ _ pname N/A N/A N/A part path rsplit / N/A N/A N/A partitions append N/A name size pname N/A N/A N/A part getLength N/A dev sectorSize N/A partitions N/A main N/A N/A N/A N/A N/A  Ansible module main method.  N/A module N/A AnsibleModule argument_spec N/A dict disks N/A dict required True type str force N/A dict required False default no type bool sizes N/A dict required True type str supports_check_mode True N/A disks N/A N/A module params N/A disks N/A force N/A N/A module params N/A force N/A N/A force None N/A N/A force False N/A sizes N/A N/A module params N/A sizes N/A N/A N/A specs N/A parse_spec sizes N/A N/A N/A ValueError N/A ex N/A N/A err N/A N/A N/A Error parsing sizes= sizes :  N/A str ex N/A N/A N/A module fail_json msg err N/A partitions N/A N/A changed_count 0 N/A disk N/A N/A disks split , N/A N/A N/A N/A changed_count N/A partition disk specs force N/A module check_mode N/A N/A N/A Exception N/A ex N/A N/A err N/A N/A N/A Error creating partitions on  disk :  N/A str ex N/A N/A partitions N/A get_partitions disk N/A N/A N/A module exit_json changed N/A changed_count 0 ansible_facts N/A partition_pool partitions N/A ansible.module_utils.basic * N/A N/A main