mkot02.win_fs_dfs.win_dfs_namespace_folder (1.0.0) — module

Set up a DFS folder.

Authors: Marcin Kotarba (@mkot02)

preview | supported by community

Install collection

Install with ansible-galaxy collection install mkot02.win_fs_dfs:==1.0.0


Add to requirements.yml

  collections:
    - name: mkot02.win_fs_dfs
      version: 1.0.0

Description

This module creates/manages Windows DFS namespace folders.

Prior to using this module it's required to install File Server with FS-DFS-Namespace feature and create shares for namespace folders on all member servers.

For more details about DFSN see U(https://docs.microsoft.com/en-us/windows-server/storage/dfs-namespaces/dfs-overview)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create DFS folder
  win_dfs_namespace_folder:
    path: '\\domain.exmaple.com\dfs\folder'
    targets:
      - '\\dc1.domain.exmaple.com\dfs\folder'
      - '\\dc2.domain.exmaple.com\dfs\folder'
      - '\\dc3.domain.exmaple.com\dfs\folder'
    description: "DFS Folder"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove DFS folder
  win_dfs_namespace_folder:
    path: '\\domain.exmaple.com\dfs\folder'
    state: absent

Inputs

    
ttl:
    default: 1800
    description:
    - TTL interval, in seconds, for referrals. Clients store referrals to targets for
      this length of time.
    type: int

path:
    description:
    - UNC path for the folder
    required: true
    type: str

state:
    choices:
    - present
    - absent
    - online
    - offline
    default: present
    description:
    - When C(present), the folder will be created if not exists.
    - When C(absent), the folder will be removed.
    - When C(online), the folder will be created if not exists and will be put in online
      state.
    - When C(offline), the folder will be created if not exists and will be put in offline
      state.
    - When C(online)/C(offline) only state of folder will be set, not the state of targets.

targets:
    description:
    - List of UNC paths for DFS folder targets.
    - Targets which are configured in namespace folder and are not listed here, will be
      removed from namespace folder.
    - Required when C(state) is not C(absent).
    - Target hosts must be referenced by FDQN if DFSN server has not configured with C(UseFQDN)
      option (https://support.microsoft.com/de-de/help/244380/how-to-configure-dfs-to-use-fully-qualified-domain-names-in-referrals)
    type: list

description:
    description:
    - Description of DFS folder
    type: str

target_failback:
    default: false
    description:
    - Indicates whether a DFS namespace uses target failback.
    - If a client attempts to access a target on a server and that server is not available,
      the client fails over to another referral.
    - If this value is C(yes), once the first server becomes available again, the client
      fails back to the first server.
    - If this value is C(no), the DFS namespace server does not require the client to
      fail back to the preferred.
    type: bool

insite_referrals:
    default: false
    description:
    - Indicates whether a DFS namespace server provides a client only with referrals that
      are in the same site as the client.
    - If this value is C(yes), the DFS namespace server provides only in-site referrals.
    - If this value is C(no), the DFS namespace server provides in-site referrals first,
      then other referrals.
    type: bool

Outputs

msg:
  description:
  - if success: list of changes made by the module separated by semicolon
  - if failure: reason why module failed
  returned: always
  type: str

See also