splunk / splunk-ansible

Ansible playbooks for configuring and managing Splunk Enterprise and Universal Forwarder deployments
353 stars 185 forks source link

Container image: Support for other runtimes than Docker #431

Closed dadux closed 4 years ago

dadux commented 4 years ago

Hi all,

I'd love to migrate our Splunk cluster to Kubernetes, and was playing with the splunk-operator.

When the container starts, it fails with the following error :

ERROR! Specified hosts and/or --limit does not match any hosts

I believe this is due to a missing .dockerenv file : https://github.com/splunk/splunk-ansible/blob/13ce087937a4cbb6c73822897698cbaf6fc40b55/inventory/environ.py#L93 which treats container differently with localhost.

The .dockerenv is mounted for each containers by the docker daemon only, but in our case we are running containerd and it does not mount it. I believe users running CRI-O in their clusters will run into the same issue.

How can we not rely on this file ? Adding an environment variable ?

nwang92 commented 4 years ago

👍 let me take a look

nwang92 commented 4 years ago

I kicked off another build for the edge tag, could you try that and see if it works? The image is splunk/splunk:edge

dadux commented 4 years ago

Confirmed ! latest splunk/splunk:edge fixes the problem.

Thanks for a very speedy resolution !