From 043dc3e40eeee0060d3989c63b22182994db86c1 Mon Sep 17 00:00:00 2001 From: Dylan DiGeronimo Date: Tue, 21 Apr 2020 03:06:14 -0400 Subject: [PATCH] update-frontend-prod now works whether the app is already running or not --- README.md | 7 +++---- update-frontend-prod.yml | 9 ++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9e6046b..01a3c93 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ $ ansible-playbook -i hosts refresh-frontend-cert.yml --key-file="/path/to/key/o ``` ### TODO -1. Fix error in update-frontend-prod where playbook fails if Flask app isn't already running -2. Complete setup-frontend-prod.yml -3. Automate installation of Python 3.7 and pip3 -4. Setup Ansible Vault to handle keys \ No newline at end of file +1. Complete setup-frontend-prod.yml +2. Automate installation of Python 3.7 and pip3 +3. Setup Ansible Vault to handle keys \ No newline at end of file diff --git a/update-frontend-prod.yml b/update-frontend-prod.yml index 96242f9..3dc482e 100644 --- a/update-frontend-prod.yml +++ b/update-frontend-prod.yml @@ -1,14 +1,9 @@ - hosts: cce_frontend_prod tasks: - - name: Check if app is running - shell: "ps -few | grep 'flask run' | wc -l" - register: num_matches - - # TODO: This command ignores the conditional - - name: Bring down current instance if running + - name: Bring down the app if it is running (ignore error msg) command: "killall flask" - when: num_matches.stdout != "1" + ignore_errors: true - name: Pull from GitHub git: