0

I'm very new to Vagrant and Ansible, somehow I managed to setup Vagrant and have a box running but when i try to provision it with Ansible then I get error.ImportError: No module named yum

My playbook looks like below :-

---
- hosts: default
  connection: local
  sudo: true
  tasks:

  - name: install apache
    yum: name=httpd state=latest

I'm using Ubuntu as my host machine and have Vagrant 1.8.5 and latest version of Ansible on it.Can somebody please suggest where I'm mistaking. Thanks in advance.

Akhil
  • 1,184
  • 1
  • 18
  • 42

1 Answers1

1

With

connection: local

you are running the playbook on your host which is Ubuntu.

And that's why it doesn't find yum.

techraf
  • 64,883
  • 27
  • 193
  • 198
  • my host machine is running Ubuntu and my virtual machine (spawned by Vagrant ) is running centos/7 so I guess I need yum to install apache on centos and not apt – Akhil Aug 12 '16 at 08:59
  • 1
    Ahh... that was the problem, thanks a lot for pointing the problem, I got it running :) – Akhil Aug 12 '16 at 09:08