Can't install Foreman with Ansible on Ubuntu 16.04

Installation of the Foreman 1.16 or 1.17 on Ubuntu 16.04 always fails with an error:

[ERROR 2018-03-27T13:12:28 verbose] Unpacking ruby-smart-proxy-ansible (2.0.2-1) ...
[ERROR 2018-03-27T13:12:28 verbose] dpkg: error processing archive /var/cache/apt/archives/ruby-smart-proxy-ansible_2.0.2-1_all.deb (--unpack):
[ERROR 2018-03-27T13:12:28 verbose]  trying to overwrite '/usr/lib/ruby/vendor_ruby/foreman_ansible_core.rb', which is also in package ruby-foreman-ansible-core 1.1.1-1
[ERROR 2018-03-27T13:12:28 verbose] Processing triggers for man-db (2.7.5-1) ...
[ERROR 2018-03-27T13:12:28 verbose] Errors were encountered while processing:
[ERROR 2018-03-27T13:12:28 verbose]  /var/cache/apt/archives/ruby-smart-proxy-ansible_2.0.2-1_all.deb
[ERROR 2018-03-27T13:12:28 verbose] E: Sub-process /usr/bin/dpkg returned an error code (1)

The installer started with:

foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible -v

Any ideas?

@dLobatog @bastilian this is a problem in the current smart_proxy_ansible gem:

mmoll@msail:/tmp$ gem unpack smart_proxy_ansible-2.0.2.gem 
Unpacked gem: '/tmp/smart_proxy_ansible-2.0.2'
mmoll@msail:/tmp$ cd smart_proxy_ansible-2.0.2/
mmoll@msail:/tmp/smart_proxy_ansible-2.0.2$ find .
.
./settings.d
./settings.d/ansible.yml.example
./lib
./lib/smart_proxy_ansible
./lib/smart_proxy_ansible/version.rb
./lib/smart_proxy_ansible/plugin.rb
./lib/smart_proxy_ansible/http_config.ru
./lib/smart_proxy_ansible/api.rb
./lib/smart_proxy_ansible.rb
./lib/foreman_ansible_core
./lib/foreman_ansible_core/version.rb
./lib/foreman_ansible_core/roles_reader.rb
./lib/foreman_ansible_core/remote_execution_core
./lib/foreman_ansible_core/remote_execution_core/settings_override.rb
./lib/foreman_ansible_core/remote_execution_core/ansible_runner.rb
./lib/foreman_ansible_core/playbook_runner.rb
./lib/foreman_ansible_core/exception.rb
./lib/foreman_ansible_core/command_creator.rb
./lib/foreman_ansible_core/actions.rb
./lib/foreman_ansible_core.rb
./bundler.plugins.d
./bundler.plugins.d/smart_proxy_ansible.rb
./README.md
./LICENSE

Issue: Bug #23651: ruby-smart-proxy-ansible package conflicts with ruby-foreman-ansible-core - Packaging - Foreman
Fix: https://github.com/theforeman/foreman-packaging/pull/2506

2 Likes

There were indeed 3 problems with the 2.0.2 smart_proxy_ansible gem:

1 - As you pointed out, the debian dependency issue where you cannot install foreman_ansible_core
2 - In RPMs, the proxy could not access the SCL package foreman_ansible_core - so it could not import roles.
3 - bin/json_inventory.sh was not included in 2.0.2 so even if you could make it work, unless you have the right inventory in the proxy, it would not work.

https://github.com/theforeman/foreman-packaging/pull/2513 and https://github.com/theforeman/foreman-packaging/pull/2514 ought to solve the problem by including bin/json_inventory.sh

Apologies for the delay in releasing a new version

@dLobatog, thanks a lot! closed my PR.