help resolve warnings first role

6 views
Skip to first unread message

Gaetano Giacalone

unread,
Mar 13, 2019, 9:00:25 PM3/13/19
to Ansible Project
I have this role dagman62.apache_php it is installing apache/apr with php from source. I am registered variables and when: changed to determine if a tarball changed and needs to be UN-archived, configured, then built. I am getting these annoying warnings about using handlers, but I dont see the logic. It has been my understanding that handlers can be used to restart an app lets say in  case a configuration changed. I dont want my configure and make to run only if an archive changed. It would never get built. 

Excerpt from upload

 

./galaxy/downloads/tmpQjSwNY/tasks/main.yml:40: [E503] Tasks that run when changed should likely be handlers

 

If someone would be so kind as to give me some pointers on where to look in order to resolve these warnings, it would be appreciated.

 

dagman62.apache_php

 

Thanks in advance

 

Gaetano

 

The block in question is:

 

  - name: Unpacking Apache APR

    unarchive:

      copy: no

      dest: /tmp/

      src: "{{ apr_source.dest }}"

    when: apr_source is changed

    register: apr_source_unpack

Kai Stian Olstad

unread,
Mar 14, 2019, 2:30:56 AM3/14/19
to ansible...@googlegroups.com
On 14.03.2019 02:00, Gaetano Giacalone wrote:
> I have this role dagman62.apache_php it is installing apache/apr with
> php
> from source. I am registered variables and when: changed to determine
> if a
> tarball changed and needs to be UN-archived, configured, then built. I
> am
> getting these annoying warnings about using handlers, but I dont see
> the
> logic. It has been my understanding that handlers can be used to
> restart an
> app lets say in case a configuration changed. I dont want my configure
> and
> make to run only if an archive changed. It would never get built.
>
> Excerpt from upload
>
>
>
> ./galaxy/downloads/tmpQjSwNY/tasks/main.yml:40: [E503] Tasks that run
> when
> changed should likely be handlers

If you search you get this
https://github.com/ansible/ansible-lint/issues/419


--
Kai Stian Olstad

Gaetano Giacalone

unread,
Mar 14, 2019, 3:22:02 AM3/14/19
to Ansible Project
Thanks that was helpful
Reply all
Reply to author
Forward
0 new messages