Skip to content

Instantly share code, notes, and snippets.

@AlexGluck
Created October 30, 2019 13:51
Show Gist options
  • Save AlexGluck/68eb14ed2f82467381aec894162cfe3c to your computer and use it in GitHub Desktop.
Save AlexGluck/68eb14ed2f82467381aec894162cfe3c to your computer and use it in GitHub Desktop.
How to use proxy per ansible task for ansible telegram notification.
---
- name: apache
hosts: "localhost"
tasks:
- name: send a message to chat in playbook
telegram:
token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX'
chat_id: '000000'
msg: "Ansible task finished"
environment:
https_proxy: "http://CCAHIHA.antizapret.prostovpn.org:3128"
# For get proxy url from service antizapret.prostovpn.org
# curl -s -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36" https://cloudflare-ipfs.com/ipns/pacipfs2.antizapret.prostovpn.org/proxy-ssl.js | grep 'return "PROXY' | grep -oP "(\w+\.){3}\w+:\d+"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment