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

Inline script not working for OS Families without chmod #8986

Open
z3bra opened this issue Mar 8, 2024 · 0 comments
Open

Inline script not working for OS Families without chmod #8986

z3bra opened this issue Mar 8, 2024 · 0 comments

Comments

@z3bra
Copy link

z3bra commented Mar 8, 2024

Note: Bug Reports not following this template may be closed without feedback.

Getting Help
Please use this issue template for reporting identified or suspected bugs only. For support on configuration or troubleshooting please see Getting Help for the appropriate channels.

Describe the bug
I am trying to automate some configuration on a Cisco switch (NXOS 9.3) by using an inline script, as configurations on these switches require multiple lines to apply the configuration. Example:

configure terminal
interface loopback 0
  ip address 127.0.0.2/32
exit

When using an "inline script" step targetting the switch (whose OS family is neither Unix nor Windows), the chmod +x $scriptfile command fails, preventing the job to proceed (even though the chmod bit is useless).
Bypassing this step is also not an alternative as the chmod is hardcoded in DefaultScriptFileNodeStepUtils.java.

My Rundeck detail

  • Rundeck version: v5.1.1-20240305
  • install type: rpm
  • OS Name/version: RHEL8
  • DB Type/version: postgres

To Reproduce
Steps to reproduce the behavior:

  1. Add a non-posix node (eg. without the chmod command)
  2. Create a job targetting this node
  3. Add "inline script" step, and specify the interpreter explicitely (eg. run-script $scriptfile on NXOS)
  4. Set "SCP" as the "Default File Copier" for the project
  5. Run job

Expected behavior
The job should upload the script on the node and execute the script immediately using the given interpreter (which doesn't require the executable bit to run).
Instead, the job fails with the following error:

Syntax error while parsing 'chmod +x /scripts/1530-11418-nx-leaf7-stdn-dispatch-script.tmp.cmd'

Cmd exec error.
Failed: Unknown: Remote command failed with exit status 16
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

No branches or pull requests

1 participant