I am trying to install and start apache2 on my ubuntu. This is my playbook:
---
- hosts: nodes
  become: yes
  tasks:
    - name: To Update the cache
      apt: update_cache=yes
    - name: To install Apache2
      apt: name=apache2 state=present
    - name: To restart Apache2
      service: name=apache2 state=restarted
    - debug: msg="Apache has been installed"
But I go the following error:
Could not find aptitude. Using apt-get instead