Skip to content

Commit

Permalink
Merge pull request #160 from omaciel/setup-email-notification
Browse files Browse the repository at this point in the history
Task to configure system for email notification.
  • Loading branch information
elyezer committed Mar 17, 2015
2 parents d1f7047 + 8e6e8dc commit f8582bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions automation_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,23 @@ def setup_default_capsule(interface=None):
)


def setup_email_notification(smtp=None):
"""Configures system to handle email notification.
NOTE: this task needs a 'katello-service restart', so choose wisely when to
call it, preferably before another task that restarts the stack, such as
the 'setup_default_capsule' task.
:param str smtp: A valid URL to a SMTP server.
"""

# edit the config file
if smtp is not None:
run('sed -i -e "s|address.*|address: {0}|" '
'/etc/foreman/email.yaml'.format(smtp))


def setup_fake_manifest_certificate(certificate_url=None):
"""Task to setup a fake manifest certificate
Expand Down
1 change: 1 addition & 0 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
setup_ddns,
setup_default_capsule,
setup_default_docker,
setup_email_notification,
setup_fake_manifest_certificate,
setup_firewall,
setup_proxy,
Expand Down

0 comments on commit f8582bf

Please sign in to comment.