From 5e80ae706e1518be192c6daab1bd144165c1a248 Mon Sep 17 00:00:00 2001 From: Christina Harlow Date: Thu, 25 Apr 2019 14:56:21 -0400 Subject: [PATCH] adding run once to the database setup tasks for cluster env --- .travis.yml | 2 +- tasks/manage_airflow_variables.yml | 1 + tasks/manage_configuration.yml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a87fdd8..71638c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ deploy: - $TRAVIS_TAG.tar.gz - $TRAVIS_TAG.zip api_key: - secure: OYjEWU8XXIjqeaW/FgWKH+kEwXt5y0y1Ta3W/eWxKCK2f1G2W2rNKCuRUtzSXQbLbmIHImUgEMlm1VvB84JB2PqVE/EAOtojxFN21exNSdGlP4hihovjoWMAvnfo5SVNdBTZ6I3VoKlaeC6WpO71bZrMLyKUSPjU2Ni3JtMOCtJlGhaz89j6izMQAe2gFzPG5OoyyQrR7f/cVAQsbu9I2jEaOomsvf6yP6UvUXbVXcTUiCZkcngH1RHMVHuOSYttnYbZsawhVk2BAvQT1eZO/LQVo+j5ulcrlz4xDMyjvphjOw/0yqf7Rjk/rZn5avOcBpMyecDEkykRQHoJSnI7VES0cm0leWEFzcuGNU5KfR2m7HjjCDOTHYrlf8UKqrOISHqQoT4AFmUGEPut/GtW2RsTtrKxsj1VgTYiD/+eZXkSIU0eyR7Mhew5BEehvSWjVbrN0ZFOYxgAAZujixohOy7BG3vFSNn+A7/+QtCxiCqUyle/GrNbVw5fxpjtXRJaef4rubbuoMbYt1+BOrbnB+f1dzU8daZPvcGp/264kuEMtD69QkxtVdsypkXdRp1yTVZgY4l+psRnv4tEeG3T+pjIngbuWQMDP7tthguvsdtOrCvlLLwPt2pgcwexU58PINSEA9SLCEKk614wmsG9Y29zg8IZ+2piRxf58dZ5HnQ= + secure: QBfV53ur+n61pruhD30PD8CCp3R+M5fnl8+7J2vy7tzyspvtRMs3x9nJTihHAZ0Y4qjZ+fvQ2RsW80hONlMi+DaY+vrEqhhjZ4YHicaJV/tWzGAq4R6YjcA98OpW94R7i1LSMBh0+ncXzzLZnQeR/NzB7co1gkIXV5tKXZLQsL11Oz7cuJGGrFVdfhTXDgl+zTigno6nvyXHpSqDAoZ3p16wyp7vYtJicEkWa+YwsdYCnwuLjOg8jwrOvsUopH1UOnqRv5tOaFM01uXUIJqNU/Uy3AaaH7nD9J4pYhe9tHSSeITnsdiTa53IFVZrcVwrvZYftp9mGjCKQiZohDHvOJbQbSv2AojTRPeEYfum14+0kBYQmiRRVh5L2geEddXA7kU9waSF1GO9YvCJrEtDIfLTioxJXUxD0i5u2pq+ZJ0JV7D9WLdq54dR28tHZYXwOxe2WnwhCaax/WivFoYvtIL1FXybJcEF9d9tZCLgNUbABaLSfBrVQQ55Tx0mKqHQOccy3+E5t9PLVG6CFK2b9n5iogrnkOaz49/2cmVHYqiQwp1KYzYvCs7At9sTMv0+jlblVEikKuLSwpiyMszWpcAk8g8T236FwXxrBEHXnfuDjmrHxjK9HX91C16gTjeyu68T4XVVUbYTNsWLNEsJEnmIXrmhuy+EHoayIWrkk3w= on: repo: tulibraries/ansible-role-airflow tags: true diff --git a/tasks/manage_airflow_variables.yml b/tasks/manage_airflow_variables.yml index ae0fbbb..0dc6689 100644 --- a/tasks/manage_airflow_variables.yml +++ b/tasks/manage_airflow_variables.yml @@ -30,4 +30,5 @@ {{ airflow_virtualenv }}/bin/airflow variables --set {{ item.key }} {{ item.value }} changed_when: false no_log: True + failed_when: false with_items: "{{ airflow_variables }}" diff --git a/tasks/manage_configuration.yml b/tasks/manage_configuration.yml index d584361..7652f1e 100644 --- a/tasks/manage_configuration.yml +++ b/tasks/manage_configuration.yml @@ -65,6 +65,7 @@ become_user: "{{ airflow_user_name }}" become: true command: "{{ airflow_virtualenv }}/bin/airflow initdb" + run_once: true when: - "not airflow_config_stat.stat.exists" - "airflow_do_init_db | bool" @@ -86,6 +87,7 @@ become_user: "{{ airflow_user_name }}" become: true command: "{{ airflow_virtualenv }}/bin/airflow upgradedb" + run_once: true when: - "airflow_config_stat.stat.exists" - "airflow_do_upgrade_db | bool"