Dear All,
Thanks alot for the pointers.
This is what I finally used to get it working.
- name: Install Java update for Netbackup
shell: |
set timeout 300
spawn /usr/openv/netbackup/bin/goodies/nbcomponentupdate -product
NetBackup -component jre -path /tmp/jdk1.8.0_341
Hello Andrew,
Why not use Ansible's "expect" module instead?
I've been using it in a playbook to perform an interactive installation and
that module works just fine as the expect Shell command:
- name: install ahf
expect:
echo: yes
timeout: null
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 admi
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 wrote:
> `send "y\n"` is a "y" followed by
`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.
On Monday, September 26, 2022 at 9:07:51 AM UTC-4 kevin.s...@gmail.com
wrote:
> Is 'send "y\n"
Is 'send "y\n" ' a valid response to the expect? Or should it be just "y"
or just "n"?
On Monday, September 26, 2022 at 9:05:01 AM UTC-4 aok...@gmail.com wrote:
> Thanks @Walter. Let me try and revert.
>
> Kind Regards
> Andrew Okullu
> Mob:+256-772-418560 <+256%20772%20418560>, +256754213295
Thanks @Walter. Let me try and revert.
Kind Regards
Andrew Okullu
Mob:+256-772-418560, +256754213295
| Skype:aokullu | twitter: @aokullu | gtalk: aokullu
On Mon, Sep 26, 2022 at 3:58 PM 'Rowe, Walter P. (Fed)' via Ansible Project
wrote:
> Also note they specifically tell the shell module that
Also note they specifically tell the shell module that expect is the
executable. See blue bold text below.
- 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
Here is an example of using expect from the ansible-doc shell output.
# 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 }}
Dear Team
i have an issue. I have written a playbook that will perform and update of
the netbackup java.
Expect section
- name: Install
shell: |
set timeout -1
log_file /tmp/nbexpect.log
spawn /usr/openv
10 matches
Mail list logo