Error when updating to latest version of trellis

Hey!

I’ve been trying to update my site to the latest version of trellis, but getting an error from the vendor directory. I updated trellis by doing a git clone of the lastest trellis - https://github.com/roots/trellis - and added back my group_vars and hosts. When I try to run vagrant up I get the following error after default: running ansible-playbook:

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/home/jill/sites/XXXXXX/trellis/vendor/roles/ntp/tasks/main.yml': line 52, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Populate service facts.
  ^ here


The error appears to have been in '/home/jill/sites/XXXXX/trellis/vendor/roles/ntp/tasks/main.yml': line 52, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Populate service facts.
  ^ here

exception type: <class 'ansible.errors.AnsibleParserError'>
exception: no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/home/jill/sites/XXXXXX/trellis/vendor/roles/ntp/tasks/main.yml': line 52, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Populate service facts.
  ^ here

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

The error indicates that there’s a syntax error in the file /trellis/vendor/roles/ntp/tasks/mail.yml. The weird thing is, the vendor directory is automatically generated. Upon further inspection, it looks like /vendor/roles is missing many files.

Here’s what the file in question looks like (syntax error bolded):

---
 - name: Include OS-specific variables.
   include_vars: "{{ ansible_os_family }}.yml"
   
- name: Include OS-Release specific variables on RHEL 6.
  include_vars: RedHat-6.yml
  when:
    - ansible_os_family == 'RedHat'
    - ansible_distribution_major_version == '6'

- name: Set the ntp_driftfile variable.
  set_fact:
    ntp_driftfile: "{{ __ntp_driftfile }}"
  when: ntp_driftfile is not defined

- name: Set the ntp_package variable.
  set_fact:
    ntp_package: "{{ __ntp_package }}"
  when: ntp_package is not defined

- name: Set the ntp_config_file variable.
  set_fact:
    ntp_config_file: "{{ __ntp_config_file }}"
  when: ntp_config_file is not defined

- name: Set the ntp_daemon variable.
  set_fact:
    ntp_daemon: "{{ __ntp_daemon }}"
  when: ntp_daemon is not defined

- name: Ensure NTP package is installed.
  package:
    name: "{{ ntp_package }}"
    state: present

- name: Ensure tzdata package is installed (Linux).
  package:
    name: "{{ ntp_tzdata_package }}"
    state: present
  when: ansible_system == "Linux"

- include_tasks: clock-rhel-6.yml
  when:
    - ansible_os_family == 'RedHat'
    - ansible_distribution_major_version == '6'

- name: Set timezone.
  timezone:
    name: "{{ ntp_timezone }}"
  notify: restart cron

**- name: Populate service facts.**
**      service_facts:**

- name: Disable systemd-timesyncd if it's running but ntp is enabled.
  service:
    name: systemd-timesyncd.service
    enabled: false
    state: stopped
  when:
    - ntp_enabled | bool
    - '"systemd-timesyncd.service" in services'

- name: Ensure NTP is running and enabled as configured.
  service:
    name: "{{ ntp_daemon }}"
    state: started
    enabled: true
  when: ntp_enabled | bool

- name: Ensure NTP is stopped and disabled as configured.
  service:
    name: "{{ ntp_daemon }}"
    state: stopped
    enabled: false
  when: not (ntp_enabled | bool)

- name: Generate ntp configuration file.
  template:
    src: "{{ ntp_config_file | basename }}.j2"
    dest: "{{ ntp_config_file }}"
    mode: 0644
  notify: restart ntp
  when: ntp_manage_config | bool

I don’t see many other people with this issue, so it’s either very uncommon or the answer’s obvious. It would be great if someone could point me in the right direction.

Thanks!

Jill

You also have to update the ansible galaxy dependencies locked by Trellis:
https://galaxy.ansible.com/docs/using/installing.html

That is most certainly the solution. I resolved the problem by upgrading to ansible 2.10: pip install ansible==2.10.

This topic was automatically closed after 42 days. New replies are no longer allowed.