Created
November 10, 2014 16:20
-
-
Save itxx00/613595fd0e8f76cb2285 to your computer and use it in GitHub Desktop.
ansible hello world module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# (c) 2014, itxx00 <itxx00@gmail.com> | |
# | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Ansible is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. | |
DOCUMENTATION = ''' | |
--- | |
module: hello | |
version_added: 1.8 | |
short_description: Just a hello world. | |
description: | |
- An example module | |
options: {} | |
author: itxx00 | |
''' | |
EXAMPLES = ''' | |
# Print a hello world from hosts | |
ansible webservers -m hello | |
''' | |
def main(): | |
module = AnsibleModule( | |
argument_spec = {}, | |
supports_check_mode = False | |
) | |
result = dict(hello='world') | |
module.exit_json(**result) | |
from ansible.module_utils.basic import * | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment