ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
206 stars 161 forks source link

Various improvements / bugfixes around disks management #450

Closed gillg closed 1 year ago

gillg commented 2 years ago
SUMMARY

This PR group several changes around disks management :

Other module proposition

I also created a module win_disk_mount, I could share it but I don't have time to write any tests, make a perfect doc, examples, etc, so if you are interested someone should contribute a little bit. This is the minimal doc to understand it :

module: win_disk_mount
short_description: Mount a partition to a letter or folder
description:
    - Mount a partition to a letter or folder
options:
    disk_number:
        description:
            - Disk number where the partition is (partition_number mandatory)
        required: false
        type: int
    partition_number:
        description:
            - Partition number to mount (disk_number mandatory)
        required: false
        type: int
    partition_id:
        description:
          -  Partition unique ID to select
        required: false
        type: str
    path:
        description:
          -  Partition unique path to select
        required: false
        type: str
    state:
        description:
          -  Add or remove the mount point
        required: false
        type: str
        default: 'present'
    force_assign_letter:
        description:
          -  Force to attach a letter in addition to the folder mount path.
        required: false
        type: bool
        default: 'no'
    mount_path:
        description:
          -  Path to mount the volume. If not defined, will use the next available drive letter.
        required: false
        type: str

Minimal examples :

    - name: Mount partition in D drive
      win_disk_mount:
        disk_number: 1
        partition_number: 1
        mount_path: "D:"

    - name: Mount partition in a folder (junction)
      win_disk_mount:
        disk_number: 1
        partition_number: 1
        mount_path: C:/mydata

    - name: Mount partition in the nex available drive letter
       win_disk_mount:
        disk_number: 1
        partition_number: 1

Let me know !

github-actions[bot] commented 2 years ago

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run: https://github.com/ansible-collections/community.windows/actions/runs/3367498206

You can compare to the docs for the main branch here: https://ansible-collections.github.io/community.windows/branch/main

File changes:

  • M collections/community/windows/win_format_module.html
  • M collections/community/windows/win_partition_module.html
Click to see the diff comparison. **NOTE:** only file modifications are shown here. New and deleted files are excluded. See the file list and check the published docs to see those files. ```diff diff --git a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_format_module.html b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_format_module.html index 3d6f571..c601b84 100644 --- a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_format_module.html +++ b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_format_module.html @@ -262,6 +262,13 @@
+

partition_id

+

string

+
+

Partition unique ID to select it.

+
+ +

path

string

diff --git a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_partition_module.html b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_partition_module.html index 4a2df89..40e43b7 100644 --- a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_partition_module.html +++ b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_partition_module.html @@ -136,6 +136,7 @@
  • Parameters

  • Notes

  • Examples

  • +
  • Return Values

  • @@ -317,6 +318,28 @@ state: absent +
    +
    +

    Return Values

    +

    Common return values are documented here, the following are the fields unique to this module:

    + + + + + + + + + + + +

    Key

    Description

    +

    unique_id

    +

    string

    +

    True Partition Unique identifier.

    +

    Returned: success

    +

    Sample: "False"

    +

    Authors