mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 04:49:09 -07:00
Add windows module for changing the hostname (#40295)
Co-authored-by: Ripon Banik <riponbanik@users.noreply.github.com>
This commit is contained in:
parent
5c39c3b2d1
commit
2f70360698
6 changed files with 155 additions and 0 deletions
48
lib/ansible/modules/windows/win_hostname.py
Normal file
48
lib/ansible/modules/windows/win_hostname.py
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/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"
|
||||
short_description: Manages local Windows computer name.
|
||||
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.
|
||||
required: true
|
||||
author:
|
||||
- Ripon Banik (@riponbanik)
|
||||
'''
|
||||
|
||||
EXAMPLES = r'''
|
||||
- name: Change the hostname to new_hostname
|
||||
win_hostname:
|
||||
name: new_hostname
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
old_name:
|
||||
description: The original hostname that was set before it was changed
|
||||
returned: always
|
||||
type: str
|
||||
sample: old_hostname
|
||||
reboot_required:
|
||||
description: Whether a reboot is required to complete the hostname change
|
||||
returned: always
|
||||
type: bool
|
||||
sample: true
|
||||
'''
|
Loading…
Add table
Add a link
Reference in a new issue