1

I want to run this command:

setarch $(uname -m) --uname-2.6 /opt/files/IBM/ITM/install.sh -q -h /opt/files/IBM/ITM/Install -p /opt/files/silent_install.txt

in Ansible using the script module but I'm not sure how to incorporate the extra args.

2 Answers 2

2

Firstly, you don't run an executable using script module, but using a command or shell module.

Secondly, you should utilise Ansible facts for that. The architecture (the result of uname -m) is stored in the ansible_facts.architecture fact:

command: setarch {{ ansible_facts.architecture }} --uname-2.6 /opt/files/IBM/ITM/install.sh -q -h /opt/files/IBM/ITM/Install -p /opt/files/silent_install.txt
Sign up to request clarification or add additional context in comments.

Comments

0

See the examples here; just type them in.

# Example from Ansible Playbooks
- script: /some/local/script.sh --some-arguments 1234

...but I recommend using copy or template with command or shell as techraf suggests.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.