4
votes

I m not looking for ansible.cfg skippy variable method but for a method I can use in specific roles only to avoid skipped messages on stout while running my playbooks.

(cannot use solutions based on grep rejections cause my ansible commands are not launched from a shell or similar but some applications) I can only work on yml files.

How to do that ?

test file

---
- hosts: localhost
  vars:
    mypath: /tmp/file
  tasks:
    - stat: path={{mypath}}
      register: foo

    - debug: var=foo

    - name: do something with file if exists
      command: cat {{ mypath }}
      when: foo.stat.exists

here it fails to avoid the skip message application runs only "ansible-playbook filename" & cannot be modified to include any pipes contrary of the example below :

-bash-4.4$ ansible-playbook filetest.yml  | grep -i skip
skipping: [localhost]

If its not possible is it possible on specific playbook at last ?

I repeat I cannot use cfg file solutions at all only environnement variables or an "inside yml" syntax

Thanks.

1
You can do whatever you like with custom callbacks.Konstantin Suvorov
I can only modify yaml's I cannot use any plugins callback inside the ansible.cfg. I will try to use system variable export ANSIBLE_LOAD_CALLBACK_PLUGINS=1 I hope it can work. ... think it cannot work cause it needs to install plugins for general environnement et not for specificfrancois P
tried on my laptop this fails I see the skipped messagesfrancois P
So it is not a solution . I confirm using it as an environment variable doesn't work. Or Need more modifications to call it from files but then how ? is there an example (not found on ansible official site)francois P
You need ANSIBLE_STDOUT_CALLBACK settingKonstantin Suvorov

1 Answers

-4
votes

in the ansible.cfg put stdout_callback = skippy