Created
February 28, 2013 10:04
-
-
Save akvadrako/5055631 to your computer and use it in GitHub Desktop.
send a welcome message from ansible
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
import yaml | |
class FilterModule(object): | |
def filters(self): | |
return { | |
'nice_yaml': lambda *a, **kw: yaml.safe_dump(*a, indent=4, default_flow_style=False, **kw), | |
} |
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
--- | |
- hosts: ${hosts} | |
tasks: | |
- mail: to=... | |
args: | |
from: root@$ansible_fqdn | |
body: $TEMPLATE(welcome.j2) | |
subject: welcome to $ansible_fqdn |
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
Hi, I'm your new server! | |
My name is {{ ansible_fqdn }}. | |
RSA Host Key | |
------------ | |
{{ ansible_ssh_host_key_rsa_public|nice_yaml }} | |
IPv4 | |
---- | |
{{ ansible_default_ipv4|nice_yaml }} | |
IPv6 | |
---- | |
{{ ansible_default_ipv6|nice_yaml }} | |
Hardware | |
------ | |
{{ ansible_processor|nice_yaml }} | |
{{ ansible_devices|nice_yaml }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment