First: I am very new to ansible—I just started yesterday. Most things work quite well (installing packages, cloning my git repo, etc.), but I have not been able to get composer install to run to save me.
Here's the setup:
- Laravel 8.x project.
- Dev environment runs under vagrant (Ubuntu 20.04)
- ansible version 2.9.6
- Remote is a Ubuntu 20.04 EC2 instance.
- Project root is
/var/www/roster
I have temporarily set the the remote vendor directory to 0777 and the owner to ubuntu (the EC2 default ssh user) but reset it to 0755 and root when done.
I've tried several variations, but when I run the playbook with ansible-playbook -i ./hosts composer_install.yml, it just hangs. Here are the things I've tried:
tasks:
- name: Composer install
shell: composer install
args:
chdir: /var/www/roster
...and:
tasks:
- name: Composer install
composer: command=install working_dir=/var/www/roster optimize_autoloader=no
...and (with the ansible-composer plugin installed):
tasks:
- name: Composer install
community.general.composer:
command: install
working_dir: /var/www/roster
I'm sure this is something that can be done, but how?