Skip to content

Instantly share code, notes, and snippets.

@daveneeley
Created June 3, 2015 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveneeley/c9aeeb8b28a0e608d54f to your computer and use it in GitHub Desktop.
Save daveneeley/c9aeeb8b28a0e608d54f to your computer and use it in GitHub Desktop.
Setting up a configuration profile for smtp
$ salt 'minion' smtp.send_msg 'user2@myserver.com' 'test message' profile='my_smtp_profile'
minion:
The minion function caused an exception: Traceback (most recent call last):
File "C:\salt\bin\lib\site-packages\salt\minion.py", line 1142, in _thread_return
return_data = func(*args, **kwargs)
File "C:\salt\bin\lib\site-packages\salt\modules\smtp.py", line 93, in send_msg
server = creds.get('smtp.server')
AttributeError: 'str' object has no attribute 'get'
$ salt 'minion' config.option my_smtp_profile -l all
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/smtp.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/smtp.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: salt
[DEBUG ] Missing configuration file: ~/.saltrc
[TRACE ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.
[DEBUG ] Configuration file path: /etc/salt/master
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/smtp.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/smtp.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: salt
[DEBUG ] Missing configuration file: ~/.saltrc
[DEBUG ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event - data = {'_stamp': '2015-06-03T18:43:31.280535'}
[TRACE ] get_event() received = {'tag': 'salt/event/new_client', 'data': {'_stamp': '2015-06-03T18:43:31.280535'}}
[TRACE ] func get_cli_event_returns()
[DEBUG ] LazyLoaded local_cache.get_load
[DEBUG ] get_iter_returns for jid 20150603124331297817 sent to set(['minion']) will timeout at 12:43:36.303129
[DEBUG ] jid 20150603124331297817 return from dneeley-wks
[DEBUG ] LazyLoaded nested.output
[TRACE ] data = {'minion': ''}
minion:
[DEBUG ] jid 20150603124331297817 found all minions set(['minion'])
{# located at /etc/salt/master.d/smtp.conf #}
{# configuration profile, as defined at http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.smtp.html #}
my_smtp_profile:
smtp.server: myserver.com
smtp.tls: false
smtp.sender: sender@myserver.com
smtp.username: user
smtp.password: verybadpass
@smarletta
Copy link

Did you get fixed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment