Ansible error "Could not find aptitude. Using apt-get instead"

0 votes

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
Aug 26 in Ansible by Hita
412 views

1 answer to this question.

0 votes

Hey @Hita, use the apt module to install aptitude before upgrading it. 

Have a look at this link: https://www.edureka.co/community/55679/install-aptitude-on-ubuntu

answered Aug 26 by Jinu

Related Questions In Ansible

0 votes
3 answers
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
177 views