Hi Arsène! I'm quite new to Ansible and Foreman, so be patient with me.
Foreman use an user named 'foreman'. To make Ansible work in my environment
I've configured an SSH key and I've exported it in my two hosts: the
commands I've used are those, and I've executed them on the machine where
Foreman lives:
sudo -u foreman ssh-keygen -N ''
sudo -u foreman ssh-copy-id root@my_first_host
sudo -u foreman ssh root@my_first_host
sudo -u foreman ssh-copy-id root@my_second_host
sudo -u foreman ssh root@my_second_host
I hope this will solve your problem.
An other way can be to configure a 'foreman' user in your hosts.
Best.
Pietro Gabelli
On Tuesday, August 1, 2017 at 10:58:13 AM UTC+2, Arsène Gschwind wrote:
>
> Hi,
>
> I'm trying to use ansible with foreman but when tying to execute an
> ansible playbook I get the following error:
>
> fatal: [darla-hesley.vm.sapify.ch]: UNREACHABLE! => {"changed": false, "msg":
> "Failed to connect to the host via ssh: write: Broken pipe\r\n",
> "unreachable": true}
> to retry, use: --limit
> @/tmp/foreman-playbook-9bc23404-2d9b-4c65-ad58-04a799263dc1.retry
>
> When running the playbook directly with ansible from the shell it works
> even when doing a sudo -u foreman-proxy.
>
> I'm not sure which user foreman is using to run playbooks, I've tried to
> set the user in the foreman settings->ansible tab or even using the
> parameter ansible_user on the host, neither did help.
> I'm running the following version:
> foreman : Version 1.15.2
> katello: 3.4.2
> foreman-tasks: 0.9.4
> ansible 2.3.1.0
>
> Thanks for any help
> rgds,
> Arsène
>
--
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.