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, 2019 in Ansible by Hita
3,701 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, 2019 by Jinu

Related Questions In Ansible

0 votes
0 answers
+1 vote
1 answer
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,954 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP