2018-05-17 01:41:37 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# this is a windows documentation stub. actual code lives in the .ps1
|
|
|
|
# file of the same name
|
|
|
|
|
|
|
|
# Copyright: (c) 2018, Ripon Banik (@riponbanik)
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'community'}
|
|
|
|
|
|
|
|
DOCUMENTATION = r'''
|
|
|
|
module: win_hostname
|
|
|
|
version_added: "2.6"
|
2019-01-03 16:50:44 +00:00
|
|
|
short_description: Manages local Windows computer name
|
2018-05-17 01:41:37 +00:00
|
|
|
description:
|
|
|
|
- Manages local Windows computer name.
|
|
|
|
- A reboot is required for the computer name to take effect.
|
|
|
|
options:
|
|
|
|
name:
|
|
|
|
description:
|
|
|
|
- The hostname to set for the computer.
|
2019-01-03 16:50:44 +00:00
|
|
|
type: str
|
2018-05-17 01:41:37 +00:00
|
|
|
required: true
|
2018-12-15 02:23:59 +00:00
|
|
|
seealso:
|
|
|
|
- module: win_dns_client
|
2018-05-17 01:41:37 +00:00
|
|
|
author:
|
|
|
|
- Ripon Banik (@riponbanik)
|
|
|
|
'''
|
|
|
|
|
|
|
|
EXAMPLES = r'''
|
2018-08-07 20:30:46 +00:00
|
|
|
- name: Change the hostname to sample-hostname
|
2018-05-17 01:41:37 +00:00
|
|
|
win_hostname:
|
2018-08-07 20:30:46 +00:00
|
|
|
name: sample-hostname
|
|
|
|
register: res
|
|
|
|
|
|
|
|
- name: Reboot
|
|
|
|
win_reboot:
|
|
|
|
when: res.reboot_required
|
2018-05-17 01:41:37 +00:00
|
|
|
'''
|
|
|
|
|
|
|
|
RETURN = r'''
|
|
|
|
old_name:
|
2019-01-03 16:50:44 +00:00
|
|
|
description: The original hostname that was set before it was changed.
|
2018-05-17 01:41:37 +00:00
|
|
|
returned: always
|
|
|
|
type: str
|
|
|
|
sample: old_hostname
|
|
|
|
reboot_required:
|
2019-01-03 16:50:44 +00:00
|
|
|
description: Whether a reboot is required to complete the hostname change.
|
2018-05-17 01:41:37 +00:00
|
|
|
returned: always
|
|
|
|
type: bool
|
|
|
|
sample: true
|
|
|
|
'''
|