'TaskInclude' object has no attribute 'has_triggered'

Getting this error with latest Trellis and Ansible setting up my local developer box.

RUNNING HANDLER [common : reload nginx] ****************************************
to see the full traceback, use -vvv
ERROR! Unexpected Exception: 'TaskInclude' object has no attribute 'has_triggered'
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Seems to be issue with latest Ansible or at least my version. Here details on my version:
ansible --version
ansible 2.1.0.0
config file =
configured module search path = Default w/o overrides
and a possible change in script may be needed. See similar issue here.

Also having this issue after just setting up my Trellis vm today. I believe itā€™s in relation to Ansible 2.1.0 which was released on the 26th of May. See issue on their github

Issue did not persist in version 2.0.2 seemingly

Thanks for this (and the issue @stejmurphy).

Iā€™ve updated our requirements to be 2.0.2: https://github.com/roots/trellis/commit/2597bdd4ca220cb1af3f69ea9d27698f90d46119

1 Like

What would you suggest as a near-term solution for a Windows user? I looked into trying to force version 2.0.2.0 of Ansible but didnā€™t have much luck.

Figured out a solution while the issue persists, for any other Windows users out there. Made the following changes to windows.sh to force version 2.0.2.0:

#  echo "Adding Ansible repository..."
#  sudo apt-add-repository -y ppa:ansible/ansible
#  echo "Updating system..."
#  sudo apt-get -y update
#  echo "Installing Ansible..."
#  sudo apt-get -y install ansible
  echo "Installing pip..."
  sudo sudo apt-get -y install python-pip
  echo "Installing Ansible with pip..."
  sudo pip install ansible=='2.0.2.0'
  echo "Installing markupsafe with pip..."
  sudo pip install markupsafe

Note that there were a two deprecation warnings from Ansible. First one FYI:

==> default: [DEPRECATION WARNING]: Using bare variables is deprecated. Update your
==> default: playbooks so that the environment value uses the full variable syntax
==> default: ('{{composer_global_packages}}').
==> default: This feature will be removed in a future
==> default: release. Deprecation warnings can be disabled by setting
==> default: deprecation_warnings=False in ansible.cfg.

Second one:

==> default: ('{{logrotate_scripts}}').

2 Likes

Yeah thatā€™s fine. Those warnings are from 3rd party packages we donā€™t control unfortunately.

Hi I run with the same issue, I clone my repo from git, Iā€™m using atually in my laptop from my job and works ok.
Until I cloned in my private laptop to do some job,then I run vagrant up and I had the same issue, I check your post and I made this changes in the windows.sh, then run vagrant provision, like 3 times until that error disapear.

But when I check the url I have the welcome to ngix! message, did u have that issue also?

Iā€™m also seeing this issue with the latest version of Ansible.

1 Like

Yesā€¦ itā€™s a bug with Ansible. See ā€˜TaskIncludeā€™ object has no attribute ā€˜has_triggeredā€™

I saw the the ngix! message when it wasnā€™t working.

After you changed the windows.sh file, did you try running ā€œvagrant destroyā€ and then ā€œvagrant upā€? It worked the first time for me that way.

Iā€™ve got the issue with ansible 2.1. (El Capitan)

1 Like

Whatā€™s the solution for El Captain running Ansible 2.1.

Same error

ERROR! Unexpected Exception: 'TaskInclude' object has no attribute 'has_triggered'

Previously installed with Homebrew, no way to target specific version so I uninstalled Ansible

brew rm ansible

Then reinstalled with pip, but targeted a specific version of ansible.

pip install git+git://github.com/ansible/ansible.git@stable-2.0

Did vagrant destroy and then vagrant up. Everything works!

1 Like

Iā€™m closing this topic. The solution as per our requirements is to use Ansible 2.0.2.0.

Pip

pip install ansible==2.0.2.0

Homebrew

brew switch ansible 2.0.2.0

Consider pinning brew to that version brew pin ansible

More on specific brew versions here: http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula

7 Likes