add wttr script

I've had this in ~/bin for a year or so. Might as well keep it here.
This commit is contained in:
Pig Monkey 2017-02-05 18:56:36 -08:00
parent 06a9287dc2
commit aa10a99caa
3 changed files with 7 additions and 0 deletions

View file

@ -64,6 +64,7 @@
- { role: localtime, tags: ['localtime'], when: "localtime is defined" } - { role: localtime, tags: ['localtime'], when: "localtime is defined" }
- { role: wormhole, tags: ['wormhole'] } - { role: wormhole, tags: ['wormhole'] }
- { role: bluetooth, tags: ['bluetooth'], when: "bluetooth is defined" } - { role: bluetooth, tags: ['bluetooth'], when: "bluetooth is defined" }
- { role: wttr, tags: ['wttr'] }
vars_prompt: vars_prompt:
- name: user_password - name: user_password
prompt: "Enter desired user password" prompt: "Enter desired user password"

3
roles/wttr/files/wttr.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
curl wttr.in/"${1:-$(curl http://ip-api.com/json | jq 'if (.zip | length) != 0 then .zip else .city end')}"

View file

@ -0,0 +1,3 @@
---
- name: Push wttr script
copy: src=wttr.sh dest=/usr/local/bin/wttr mode=0755