Skip to content

add install_path option to non-native Linux installations#77

Open
dancorrigan1 wants to merge 4 commits intocohesity:mainfrom
dancorrigan1:main
Open

add install_path option to non-native Linux installations#77
dancorrigan1 wants to merge 4 commits intocohesity:mainfrom
dancorrigan1:main

Conversation

@dancorrigan1
Copy link
Copy Markdown

@dancorrigan1 dancorrigan1 commented Mar 23, 2026

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

  • name: Install Cohesity Agent with custom path
    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.

@kavinagrawalcohesity kavinagrawalcohesity self-requested a review April 21, 2026 06:23
Copy link
Copy Markdown
Contributor

@kavinagrawalcohesity kavinagrawalcohesity left a comment

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kindly do not change the existing workflow

state: present
create_user: false
native_package: false
install_path: /opt/cohesity
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kindly do not change the existing flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants