In @nathanielks’s XDebug instructional video, which is (a little outdated, but) great, he uses some alternate top level domain names (.trellis and .valet, I think).
I tried this and my browsers (Chrome and Safari, so far) aren’t finding it.
Maybe it doesn’t work any more with modern browsers, or maybe I missed a step.
Vagrant Hostmanager updated etc/hosts with the expected domain names.
The group_vars/development/wordpress_sites.yml looks like this:
refused. Actually, Chrome wasn’t recognizing it as we url without my manually including the https.
PING example.trellis (192.168.50.5): 56 data bytes
64 bytes from 192.168.50.5: icmp_seq=0 ttl=64 time=0.431 ms
Looks like there is an error with mysql, but I think that is a separate issue. Maybe I missed something in rebasing Trellis codebase:
Aug 26 18:01:48 example /etc/mysql/debian-start[70262]: FATAL ERROR: Upgrade failed
Aug 26 18:01:48 example /etc/mysql/debian-start[70272]: Checking for insecure root accounts.
Aug 26 18:01:48 example mariadbd[70243]: 2021-08-26 18:01:48 5 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
When trying to run trellis provision --tags mysql development it’s giving:
TASK [python_interpreter : Get Ubuntu version]
non-zero return code
sudo: a password is required
Nope. trellis up passes with flying colors, but trellis provision development fails with same error on two different (less than year old) just rebased projects.
So…
With a fresh trellis new same result, but vagrant up --provision does work. Same sudo password error on both trellis provision development and ansible-playbook dev.yml. Those commands are supposed to work, right?
Then I try to run ansible-playbook dev.yml -vvv and it doesn’t get past the first task, python_interpreter : Get Ubuntu version
Is there someplace in vagrant up or vagrant provision that admin_user and web_user are supposed to be created? I’m not seeing it in the vagrant output.
I wondered about that. There doesn’t seem to be a setting for $ANSIBLE_LOG_PATH in the trellis venv, so I added log_path = ./ansible.log to ansible.cfg and am running vagrant destroy -f && vagrant up again.
In vagrant up the output contains these references to “user”:
TASK [common : Generate SSH key for vagrant user] ******************************
TASK [mariadb : Set root user password] ****************************************
TASK [mariadb : Delete anonymous MySQL server users] ***************************
with a mode of 0700, this may cause issues when running as another user. To
TASK [wordpress-setup : Create/assign database user to db and grant permissions] ***
TASK [wordpress-install : Change site owner to user] ***************************
Yes. Thank you. Running over previous vagrant up and vagrant provision server, same result:
TASK [python_interpreter : Get Ubuntu version] ***************************************************************************************
task path: example.com/trellis/roles/python_interpreter/tasks/main.yml:2
<192.168.50.5> ESTABLISH LOCAL CONNECTION FOR USER: mikekilmer
<192.168.50.5> EXEC sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-ghmrvlsmcvmeqvmkluaxlxmwcdqypahr ; lsb_release -rs'
System info:
Ansible 2.10.13; Darwin
Trellis 1.8.0: February 12th, 2021
[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.output.CallbackModule object at
0x110bc3a00>): Invalid color supplied to display: bright gray
Callback Exception:
File "example.com/trellis/.trellis/virtualenv/lib/python3.9/site-packages/ansible/executor/task_queue_manager.py", line 389, in send_callback
method(*new_args, **kwargs)
File "example.com/trellis/lib/trellis/plugins/callback/output.py", line 42, in v2_runner_on_failed
output.display_host(self, result)
File "example.com/trellis/lib/trellis/utils/output.py", line 120, in display_host
display(obj, result)
File "example.com/trellis/lib/trellis/utils/output.py", line 105, in display
display(system(obj.vagrant_version), 'bright gray')
File "example.com/trellis/.trellis/virtualenv/lib/python3.9/site-packages/ansible/utils/display.py", line 215, in display
raise AnsibleAssertionError('Invalid color supplied to display: %s' % color)
I’m going to try the vagrant destroy loop again, using that ansible-playbook commend rather than vagrant up and vagrant provision. Is this something that needs to be run following vagrant up? Now I’m getting that error when vagrant up hasn’t been run.
With or without vagrant up beforehand, this fails with same error.
Cloned the Trellis master directly, created my own venv for pip requirements, server.yml is looking for a swapfile role, which doesn’t seem to exist (either locally or on github).
I had forgotten to run ansible-galaxy install -r galaxy.yml.
Following that, same “password is required” when I run ansible-playbook server.yml -e env=development, both before and after vagrant up. Same error also after vagrant provision and no admin user created. Don’t know if there’s supposed to be one, or if vagrant is supposed to be the user on dev box.
When running the server.yml playbook directly with --ask-become-pass, it stalls indefinitely (ten minutes plus) on that command. I’m about ready to throw in the towel on Ansible… I mean Trellis… I mean web development… I mean computers at all.
This option will cause ansible to prompt for the sudo password interactively.
As this doesn’t work in playbooks, ansible will wait for it unsuccessfully until it times out.
Can you define the password directly in ansible config, e.g. as ansible_become_password variable?
- block:
- name: Get Ubuntu version
raw: lsb_release -rs
register: ubuntu_version
changed_when: false
- name: Set ansible_python_interpreter for Ubuntu >= 18.04
set_fact:
ansible_python_interpreter: python3
ansible_become_password: "mikekilmer"
when: ubuntu_version.stdout | trim is version('18.04', '>=')
when: ansible_python_interpreter is not defined
tags: always