you could supply (or use an existing) environment variable to signal
that a CI is being used


On Tue, 11 Oct 2022 at 08:03, Neha Singh <[email protected]> wrote:
>
> Hi Team,
>
> I have written one playbook which is calling prompt statement (through pause 
> module) and based on prompt response, it is calling the role. Please find the 
> written playbook below:
>
> - hosts: primary-metal-console:primary-virtual-console
>   gather_facts: yes
>
>   pre_tasks:
>    - name: Verification Step before starting the playbook
>      pause:
>        prompt: "You are starting staging patching playbook on 
> {{ansible_hostname}} \n To  Continue, please enter 'YES'"
>      register: result
>
>   roles:
>    - role: patch_stage
>      when: result.user_input == "YES"
>
> Now, this is working properly while I ran the playbook through CMD. But We 
> have automation (rundeck and soon to be a nightly jenkins patch build) that 
> trigger patch playbooks. This change will break the ability of those 
> playbooks to run. Since the default response is 'NO', any time this playbook 
> is triggered in 'non interactive mode' it won't do anything. I'm fine with 
> the prompt being there, but there needs to be some way for automation to run 
> the playbook. It could be some variable that can be specified to skip the 
> check when playbook runs through automation.
> Overall, is there any way to skip the prompt or that conditional check to 
> call role, while playbook runs through automation?
>
> Thanks & Regards
>
> Neha Singh
>
> --
> 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/693827dc-4a7d-4bba-9adb-b768ccce24fdn%40googlegroups.com.

-- 
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/CAF8BbLaG8N9hRgo%2B_sVN_UgjcLy_njtpU9UJXWqN3C1HyozCmw%40mail.gmail.com.

Reply via email to