From f989ea9485e39b4122e6fa63bacd00aeb1e2266e Mon Sep 17 00:00:00 2001 From: martindemko <325073@mail.muni.cz> Date: Mon, 29 Jan 2024 16:26:42 +0100 Subject: [PATCH] fixes Galaxy DB restore tasks with latest version, adds testing_pbs local tool to Galaxy server --- galaxy.yml | 58 +++++++++++++++++++++------------ group_vars/galaxyservers.yml | 1 + group_vars/secret.yml | 62 ++++++++++++++++++------------------ 3 files changed, 69 insertions(+), 52 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 7669f96..64a5d01 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -169,38 +169,54 @@ become: true become_user: postgres tags: gal_db - - name: Restore Galaxy DB backup - pick the latest backup version - ansible.builtin.shell: - cmd: "ls -dt {{ postgresql_backup_dir }}/20*Z | head -1 " - register: galaxy_db_restore_dir_latest - ignore_errors: true - when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_version == 'latest' - become: true - become_user: postgres - tags: gal_db - - name: Restore Galaxy DB backup - pick the user-defined backup version + + - name: Restore Galaxy DB backup - pick proper backup version ansible.builtin.shell: - cmd: "ls -d {{ postgresql_backup_dir }}/{{ galaxy_db_restore_version }} " + cmd: "if [ '{{ galaxy_db_restore_version }}' = 'latest' ]; then ls -dt {{ postgresql_backup_dir }}/20*Z | head -1; else ls -d {{ postgresql_backup_dir }}/{{ galaxy_db_restore_version }}; fi " register: galaxy_db_restore_dir - ignore_errors: true - when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_version != 'latest' - become: true - become_user: postgres - tags: gal_db - - name: Restore Galaxy DB backup - copy latest backup version - ansible.builtin.shell: - cmd: "rsync -a {{ galaxy_db_restore_dir_latest.stdout }}/ {{ psql_data_dir.stdout }}/ && chmod -R 0750 {{ psql_data_dir.stdout }} " - when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_dir_latest.stdout != '' and psql_data_dir.stdout != '' + when: galaxy_db_in_psql.rc == 1 become: true become_user: postgres tags: gal_db - - name: Restore Galaxy DB backup - copy user-defined backup version + - name: Restore Galaxy DB backup - copy proper backup version ansible.builtin.shell: cmd: "rsync -a {{ galaxy_db_restore_dir.stdout }}/ {{ psql_data_dir.stdout }}/ && chmod -R 0750 {{ psql_data_dir.stdout }} " when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_dir.stdout != '' and psql_data_dir.stdout != '' become: true become_user: postgres tags: gal_db +# - name: Restore Galaxy DB backup - pick the latest backup version +# ansible.builtin.shell: +# cmd: "ls -dt {{ postgresql_backup_dir }}/20*Z | head -1 " +# register: galaxy_db_restore_dir_latest +# ignore_errors: true +# when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_version == 'latest' +# become: true +# become_user: postgres +# tags: gal_db +# - name: Restore Galaxy DB backup - pick the user-defined backup version +# ansible.builtin.shell: +# cmd: "ls -d {{ postgresql_backup_dir }}/{{ galaxy_db_restore_version }} " +# register: galaxy_db_restore_dir +# ignore_errors: true +# when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_version != 'latest' +# become: true +# become_user: postgres +# tags: gal_db +# - name: Restore Galaxy DB backup - copy latest backup version +# ansible.builtin.shell: +# cmd: "rsync -a {{ galaxy_db_restore_dir_latest.stdout }}/ {{ psql_data_dir.stdout }}/ && chmod -R 0750 {{ psql_data_dir.stdout }} " +# when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_dir_latest.stdout != '' and psql_data_dir.stdout != '' +# become: true +# become_user: postgres +# tags: gal_db +# - name: Restore Galaxy DB backup - copy user-defined backup version +# ansible.builtin.shell: +# cmd: "rsync -a {{ galaxy_db_restore_dir.stdout }}/ {{ psql_data_dir.stdout }}/ && chmod -R 0750 {{ psql_data_dir.stdout }} " +# when: galaxy_db_in_psql.rc == 1 and galaxy_db_restore_dir.stdout != '' and psql_data_dir.stdout != '' +# become: true +# become_user: postgres +# tags: gal_db - name: Restore Galaxy DB backup - fill postgresql.auto.conf ansible.builtin.lineinfile: path: "{{ psql_data_dir.stdout }}/postgresql.auto.conf" diff --git a/group_vars/galaxyservers.yml b/group_vars/galaxyservers.yml index 67dc687..8872692 100644 --- a/group_vars/galaxyservers.yml +++ b/group_vars/galaxyservers.yml @@ -365,6 +365,7 @@ tpv_privsep: true galaxy_local_tools: - testing.xml - testing_html.xml +- testing_pbs.xml # Certbot certbot_auto_renew_hour: "{{ 23 |random(seed=inventory_hostname) }}" diff --git a/group_vars/secret.yml b/group_vars/secret.yml index 13b7e26..8ab40ce 100644 --- a/group_vars/secret.yml +++ b/group_vars/secret.yml @@ -1,32 +1,32 @@ $ANSIBLE_VAULT;1.1;AES256 -32623136636638393638326137643930636639353731643963383430356464343465643136313733 -6562373665383938653333323934636664646137306639620a373939316261316266326639336236 -61396238356562336465323037323866303966393361333561326434613230306662313337623761 -6462313439383034350a643338646361343930333963663265643734613631333335613634306432 -37323561623434643537383330643639353736373031303762383639353735366332653362336433 -35613966396561313431346438313564633861316464356531633135373832623538663530363736 -31636537666634646563356634323666326530363039383434303536383136313039366366346634 -66663132643135616661393637643138613936336636373339333564326561626136396563376563 -62323566613733653738613938356563313738376565616663366435613163656135646165623539 -62316535653565376333343433313165323138656136363031343566626363633135313264366564 -65363461343464363532383430373838633533386334613966663430346465333239613163666332 -34336137303033376233643736313565376135313766316536613965396532616138333634316433 -31616436613839303139333038653631306166653736623835356563383964663232666363366163 -34656561643734336332636238383037636530613531663161383834363736633162333362333831 -63353030383461336639613863383837383965376662393261623765616530636231626239393739 -65376636643230303331356635653837633639306562383833386239373235656536646563326461 -32383233356561386562643263396337343232666233623430613066646135336138353532313062 -39646238653636656337653861333165363735666231643237663138363031653861633838663066 -35633438653839633765653033633437353137613861633663633038343333336137323134333132 -62303536393836303963303331656164303630623638363663663964353366656231353933393239 -63363731616631326637303761373232666535623930636132616564646666373162663666636461 -61633862363465316233386636363164353932376566323664336536313736626530643366663463 -61333566303361323166373366636633653764353432366361656230666434386134613330383930 -37633735613433346639343237373863633834663230626338626234333236623361386138313164 -36316465343135653938326566336535363665316131353762633334626262393038393534343362 -34313265653137653637646132616638323965303763333131626663373463356631336465616466 -63633061333666303963656262646236366538653066613461633062373861643138336232353564 -36303633313663626666393936323365376431306432663432366535313733613135343931326366 -37363632336162356230616533383862663966306634363763393638356262656433663861396262 -39323664616239313662333039393664663138353931646662386236616338376137323831373362 -376562353066306632316165373235313965 +38646262656332373137326436333032633734373863663163383333393031646462356366393434 +3162363432386232333561653336616136363965333739350a383639386130343562356438356264 +65303833353536373236613635376136336435353639336432356264633265363736323339633165 +6636656133663938340a313361316261653061343463396665666534363737623639613331336665 +36336262626134316235353733333763303939653431383363363932626334393433353434633133 +31613436663137396563316266376234633632616232356466373562656532323836646336636333 +63643439313463373337376430376266666366386165353235353131346335356464326266666330 +66636633306465636430663163623465336131306131653133343366626162636130373234653564 +36356432636664633236336364636635363761666231396236363431326238623364353034643739 +34393466613362386435353761336633623331356237646537336464613233303932613463366261 +33333835333938366632303430356239646332616561623339653130353261666631396465613163 +61306165353837376166356565396665613030313061656331333432623436353765613562656362 +61633934376339663366353762333966373238333336313365623238653633303631386635313138 +62636436336231326432326534386632396433303363343363643835643466613737313638636365 +66646238366537646661313839613064393238363066366331383031323062643134316536313338 +35306330366233366333613232633963383665666364656138323030663063333439626434393036 +66373965363835366437616461346539323832376262646135613665326637663034376464303633 +32363661666636613530343063373164356130376466323165316464336335336435303364643535 +31623938326130323161383736663936313166313031393139306666313265333562623937633665 +61643030393031343533643130623435356536646439303235636530616161663663386162343061 +31393833373438386237626462363332353938373466316633663539623364626232333834346666 +66666231636130373862613932613932363037613666343461643332303362373834653465346330 +61373137663730633831393234396165386339386333656639353339653364656537316437626332 +33373232356538333238383430376365376666323265633335353838656432653035636631393665 +62616661613831623539613335646164653862313839333737326135346664643561633538383864 +39643732616438636330313664633239656532336564326264646662353733366362656561393235 +63383237636466343961646365623764373966326437313639323361383634656636353861653862 +35646138313464396337313730633662396664303366313638613462363966313934626261323639 +63623638343938613531383332346564323538663236613031616338396464323939316632376531 +64663566343361313034313166313138663633313263366431373739336635313766383939663233 +336365323266666666303337626133343438