Hello everybody,
I am on DO407 which does not cover that topic at all, so atm I am totally lost with that topic - could anybody please provide any ("official") resource how to do that really correctly?
Thank you so much
Cheers
Martin
Hello,
think of it, like you write in on the cli.
Example:
#!/bin/bash
export ANSIBLE_LOG_PATH="$(mktemp --suffix=_ansible.log)"
echo "Starting the ansible ping ..."
ansible all -m ping >/dev/null 2>&1
ansible_exit=$?
if [ $ansible_exit -eq 0 ]
then
echo "Finished ansible ping"
else
echo "Something went wrong (Exit Code was ${ansible_exit})"
fi
echo Logfile available at $ANSIBLE_LOG_PATH
exit $ansible_exit
Best regards
Andreas
Hi Andreas,
thank you for your answer. Interesting approach with the logging part - but IS that really necessary?
But to be honest, I would expect that you would not get full score with that script, though...
Question aims EX407, of course, but with the NDA stuff it is really, really hard to discuss issues duing an exam if you are on your own with the online learning plattform... and you get no help with the "expert chat" or from lering team via mail...
So...
Try to be abstract...
Assume the follwing:
If you run ansible on the command line, with all option needed (full path to inventory, remote_user, privilege escalation), and that command is idempotent for sure, and if you check all managed nodes you see that the command works as expected - if you put that line in a sript, of course with a shebang first, make that script exececutable - I guess you can be sure that it will work, of course, as on the command line, it will be correct, idempotent and so on - but you will not get full score during, too. And I do not understand why, and it drives me just crazy...
So question is: What is really needed when writing sripts with adhoc command. Any environemntal?
Still no idea...
Sorry, thank you
Regards
Martin
P.S.: Already passed EX407, all other parts almost 100%...
Hello,
it was just an example for illustration purpose. Of course the logging thing is not necessary.
Whatever goes wrong during the exam, I can not help!
Best regards
Andreas
Hi
I think you can join Ansible essentials overview course .This is video class room course and also you can also check ansible doc. there is lots of training videos and documentation.
Thanks
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.