I’m using Foreman for couple of months.
In Foreman I use Ansible roles and Ansible playbooks as well:
=> Host => Schedule remote job =>Ansible playbook => Ansible - Run playbook
Each time I do this I receive “Failed” in the Job status.
Even if Ansible Role/Playbook works well.
Could you, please, help me to solve this issue?
Also, Guys, is there any way to run playbooks which are alredy present in yml files on same server (e.g. located in ~/Ansible/ folder)?
Expected outcome:
Fix problem with Ansible jobs status.
Hi,
when you try running a playbook there’s a table with hosts at the bottom of the page. If you click on the host’s name, it will take you to a page showing the output of the job on that host. It is really hard to guess what went wrong just from what you said, but that page should give you more insight into it
Ah, for some reason I thought that playbooks/roles run fine outside of foreman.
In the job details there’s “job task” button, on the page where it takes you click “sub tasks”, there pick a single task and look around, hopefully you’ll find something useful there.
On a side note, does it take like 10 minutes for the job to run even if it does almost nothing?
I want to provide small update regarding problem with Ansible jobs status:
I have same for Ansible Roles as well.
New Ansible Role was created and assigned to host.
Then in host menu I run “Run Ansible Role” command.
In the output window - everything is ok (Failed=0, Skipped=0).
According to this article problem was solved in module foreman-tasks-1.1.0.
As I understand correctly, this module is for Foreman 2.0+, but I use 1.24.3 and have another version of foreman-tasks…
Is is usually a misconfiguration, either wrong hostname or ssl certs in /etc/smart_proxy_dynflow_core/settings.yml.
What is happening is:
A job is run
Job gets delegated to the smart proxy and smart proxy dynflow core
Smart proxy dynflow core runs the job (runs the actual ansible command)
When the job is done, smart proxy dynflow core tries to call back to foreman and this request fails
After 10 or so minutes, foreman checks the status on the smart proxy, sees the task there is failed and fails the job
Please note that the issue you linked is only a symptom, even if you had that patch, the jobs would still fail at step 4, you would just get a different error after 10 minutes.
Looks like I’ve found one issue.
Smart-Proxy tries to connect to localhost:3000, but gets “Connection refused”…just because nobody here listen this port:
Failed to open TCP connection to kh0dl1000000075.dtc.dish.corp:3000 (Connection refused - connect(2) for “kh0dl1000000075.dtc.dish.corp” port 3000) (Errno::ECONNREFUSED)
netstat -ant | grep 3000
Could you, please, tell me, which service should listen on port :3000 and how to enable it?
Smart-Proxy tries to connect to localhost:3000, but gets “Connection refused”…just because nobody here listen this port:
localhost:3000 is the default, most likely it is not configured to fit your environment. It it is a production deployment, then it should be fqdn of the foreman machine and port 443.