Skip to content

informatique-cdc/ansible-role-win_wins

Repository files navigation

win_wins - Manipulate the WINS settings specific to TCP/IP

Synopsis

  • This Ansible module allows to change the WINS settings specific to TCP/IP.

Parameters

Parameter Choices/Defaults Comments
enable_dns
boolean
Choices:
  • no
  • yes
Specifies whether the Domain Name System (DNS) is enabled for name resolution over WINS resolution.
If this value is set to true, NBT queries the DNS for names that cannot be resolved by WINS, broadcast, or the LMHOSTS file.
enable_lmhosts_lookup
boolean
Choices:
  • no
  • yes
Specifies whether local lookup files are used. Lookup files will contain mappings of IP addresses to host names.
If this value is set to true, NBT searches the LMHOSTS file, if it exists, for names that cannot be resolved by WINS or broadcast.
By default, there is no LMHOSTS file database directory. Therefore, NBT takes no action.
scope_id
string
Specifies the Scope ID value that will be appended to the end of the computer’s NetBIOS name. Systems using the same Scope ID can communicate with this computer.
The value must not start with a period.
If this option contains a valid value, it will override the DHCP parameter of the same name.
A blank value (empty string) will be ignored.
The valid range is any valid DNS domain name consisting of two dot-separated parts, or a *.
Setting this option to the value * indicates a null scope and will override the DHCP parameter.
adapter_names
list
Specifies the list of adapter names for which to set the primary or secondary Windows Internet Naming Service (WINS) servers.
Used only if primary_server or secondary_server are specified.
If this option is omitted then configuration is applied to all adapters on the system.
The adapter name used is the connection caption in the Network Control Panel or via Get-NetAdapter, eg Ethernet 2.
primary_server
string
Specifies the dotted decimal IP address of the primary WINS server (for example,11.101.1.200).
If the adapter_names option is omitted then configuration is applied to all adapters on the system.
If this option contains a valid value, it overrides the DHCP parameter of the same name.
secondary_server
string
Specifies the dotted decimal IP address of the secondary WINS server (for example,11.101.1.200).
If the adapter_names option is omitted then configuration is applied to all adapters on the system.
If this option contains a valid value, it overrides the DHCP parameter of the same name.

Examples

---
- name: test the win_server_manager module
  hosts: all
  gather_facts: false

  roles:
    - win_wins

  tasks:
    - name: Disable DNS for name resolution over WINS for all adapters
      win_wins:
        enable_dns: false

    - name: Disable LMHOSTS lookup for all adapters
      win_wins:
        enable_lmhosts_lookup: false

    - name: Append test.local to the end of the computer's NetBIOS name for all adapters
      win_wins:
        scope_id: test.local

    - name: Set the IP address of the primary WINS server on Ethernet2
      win_wins:
        primary_server: 192.168.1.40
        adapter_names:
          - Ethernet2

    - name: Set the IP address of the primary WINS server on Public and Backup adapters
      win_wins:
        secondary_server: 192.168.1.50
        adapter_names:
          - Public
          - Backup

    - name: Set the WINS servers on all adapters
      win_wins:
        primary_server: 192.168.1.40
        secondary_server: 192.168.1.50

Return Values

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

Key Returned Description
reboot_required
boolean
always Boolean value stating whether a system reboot is required.

Sample:
True
config
dictionary
always Detailed information about WINS.
        enable_dns
        boolean
always Indicates whether the Domain Name System (DNS) is enabled for name resolution over WINS resolution for all network adapters with TCP/IP enabled.

Sample:
True
        enable_lmhosts_lookup
        boolean
always Indicates whether LMHOSTS lookup should be enabled for all network adapters with TCP/IP enabled.

Sample:
True
        scope_id
        string
always The scope identifier value that will be appended to the end of the computer's NetBIOS name for all network adapters with TCP/IP enabled.

Sample:
test.local
        adapters
        dictionary
Detailed information about WINS settings on network adapters.
                name
                dictionary
The adapter name

Sample:
Ethernet2
                        interface_index
                        integer
The Index value that uniquely identifies a local network interface.
The value of this property is the same as the value that represents the network interface in the route table.

Sample:
12
                        primary_server
                        string
The IP address of the primary WINS server.

Sample:
192.168.1.40
                        secondary_server
                        string
The IP address of the secondary WINS server.

Sample:
192.168.1.50

Notes

  • Changing WINS settings does not usually require a reboot and will take effect immediately.

Authors

  • Stéphane Bilqué (@sbilque) Informatique CDC

License

This project is licensed under the Apache 2.0 License.

See LICENSE to see the full text.

About

This Ansible module allows to change the WINS settings specific to TCP/IP on Windows-based systems.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published