From 16c4a936515fb5251cbf96379a00e3b1bb409ecd Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 2 Mar 2021 06:25:24 -0600 Subject: [PATCH] More user-friendly weather function. --- tasks/general/acct_mgmt/users.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index df5a66b..711fea7 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -95,16 +95,26 @@ path_additions: export PATH="~/bin:$PATH" function_wttr: | function weather() { + if [[ "$1" == "-"* ]]; then + echo "USAGE: weather [location] + Any '-' paramaters call the usage since it does not take any options. + Useful location types: + zip_code + city,state + @domain.com + Full documentation: https://github.com/chubin/wttr.in" + return + fi curl https://wttr.in/$1 } - name: General | Account Management | Users | Files | Common Variable set_fact: rc_common: | + {{ path_additions }} {{ alias_cp }} {{ alias_mv }} {{ alias_rm }} - {{ path_additions }} {{ function_wttr }} - name: General | Account Management | Users | Files | .bashrc @@ -112,7 +122,7 @@ path: "{{ item }}/.bashrc" block: | {{ rc_common }} - echo "`date` - Set .bashrc preferences." + echo "`date` - Ansible .bashrc preferences loaded successfully!" marker: '# {mark} MANAGED BY ANSIBLE | Aliases' state: present create: yes @@ -128,7 +138,7 @@ path: "{{ item }}/.zshrc" block: | {{ rc_common }} - echo "`date` - Set .zshrc preferences." + echo "`date` - Ansible .zshrc preferences loaded successfully!" marker: '# {mark} MANAGED BY ANSIBLE | Aliases' state: present create: yes