0

I am trying to develop a 1 script does many jobs - it is to stop applications within our system etc.

So in this script I want the ability to stop 10 applications, so in the script I am passing a var - genesysNumApps: "{{ genesysNumApps }}" - this is defined in the ansible command.

But then I want to say in the script if this value is equal or less then 5, do not do the following command.

Is this possible?

I am not a expert in this stuff, we have just been given these tasks and I do not want 20 scripts doing the same things but for different applications.

Many thanks, and sorry if I have not explained it clearly

Sorry guys - learning about this forum to lol

The script is running Linux commands and is using a Genesys command interface to stop certain applications

vars:

genesysNumApps: "{{ genesysNumApps }}"
  • action: skip

    only_if: '{{ genesysNumApps }}' = '5'

Martin

Martin
  • 1
  • 1

1 Answers1

0

I'm not quite positive I understand but you can have conditionals on tasks like this:

- debug:
    msg: "Run this task if genesysNumApps is 5."
  when: genesysNumApps == 5
Bernd
  • 112
  • 7