Roots Discourse

No file was found when using first_found

Recently rebased to current HEAD, so may have missed a step or a file.

TASK [common : Import PHP version specific vars] *******************************
System info:
  Ansible 2.10.11; Darwin
  Trellis version (per changelog): "Fix #1284 - Update logrotate postrotate Nginx command"
---------------------------------------------------
An unhandled exception occurred while running the lookup plugin
'first_found'. Error was a <class 'ansible.errors.AnsibleLookupError'>,
original message: No file was found when using first_found. Use
errors='ignore' to allow this task to be skipped if no files are found
fatal: [165.227.82.53]: FAILED! => {}

What’s going on here, please?

- name: Import PHP version specific vars
  include_vars: "{{ lookup('first_found', params) }}"
  vars:
    params:
      files:
        - '{{ php_version }}.yml'
        - '7.4.yml'
      paths:
        - "{{ playbook_dir }}/roles/php/vars/"

Ah.

I was missing the roles/php/vars directory.

For now, just added the 7.4.yml file:

php_extensions_default:
  php7.4-bcmath: "{{ apt_package_state }}"
  php7.4-cli: "{{ apt_package_state }}"
  php7.4-curl: "{{ apt_package_state }}"
  php7.4-dev: "{{ apt_package_state }}"
  php7.4-fpm: "{{ apt_package_state }}"
  php7.4-imagick: "{{ apt_package_state }}"
  php7.4-intl: "{{ apt_package_state }}"
  php7.4-mbstring: "{{ apt_package_state }}"
  php7.4-mysql: "{{ apt_package_state }}"
  php7.4-xml: "{{ apt_package_state }}"
  php7.4-xmlrpc: "{{ apt_package_state }}"
  php7.4-zip: "{{ apt_package_state }}"

php_memcached_packages:
  php7.4-memcached: "{{ apt_package_state }}"

php_xdebug_package: php7.4-xdebug

Seems to be chugging along nicely.

Also needed to update https://github.com/roots/trellis/blob/master/roles/php/templates

Do you have https://github.com/roots/trellis/pull/1284 patched?

1 Like

Yes and no. For some reason, it seems that when I rebased, new files didn’t get merged in. Maybe I did something incorrectly in my interfacing with KDiff. Had to add some template files and also the php yml files at https://github.com/roots/trellis/pull/1284/files#diff-4db4c5f3c16abfbb07982e00382129f5db4fc781fb26a7c2cfaf70b428151b4d.

Then just spun up new Ubuntu 20 servers, as opposed to trying to find the differences from the Ubuntu 18-oriented Trellis that the original servers were provisioned with.