Add real email account for testmails. Run playbook verbose.

This commit is contained in:
Unknown 2018-05-07 17:53:56 +08:00
parent a57c2f1a10
commit 51abdd0fad
6 changed files with 20 additions and 35 deletions

View file

@ -12,7 +12,7 @@ script:
- export cleanup=false
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/chriswayg/7cf5afda283252219c37c447ccf3ad88/raw/199f22ced6dd31c948ab2fb6e647a8cd612d337e/ansible-role-test.sh
- chmod +x ${PWD}/tests/test.sh
# Run tests.

View file

@ -1,13 +0,0 @@
---
language: python
python: "2.7"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-apt python-pycurl
install:
- pip install ansible
script:
- echo localhost > inventory
- export ANSIBLE_ROLES_PATH="../"
- ansible-playbook -i inventory --syntax-check mstmp.yml
- ansible-playbook -i inventory --connection=local --sudo -vvvv mstmp.yml

View file

@ -1,13 +1,13 @@
---
msmtp_accounts:
#Account 1
- account : gmail
host : smtp.gmail.com
# Account 1 - a real account for testing
- account : yandex
host : smtp.yandex.com
port : 587
auth : "on"
from : username@gmail.com
user : username@gmail.com
password : plain-text-password1
from : emailer-tests@yandex.com
user : emailer-tests@yandex.com
password : pKiMAH7yoeTgEMTNscpV
#Account 2
- account : mysmtp
host : smtp.example
@ -17,16 +17,16 @@ msmtp_accounts:
user : myuser@example.org
password : plain-text-password2
msmtp_default_account: mysmtp
msmtp_domain : example.org
msmtp_default_account: yandex
msmtp_domain : yandex.com
## Logging (Select A) "syslog" or B) "file" logging or C) "no" log
#msmtp_log : "syslog"
msmtp_log : file
msmtp_logfile : /var/log/msmtp.log
## Aliases mail account ( only msmtp_alias_default is required the rest is optional )
msmtp_alias_default : devops@example.org
msmtp_alias_root : root@example.org
msmtp_alias_cron : cron@example.org
msmtp_alias_default : emailer.tests@yandex.com
msmtp_alias_root : emailer.tests@yandex.com
msmtp_alias_cron : emailer.tests@yandex.com
msmtp_send_test_mail: No
msmtp_send_test_mail: yes

View file

@ -4,3 +4,5 @@
shell: echo "Test mail from new/updated MSTMP at" `hostname -f` | mail root -s "Test SMTP at `hostname -f`"
tags: mail
when: msmtp_send_test_mail
async: 30
poll: 5

View file

@ -1,11 +1,6 @@
---
# tests run by travis
- hosts: all
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
changed_when: false
roles:
- role_under_test
- role: role_under_test

View file

@ -2,5 +2,6 @@
- hosts: all
remote_user: vagrant
become: true
roles:
- ../../
- role: ../../