title: Molecule : Testing roles : Failed to get Dbus Connection Operation not permitted
body: <p>I facing an issue on my Molecule Test. I have begin to study this tool 2 days ago for information.</p>
  
  <p>on a Ubuntu VM running with Vagrant,I have create a role and initialze Molecule's folder and create a testinfra test file ( with the docker provider ).</p>
  
  <p>The error is when my task's role are running, at the step of checking service running, it failed.</p>
  
  <pre><code>fatal: [instance]: FAILED! =&gt; {"changed": false, "msg": "Could not find the requested service httpd: "}
  </code></pre>
  
  <p>I was design to simply install 2 packages including httpd on a Centos Image.</p>
  
  <p>When im loggin directly to the Molecule VM ( so through docker ), when i simply type <strong>systemctl</strong> the error message is </p>
  
  <pre><code>Failed to get D-Bus connection: Operation not permitted
  </code></pre>
  
  <p>As adviced Geerlingguy, i have specify volume mapped on cgroup folder </p>
  
  <pre><code>platforms:
    - name: instance
      #image: docker.io/pycontribs/centos:7
      image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
      volumes:
        - /sys/fs/cgroup:/sys/fs/cgroup:ro
  </code></pre>
  
  <p>The error is not related to Testinfra but only the docker built image.</p>
  
  <p>Could someone help me to understand why this error message ?</p>
  
  <p>Is that because im on a VirtualBox ran by Vagrant ?</p>
  
  <p>Thanks all for reading :-)</p>