Ansible 如何發送 notification 到 Slack?
16. Ansible 如何發送 notification 到 Slack?
slack module 是什麼?
Ansible 怎麼整合 Slack?
$ vi send_notification_to_slack.yml --- - name: Send notification to Slack hosts: localhost vars: slack_domain: 'example.slack.com' slack_token: 'xxxxxxxxxxxxxxxxxxxxxxxx' slack_channel: "@username" post_tasks: - name: send notification to slack slack: domain: "{{ slack_domain }}" token: "{{ slack_token }}" username: "ansible" channel: "{{ slack_channel }}" color: "normal" msg: "Send a notification with Ansible !" # vim: ft=yaml.ansible :
2016-12-16-ansible-slack-1.png 
2016-12-16-ansible-slack-2.png 
2016-12-16-ansible-slack-3.png 
2016-12-16-ansible-slack-4.png 
2016-12-16-ansible-slack-5.png 
2016-12-16-ansible-slack-6.png $ ansible-playbook send_notification_to_slack.yml PLAY [Send notification to Slack] ********************************** TASK [setup] ******************************************************* ok: [localhost] TASK [send notification to slack] ********************************** ok: [localhost] PLAY RECAP ********************************************************* localhost : ok=2 changed=0 unreachable=0 failed=0
2016-12-16-ansible-slack-7.png
後語
相關連結
Last updated
