add install_path option to non-native Linux installations#77
Open
dancorrigan1 wants to merge 4 commits intocohesity:mainfrom
Open
add install_path option to non-native Linux installations#77dancorrigan1 wants to merge 4 commits intocohesity:mainfrom
dancorrigan1 wants to merge 4 commits intocohesity:mainfrom
Conversation
Contributor
kavinagrawalcohesity
left a comment
There was a problem hiding this comment.
Kindly work on the comments ane let us know if you have any questions
Comment on lines
146
to
+169
| @@ -152,6 +166,7 @@ Examples | |||
| service_user: cagent | |||
| service_group: cagent | |||
| create_user: true | |||
| install_path: /opt/cohesity | |||
Contributor
There was a problem hiding this comment.
Add a new example instead of modifying the existing one
Comment on lines
164
to
+183
| @@ -170,6 +180,7 @@ | |||
| service_user: cagent | |||
| service_group: cagent | |||
| create_user: true | |||
| install_path: /opt/cohesity | |||
Contributor
There was a problem hiding this comment.
Add a new example instead of modifying the existing one
Comment on lines
254
to
266
| # => Determine if the Cohesity Agent is currently installed | ||
| aix_agent_path = "/usr/local/cohesity/agent/aix_agent.sh" | ||
| def_agent_path = "/etc/init.d/cohesity-agent" | ||
|
|
||
| # Look for default ansible agent path and aix agent path. | ||
| agent_path = ( | ||
| def_agent_path | ||
| if os.path.exists(def_agent_path) | ||
| else aix_agent_path | ||
| if os.path.exists(aix_agent_path) | ||
| else None | ||
| ) | ||
| if agent_path: |
Contributor
There was a problem hiding this comment.
Rebase your current branch and add logic to check agent at the location of install-path
| vars: | ||
| create_user: false | ||
| native_package: false | ||
| install_path: /opt/cohesity |
Contributor
There was a problem hiding this comment.
Kindly do not change the existing workflow
| state: present | ||
| create_user: false | ||
| native_package: false | ||
| install_path: /opt/cohesity |
Contributor
There was a problem hiding this comment.
Kindly do not change the existing flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new install_path option to support non-native Linux installations of the Cohesity agent.
By default, the collection assumes standard/native Linux filesystem layouts. However, in environments such as:
custom OS images
hardened builds
containerized hosts
or systems with non-standard directory structures
the agent installation path may differ. This change allows users to explicitly define that path.
🔧 What’s Included
Adds a new optional parameter: install_path
Updates relevant modules/tasks to respect this parameter during agent installation
Removes assumptions about fixed/default install directories for Linux systems
Cleans up related logic (including removal of unused tarball handling where applicable)
🚀 Why This Change
The current implementation assumes a standard Linux install location, which can cause failures or unexpected behavior in:
non-native Linux environments
customized filesystem layouts
enterprise environments with strict path controls
This enhancement improves:
flexibility → works across more Linux variants
portability → better support for containers, appliances, and restricted systems
user control → explicit path definition instead of implicit assumptions
✅ Backward Compatibility
No breaking changes
If install_path is not provided, existing behavior remains unchanged
Fully compatible with current playbooks and roles
🧪 Testing
Validated against:
standard Linux installs (default behavior unchanged)
non-standard install paths (custom install_path provided)
Ensured agent installation succeeds in both scenarios
📌 Example Usage
cohesity.dataprotect.agent:
state: present
install_path: /opt/custom/cohesity
📎 Notes
This aligns with the broader goal of making the collection usable across diverse infrastructure environments, including hybrid and non-traditional Linux deployments.