fix: handle private IP detection and make dashmon optional#744
fix: handle private IP detection and make dashmon optional#744vivekgsharma merged 1 commit intov1.0-devfrom
Conversation
📝 WalkthroughWalkthroughThis pull request updates Ansible role variables and task logic across multiple roles: improving private IP address detection with regex-based matching, adding fallback logic for version detection when extraction yields 'none', and implementing SSH key existence validation with conditional task execution. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ansible/roles/dashmate/tasks/main.yml`:
- Around line 258-261: The current task "Set dashmate config version from
already extracted version" sets dashmate_config_version using
installed_dashmate_version captured before installation, which prevents using
the newly installed version after an upgrade; change the expression so that when
dashmate_needs_update is true the task uses dashmate_version (post-install)
instead of the pre-captured installed_dashmate_version. Update the set_fact for
dashmate_config_version to choose dashmate_version when
installed_dashmate_version == 'none' OR dashmate_needs_update is true, otherwise
keep installed_dashmate_version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 61423313-8e0e-4e2c-a478-f00d2fa0f48e
📒 Files selected for processing (4)
ansible/roles/dashd/defaults/main.ymlansible/roles/dashmate/tasks/main.ymlansible/roles/status_dashboard/defaults/main.ymlansible/roles/status_dashboard/tasks/main.yml
| - name: Set dashmate config version from already extracted version | ||
| ansible.builtin.set_fact: | ||
| dashmate_config_version: "{{ installed_dashmate_version }}" | ||
| dashmate_config_version: >- | ||
| {{ dashmate_version if installed_dashmate_version == 'none' else installed_dashmate_version }} |
There was a problem hiding this comment.
Use the post-install version after upgrades.
installed_dashmate_version is captured before Install dashmate; on upgrades, this keeps dashmate_config_version pinned to the old version even after dashmate_needs_update installs dashmate_version.
🐛 Proposed fix
- name: Set dashmate config version from already extracted version
ansible.builtin.set_fact:
dashmate_config_version: >-
- {{ dashmate_version if installed_dashmate_version == 'none' else installed_dashmate_version }}
+ {{ dashmate_version if (installed_dashmate_version == 'none' or (dashmate_needs_update | default(false))) else installed_dashmate_version }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ansible/roles/dashmate/tasks/main.yml` around lines 258 - 261, The current
task "Set dashmate config version from already extracted version" sets
dashmate_config_version using installed_dashmate_version captured before
installation, which prevents using the newly installed version after an upgrade;
change the expression so that when dashmate_needs_update is true the task uses
dashmate_version (post-install) instead of the pre-captured
installed_dashmate_version. Update the set_fact for dashmate_config_version to
choose dashmate_version when installed_dashmate_version == 'none' OR
dashmate_needs_update is true, otherwise keep installed_dashmate_version.
Issue being fixed or feature implemented
Fixes fresh devnet deployment failures encountered while bringing up
devnet-devnetdr.The deployment was failing in three places:
dashdroleWhat was done?
dashd_allowprivatenetto use a direct private-address match instead ofansible.utils.ipaddr("private"), which was failing in this environment with a netaddr object attribute errorconfigFormatVersionfalls back todashmate_versionwhen no installed dashmate version exists yet, avoidingInvalid Version: noneHow Has This Been Tested?
./bin/deploy -p devnet-devnetdrafter applying the fixesdevnet-devnetdrenvironmentdashdprivate IP detection no longer fails duringdash.conftemplatingstatus_dashboardroledashmate config renderno longer fails on fresh HPMN nodes withTypeError: Invalid Version: noneBreaking Changes
None.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Bug Fixes
Configuration