Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ansible/fetch-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
source ~/venvs/kayobe/bin/activate
source ~/src/kayobe-config/kayobe-env --environment ci-multinode
export KAYOBE_VAULT_PASSWORD=$(cat ~/vault.password)
if [[ -f $KAYOBE_CONFIG_PATH/ansible/diagnostics.yml ]]; then
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/diagnostics.yml -e diagnostics_path_local={{ diagnostics_path_control_host }}
if [[ -f $KAYOBE_CONFIG_PATH/ansible/tools/diagnostics.yml ]]; then
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/tools/diagnostics.yml -e diagnostics_path_local={{ diagnostics_path_control_host }}
else
echo "Missing diagnostics playbook - skipping"
fi
Comment on lines +32 to 36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid repeating the playbook path, you could define it in a variable and reuse it. This makes future updates to the path easier as it only needs to be changed in one place.

          diagnostics_playbook="$KAYOBE_CONFIG_PATH/ansible/tools/diagnostics.yml"
          if [[ -f "$diagnostics_playbook" ]]; then
            kayobe playbook run "$diagnostics_playbook" -e diagnostics_path_local={{ diagnostics_path_control_host }}
          else
            echo "Missing diagnostics playbook - skipping"
          fi

Expand Down