The ansible-doc page for ansible.builtin.shell shows it including the newline [enter].
# You can use shell to run other executables to perform actions inline - name: Run expect to wait for a successful PXE boot via out-of-band CIMC ansible.builtin.shell: | set timeout 300 spawn ssh admin@{{ cimc_host }} expect "password:" send "{{ cimc_password }}\n" expect "\n{{ cimc_name }}" send "connect host\n" expect "pxeboot.n12" send "\n" exit 0 args: executable: /usr/bin/expect delegate_to: localhost Walter -- Walter Rowe, Division Chief Infrastructure Services, OISM Mobile: 202.355.4123 On Sep 26, 2022, at 9:22 AM, Kevin Shumaker <kevin.shuma...@gmail.com<mailto:kevin.shuma...@gmail.com>> wrote: In my non-ansible scripts, I just sent the 'y' or the 'n' ans the request isn't for a "y[enter]" and they (the apps) can get confused when the see something other than what they want... On Monday, September 26, 2022 at 9:17:54 AM UTC-4 uto...@gmail.com<http://gmail.com> wrote: `send "y\n"` is a "y" followed by a new-line character, which may work (I would be surprised), but most of the 'expect' examples I'm seeing would use `send "y\r"` which is a "y" followed by a return. -- 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/54718c1d-ab12-4da6-b3ce-384ad9171d45n%40googlegroups.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F54718c1d-ab12-4da6-b3ce-384ad9171d45n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C73bee14a69fb4c9ab77208da9fc27088%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637997954712794392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gZwbjRNCJwEQIcuiyRhgkd9MTbhfjdek4YLHE6BxVUo%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/8B4895A5-0FA9-4C86-B034-8035AD932E5C%40nist.gov.