Error running drupal playbook directly on Ubuntu 20.04
See original GitHub issueI am using ansible 2.10.3, and running the playbook with the command:
ansible-playbook -c local -i 'localhost,' playbook.yml
Then I get:
PLAY [all] ************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ************************************************************************************************************************************************************************************
[WARNING]: Unhandled error in Python interpreter discovery for host localhost: '<' not supported between instances of 'str' and 'int'
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/home/static/.pyenv/shims/python3.7"}, "failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1, "warnings": ["Platform linux on host localhost is using the discovered Python interpreter at /home/static/.pyenv/shims/python3.7, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information."]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
PLAY RECAP ************************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
After reading the mentioned documentation I couldn’t really figure out what was the problem here.
BTW @geerlingguy congratulations for the great work, keep on!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Troubleshooting and other resources - Drupal
Troubleshooting. A collection of links with issues and how to potentially solve them. Local environment-related (LAMP or Drupal). Apache.
Read more >How To Install and Configure Ansible on Ubuntu 20.04
This guide assumes your Ansible hosts are remote Ubuntu 20.04 servers. Make sure each Ansible host has: The Ansible control node's SSH public ......
Read more >Using Ansible through Windows 10's Subsystem for Linux
Ansible test playbook running on Windows in the Ubuntu Bash shell ... Set up BLT and Drupal VM entirely within Windows 10.
Read more >Ansible + Ubuntu 18.04 + MySQL = "The PyMySQL (Python ...
The edited -vvv output from the playbook run is below. Has anyone got any more ideas about either the problem or solution. TASK...
Read more >hechoendrupal/DrupalConsole - Gitter
The problem: how to have the equivalent of drush_backend_batch_process for Drupal ... The work around would be run composer require drupal/console-es
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like if you’re trying to run this against localhost—e.g. your local workstation—you would need to provide a sudo password so the playbook can configure everything.
I would recommend running the example against a VM or something first, before applying all the changes locally, if you’re running from your normal workstation.
But in any case, to provide a sudo password, you can use the
-k
option.@geerlingguy I did what you told me. You were correct, I installed Python 3.9 with pyenv and Ubuntu 20.04 cames with 3.8. The problem is that the installed
python3-apt
just works on the system installed python (you check it withimport apt
).The “solution” is adding the path to original system interpreter to override the one detected by ansible with
ansible_python_interpreter=/usr/bin/python3
. Anyhow, I also think there is a problem with ansible 2.10 either with the detection of the used interpreter or, at least, this message error telling me to installpython3-apt
.