From f834f68da992d4017afcf02ccf1e910c5345b12a Mon Sep 17 00:00:00 2001 From: jowj Date: Thu, 30 May 2019 11:21:34 -0500 Subject: [PATCH 1/3] Fix bash prompt spacing issues - added many \[ \] pairs to fix spacing issues --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 3d58717..29ba93b 100644 --- a/.bashrc +++ b/.bashrc @@ -65,7 +65,7 @@ if [ -x /usr/bin/dircolors ]; then fi # this looks like garbage but its just color initation and termination -export PS1="\t \e[34mǰ \e[91m☭\e[0m " +export PS1=\["\t \e[34m\]ǰ \[\e[91m\]☭\[\e[0m"\ export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced From 044e20c27a24a5086d48d9abf7b43e5c3ed5df42 Mon Sep 17 00:00:00 2001 From: jowj Date: Thu, 30 May 2019 13:29:01 -0500 Subject: [PATCH 2/3] Fix spacing issues in bash prompt. - missed a spot previously that needed to be space escaped. --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 29ba93b..b06fa30 100644 --- a/.bashrc +++ b/.bashrc @@ -65,7 +65,7 @@ if [ -x /usr/bin/dircolors ]; then fi # this looks like garbage but its just color initation and termination -export PS1=\["\t \e[34m\]ǰ \[\e[91m\]☭\[\e[0m"\ +export PS1="\t \[\e[34m\]ǰ \[\e[91m\]☭\[\e[0m\] " export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced From 285a239730ea4865eee9610d27972d3201515150 Mon Sep 17 00:00:00 2001 From: jowj Date: Thu, 30 May 2019 17:44:17 -0500 Subject: [PATCH 3/3] Update individual deploy to match updated group deploy. --- deployments/mojobot/hosts.yml | 4 +--- deployments/mojobot/mojo.yml | 14 ++++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deployments/mojobot/hosts.yml b/deployments/mojobot/hosts.yml index 5bb0ddf..61074e0 100644 --- a/deployments/mojobot/hosts.yml +++ b/deployments/mojobot/hosts.yml @@ -3,8 +3,6 @@ all: dockerhosts: hosts: monitoring.awful.club: - vars: - ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q ansible@ssh.awful.club"' macs: hosts: hydra-ling: @@ -13,4 +11,4 @@ all: lurker-ling: linux: hosts: - ling-bane: \ No newline at end of file + ling-bane: diff --git a/deployments/mojobot/mojo.yml b/deployments/mojobot/mojo.yml index 060bb23..06813d9 100644 --- a/deployments/mojobot/mojo.yml +++ b/deployments/mojobot/mojo.yml @@ -8,16 +8,18 @@ command: hostname register: hostname - debug: msg="{{ hostname.stdout }}" - - name: print working directory - shell: ls -la | grep 'mojo' - register: ls - - debug: msg="{{ ls.stdout }}" - - name: Pull latest version from github + - name: Pull latest version from github, or log an error if the dir doesn't exist' shell: cd /home/josiah/mojojojo-bot/ && git pull + register: result + ignore_errors: True + - name: If previous step failed, clone repo down + shell: cd /home/josiah/ && git clone https://github.com/jowj/mojojojo-bot.git + when: result is failed - name: Build from the latest version shell: cd ~/mojojojo-bot && docker build -t mojo -f docker/dockerfile . - name: Check if there are any existing mojo containers running and kill it # this has to be a shell because command: isn't interactive shell: docker ps | grep 'mojo' | awk '{print $1}' | xargs docker kill + ignore_errors: True - name: Run the newly built docker container - command: docker container run -e "SLACK_BOT_TOKEN={{ VAULT_SLACK_BOT_TOKEN }}" --restart "always" -d --mount source=towervol,target=/shared/ mojo + command: docker container run -e "SLACK_BOT_TOKEN={{ VAULT_SLACK_BOT_TOKEN }}" --restart "always" -d --mount type="bind",source="/mnt/volume_sfo2_znc",target=/shared/ mojo