Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPL-69 Enable custom tmp on ansible #405

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

Jesus-Osuna-M
Copy link
Contributor

@Jesus-Osuna-M Jesus-Osuna-M commented Nov 22, 2024

Before submitting this PR:

  • Jira ticket is present in the title or in the description
  • All items marked FILL IN are filled
  • Any required labels are applied (Bug bash, exclude release notes, backport, etc.)
  • Testing/reviewer instructions are filled out

About this change:

This update modifies the Ansible plugin and its sidecar to support the use of a custom temporary directory instead of the default /tmp directory. The sidecar now forwards the overridden tmp path from the runner to the framework, enabling the plugin to correctly generate and use temporary scripts in the specified location.

This change resolves an issue where Ansible commands failed when attempting to use a non-default temporary directory, ensuring compatibility with environments that restrict or do not support the default /tmp directory.

Jira Ticket: https://pagerduty.atlassian.net/browse/RPL-69

Changes on the Ansible plugin:
#405

Purpose of the Changes:

Allow Ansible plugin to use a custom tmp dir to generate

Customer Impact:

This resolves an issue preventing users from successfully running Ansible commands when a custom temporary directory is required. The enhancement ensures compatibility with environments where the /tmp directory is restricted or unsuitable.

Release Notes:

Kind of Change

  • Bug Fix
  • Enhancement/New Feature/Behavior
  • Maintenance
  • Backport (Other sections can be skipped)
  • Other... (FILL IN)

Development Checklist

  • Unit Tests added for modified/added code
  • [] Documentation PR:
  • Documentation Not needed

Specific Considerations:

  • Feature Flag required (New behavior), name:
    • The new behavior is OFF by default (flag is false by default)
  • API Functional Tests added (API Changes)
  • API Version Increment needed (implies Documentation needed)

GUI Changes:

  • No GUI Changes, OR
  • Selenium UI Tests added

Testing:

  • Create an Ansible playbook workflow node step
  • Create a runner
  • Change the tmp dir in the Runner server to 444 (read only) or change the name of the tmp after the runner is up.
  • Run the runner like this, to change the default tmp dir:
    java -Drunner.log.output=console -Drunner.rundeck.overrideTempDir=true -Drunner.dirs.tmp=/my/custom/tmp/ -Dorg.sqlite.tmpdir=/my/custom/tmp/ -jar runner.jar

Run an ansible job and it should run creating tmp files on the defined path.

Testing setup:
Can be tested locally with a rundeck server and a runner running locally or on docker.

Acceptance Criteria:

  • Users can modify tmp dir for Ansible.
  • Jobs should run when the default tmp is blocked and a custom tmp is configured.
  • Resource model should bring nodes info when the default tmp is blocked and a custom tmp is configured.
  • Ansible should use default tmp dir is not custom tmp is configured.

QA/Bug Bash Needed?

  • manual-qa/bug-bash Label is applied, OR
    • Not needed

Manual QA Notes:

Reviewer Checklist

Functionality (choose one):

  • I built and tested locally and code behaves as expected: OR
    • I tested via via Docker image, OR
    • It was not necessary, reason:

Code:

  • Meets quality and style guidelines
    • Has complete Unit tests
    • Has complete Functional Tests

@Jesus-Osuna-M Jesus-Osuna-M added this to the 5.9.0 milestone Nov 22, 2024
@Jesus-Osuna-M Jesus-Osuna-M marked this pull request as ready for review November 26, 2024 12:41
@Jesus-Osuna-M Jesus-Osuna-M merged commit 3a85dfa into main Dec 6, 2024
2 checks passed
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