2017-08-15 05:13:14 +00:00
|
|
|
#!/usr/bin/python
|
2018-02-25 02:09:54 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-08-15 05:13:14 +00:00
|
|
|
|
2018-07-17 21:29:05 +00:00
|
|
|
# Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
|
2017-08-15 05:13:14 +00:00
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
2017-08-16 03:16:38 +00:00
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
2017-08-15 05:13:14 +00:00
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'community'}
|
|
|
|
|
|
|
|
DOCUMENTATION = r'''
|
|
|
|
---
|
|
|
|
module: win_eventlog_entry
|
|
|
|
version_added: "2.4"
|
|
|
|
short_description: Write entries to Windows event logs
|
|
|
|
description:
|
|
|
|
- Write log entries to a given event log from a specified source.
|
|
|
|
options:
|
|
|
|
log:
|
|
|
|
description:
|
|
|
|
- Name of the event log to write an entry to.
|
2019-03-06 19:22:58 +00:00
|
|
|
type: str
|
2018-02-25 02:09:54 +00:00
|
|
|
required: yes
|
2017-08-15 05:13:14 +00:00
|
|
|
source:
|
|
|
|
description:
|
|
|
|
- Name of the log source to indicate where the entry is from.
|
2019-03-06 19:22:58 +00:00
|
|
|
type: str
|
2018-02-25 02:09:54 +00:00
|
|
|
required: yes
|
2017-08-15 05:13:14 +00:00
|
|
|
event_id:
|
|
|
|
description:
|
|
|
|
- The numeric event identifier for the entry.
|
|
|
|
- Value must be between 0 and 65535.
|
2018-07-17 21:29:05 +00:00
|
|
|
type: int
|
2019-03-06 19:22:58 +00:00
|
|
|
required: yes
|
2017-08-15 05:13:14 +00:00
|
|
|
message:
|
|
|
|
description:
|
|
|
|
- The message for the given log entry.
|
2019-03-06 19:22:58 +00:00
|
|
|
type: str
|
2018-02-25 02:09:54 +00:00
|
|
|
required: yes
|
2017-08-15 05:13:14 +00:00
|
|
|
entry_type:
|
|
|
|
description:
|
|
|
|
- Indicates the entry being written to the log is of a specific type.
|
2019-03-06 19:22:58 +00:00
|
|
|
type: str
|
|
|
|
choices: [ Error, FailureAudit, Information, SuccessAudit, Warning ]
|
2017-08-15 05:13:14 +00:00
|
|
|
category:
|
|
|
|
description:
|
|
|
|
- A numeric task category associated with the category message file for the log source.
|
2018-07-17 21:29:05 +00:00
|
|
|
type: int
|
2017-08-15 05:13:14 +00:00
|
|
|
raw_data:
|
|
|
|
description:
|
|
|
|
- Binary data associated with the log entry.
|
|
|
|
- Value must be a comma-separated array of 8-bit unsigned integers (0 to 255).
|
2019-03-06 19:22:58 +00:00
|
|
|
type: str
|
2017-08-15 05:13:14 +00:00
|
|
|
notes:
|
|
|
|
- This module will always report a change when writing an event entry.
|
2018-12-15 02:23:59 +00:00
|
|
|
seealso:
|
|
|
|
- module: win_eventlog
|
2017-08-15 05:13:14 +00:00
|
|
|
author:
|
|
|
|
- Andrew Saraceni (@andrewsaraceni)
|
|
|
|
'''
|
|
|
|
|
|
|
|
EXAMPLES = r'''
|
|
|
|
- name: Write an entry to a Windows event log
|
|
|
|
win_eventlog_entry:
|
|
|
|
log: MyNewLog
|
|
|
|
source: NewLogSource1
|
|
|
|
event_id: 1234
|
|
|
|
message: This is a test log entry.
|
|
|
|
|
|
|
|
- name: Write another entry to a different Windows event log
|
|
|
|
win_eventlog_entry:
|
|
|
|
log: AnotherLog
|
|
|
|
source: MyAppSource
|
|
|
|
event_id: 5000
|
|
|
|
message: An error has occurred.
|
|
|
|
entry_type: Error
|
|
|
|
category: 5
|
|
|
|
raw_data: 10,20
|
|
|
|
'''
|
|
|
|
|
|
|
|
RETURN = r'''
|
|
|
|
# Default return values
|
|
|
|
'''
|