Hi again
For simplicity I thought to do like this.
Current code
- name: Subscribe my repo
shell: |
subscription-manager register bla bla
*After*
- name: Subscribe US REPO
shell: |
subscription-manager register US server
When:
IS_UK = false
- name: Subscribe UK REPO
shell: |
subscription-manager register UK server
When:
IS_UK = True
Regards
PD
On Thu, 7 Mar 2024 at 22:44, Prady A <[email protected]> wrote:
> Hi TODD,
>
> Thanks for your reply.
> Yes I ve that variable(IS_UK= TRUE)
> defined already and it is coming from upstream.
> Just need to the logic for efficient if then syntax in ansible.
>
> Secondly subscription manager is shell command.
>
> Regards
> Prady
>
> On Thu, 7 Mar 2024 at 21:42, Todd Lewis <[email protected]> wrote:
>
>> Is "Subscription-manager" a command you want to run, or part of a string
>> you're trying to initialize, or are you trying to set a variable for later
>> use?
>> Is "IS_UK" a variable you already have, or is the problem how to create
>> or set "IS_UK" itself?
>>
>> In other words, you've described very well what you want to do, but you
>> haven't described at all the problem(s) you've encountered doing it with
>> Ansible.
>>
>>
>> On 3/7/24 12:14 AM, Prady A wrote:
>>
>> Hi Ansible experts
>>
>> I am confused which one to use
>>
>> I want to subscribe US servers default but if the server is in UK I want
>> to subscription should Point to UK capsule server..
>>
>> If IS_UK= TRUE
>> Subscription-manager <UK CAPSUSULE SERVER>
>> then
>> Subscription-manager <US CAPSUSULE SERVER>
>>
>>
>> Regards
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAEuB3ArAMzXhjok0YTnJ40a3QbCKm2-pAhR%2Bb%3DRn3m%3DLiPkmgQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAEuB3ArAMzXhjok0YTnJ40a3QbCKm2-pAhR%2Bb%3DRn3m%3DLiPkmgQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>
>> --
>> Todd
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/955e9331-132a-4140-9a31-160e0bb30a07%40gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/955e9331-132a-4140-9a31-160e0bb30a07%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAEuB3AoE4obGmXGitM%3Dp-9d4EG2tMyswrGAq4-rbGv60sqVrQQ%40mail.gmail.com.