mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.8 KiB
Python
59 lines
1.8 KiB
Python
12 years ago
|
#!/usr/bin/python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
# Copyright 2012 Dag Wieers <dag@wieers.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: debug
|
||
|
short_description: Print statements during execution
|
||
|
description:
|
||
|
- This module prints statements during execution and can be useful
|
||
|
for debugging variables or expressions without necessarily halting
|
||
11 years ago
|
the playbook. Useful for debugging together with the 'when:' directive.
|
||
12 years ago
|
|
||
|
version_added: "0.8"
|
||
|
options:
|
||
|
msg:
|
||
|
description:
|
||
12 years ago
|
- The customized message that is printed. If omitted, prints a generic
|
||
12 years ago
|
message.
|
||
|
required: false
|
||
|
default: "Hello world!"
|
||
11 years ago
|
var:
|
||
|
description:
|
||
|
- A variable name to debug. Mutually exclusive with the 'msg' option.
|
||
|
author: Dag Wieers, Michael DeHaan
|
||
12 years ago
|
'''
|
||
12 years ago
|
|
||
|
EXAMPLES = '''
|
||
|
# Example that prints the loopback address and gateway for each host
|
||
11 years ago
|
- debug: msg="System {{ inventory_hostname }} has uuid {{ ansible_product_uuid }}"
|
||
12 years ago
|
|
||
11 years ago
|
- debug: msg="System {{ inventory_hostname }} has gateway {{ ansible_default_ipv4.gateway }}"
|
||
|
when: ansible_default_ipv4.gateway is defined
|
||
11 years ago
|
|
||
|
- shell: /usr/bin/uptime
|
||
|
register: result
|
||
11 years ago
|
|
||
11 years ago
|
- debug: var=result
|
||
|
|
||
11 years ago
|
- name: Display all variables/facts known for a host
|
||
|
debug: var=hostvars[inventory_hostname]
|
||
12 years ago
|
'''
|