Add a 'warn' ansible module
This module simply adds the provided string to the `warnings` ansible output. Change-Id: Ia0046b284228a5da7257921bc5446266c4c3c0d8
This commit is contained in:
parent
6b928f1c15
commit
311411122b
5
releasenotes/notes/add-warn-helper-a586ba13c7e8b43b.yaml
Normal file
5
releasenotes/notes/add-warn-helper-a586ba13c7e8b43b.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Add a new `warn` ansible module that simply adds a string to the 'warnings'
|
||||
ansible output.
|
32
validations/library/warn.py
Normal file
32
validations/library/warn.py
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2017 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ansible.module_utils.basic import * # noqa
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(argument_spec=dict(
|
||||
msg=dict(required=True, type='str'),
|
||||
))
|
||||
|
||||
msg = module.params.get('msg')
|
||||
|
||||
module.exit_json(changed=False,
|
||||
warnings=[msg])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
x
Reference in New Issue
Block a user