Your ansible playbook can run the shell command and pass these vars as values 
on the command line.

- shell: "my_script {{ jenkins_var1 }} {{ jenkins_var2 }} {{ jenkins_var3 }}"

As I said they come into the playbook as ansible extra_vars. If your survey 
accepts values for these three vars and your Jenkins web services call provides 
them with values in JSON format "{ 'jenkins_var1': 'val1', 'jenkins_var2': 
'val2', 'jenkins_var3': 'val3 }" then it all glues together. Read the 
documentation and learn the modules and ansible syntax.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Feb 7, 2023, at 12:42 PM, Linux Study <linuxstu...@gmail.com> wrote:

But how can we pass this values to bash script on remote server?

On Tue, 7 Feb 2023, 18:19 'Rowe, Walter P. (Fed)' via Ansible Project, 
<ansible-project@googlegroups.com<mailto:ansible-project@googlegroups.com>> 
wrote:
Since you are submitting the job via Jenkins and web services you can use a 
survey on the ansible tower workflow to define variables. The web services call 
can supply their values. Ansible Tower will provide these variables to your 
playbook(s) as extra_vars. Read the ansible tower api docs to see how they pass 
JSON into the API with these key:value pairs of variables and their values.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Feb 7, 2023, at 2:56 AM, Linux Study 
<linuxstu...@gmail.com<mailto:linuxstu...@gmail.com>> wrote:

We are  executing via jenkins and it will call ansible tower to run playbook...

Regards,
Abhijit

On Tue, 7 Feb 2023, 01:03 'Rowe, Walter P. (Fed)' via Ansible Project, 
<ansible-project@googlegroups.com<mailto:ansible-project@googlegroups.com>> 
wrote:
How is the ansible playbook being run? command line? ansible automation 
platform?

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Feb 6, 2023, at 1:35 PM, Linux Study 
<linuxstu...@gmail.com<mailto:linuxstu...@gmail.com>> wrote:

Hi All,

Is there way to pass user inputs to bash script via ansible?


Regards,
Abhi

--
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 
ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFzU8q%2BgQgGE9QJu6WkhVWsW_6EDNh2aQ%3DVaxq%2BO1cBybw%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFzU8q%252BgQgGE9QJu6WkhVWsW_6EDNh2aQ%253DVaxq%252BO1cBybw%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C3b393c0a47344c2ce2bd08db0932c561%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638113885882881789%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xaqWXZNsmtZFZJHfaNcL%2Fm7UNgAEIxMfNNtBTQms1dQ%3D&reserved=0>.


--
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 
ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/DEFA92BC-5E3D-4AA9-A102-7EED0794DCA8%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FDEFA92BC-5E3D-4AA9-A102-7EED0794DCA8%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C3b393c0a47344c2ce2bd08db0932c561%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638113885882881789%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FliHuK4X2OF0Hn6B7WL7q58B7i7okD%2FPE2ZaOnJ4g%2Bs%3D&reserved=0>.

--
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 
ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFw%2BaB2Sm_LQ9DTc6Mqb-O_eznR00ZbvZrRPr_e9EoW4GQ%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFw%252BaB2Sm_LQ9DTc6Mqb-O_eznR00ZbvZrRPr_e9EoW4GQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C3b393c0a47344c2ce2bd08db0932c561%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638113885882881789%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=z%2FrxP4iQ9ApK3wRMEWVkbcUFjgvTvkibHBicJI6cVg4%3D&reserved=0>.


--
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 
ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/E9B44F7C-58A5-496F-844C-60CDBC6B1A06%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FE9B44F7C-58A5-496F-844C-60CDBC6B1A06%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C3b393c0a47344c2ce2bd08db0932c561%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638113885882881789%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GrtW8taLcG5jYOrL%2B3JSa6KlEnQ6KKrxO8z88LFPpEA%3D&reserved=0>.

--
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 
ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFxCyAp3u%2BpjWgn8Q2vBzbArp0-KCf8%3D_kdaTrRnF-kaaw%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFxCyAp3u%252BpjWgn8Q2vBzbArp0-KCf8%253D_kdaTrRnF-kaaw%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C3b393c0a47344c2ce2bd08db0932c561%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638113885882881789%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fNcQWovdEtdd%2BC1g2kHdKPTD5CTwxtJcDiKRflo2300%3D&reserved=0>.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/51F3A45D-115A-4901-A246-48587AEF9496%40nist.gov.

Reply via email to