Answer the question
In order to leave comments, you need to log in
How to solve the error in the playbook file?
Just the other day I started to study Ansible, wrote a simple playbook to install Apache on all my hosts (2 instances raised in Amazon), I get the following error, I feel that something simple, but I myself have not noticed the error yet
Playbook: - name: Install default Apache Web Server
hosts: all
become: yes
tasks:
- name: Install Apache WebServer
apt: name=httpd state=latest
- name: Start Apache and Enable it on the every boot
service: name=httpd state=started enabled=yes
Error: fatal: [linux1]: FAILED! => {"cache_update_time": 1586367636, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=-- force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'httpd'' failed: E: Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation candidate"], "stdout": "Reading package lists...\ nBuilding dependency tree...\nReading state information...\nPackage httpd is a virtual package provided by:\n nginx-core 1.14.0-0ubuntu1.7\n apache2 2.4.29-1ubuntu4.13\n\n" , "
fatal: [linux2]: FAILED! => {"cache_update_time": 1586367636, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=-- force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'httpd'' failed: E: Package 'httpd' has no installation candidate\n", "rc": 100, "stderr": "E: Package 'httpd' has no installation candidate\n", "stderr_lines": ["E: Package 'httpd' has no installation candidate"], "stdout": "Reading package lists...\ nBuilding dependency tree...\nReading state information...\nPackage httpd is a virtual package provided by:\n nginx-core 1.14.0-0ubuntu1.7\n apache2 2.4.29-1ubuntu4.13\n\n" , "stdout_lines":
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question