Re: [ansible-project] Handling "file not found" for the slurp module

2022-09-26 Thread Dick Visser
Add a stat task first and use the result to conditionally run the slurp task On Tue, 27 Sep 2022 at 05:10, Shabir Abdul Samdh wrote: > Hello All, > > I am trying to read a file from a remote host and do some checks on its > content using the slurp module >

[ansible-project] Handling "file not found" for the slurp module

2022-09-26 Thread Shabir Abdul Samdh
Hello All, I am trying to read a file from a remote host and do some checks on its content using the slurp module . However I want these checks to run only if the file exists. If the file is not found I want to

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread Alex Wanderley
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

Re: [ansible-project] become_password and ansibe variable

2022-09-26 Thread 'Django [Bastard Operator from Hell]' via Ansible Project
O.K., no problem, so I ask 'bout that password while the initial ansible-configuration done by my ansible-playbook. Then it will be stored in my inventory and everything works fine as ecpected. Thanx 4 help! -- You received this message because you are subscribed to the Google Groups "Ansible

Re: [ansible-project] become_password and ansibe variable

2022-09-26 Thread Brian Coca
No, this is specifically avoided. -- -- Brian Coca -- 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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread Kevin Shumaker
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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread Todd Lewis
`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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread Kevin Shumaker
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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread Andrew Okullu
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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
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

Re: [ansible-project] Expect still prompting to continue

2022-09-26 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
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 }}

[ansible-project] Expect still prompting to continue

2022-09-26 Thread Andrew Okullu
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

Re: [ansible-project] creating a postgres user - non default postgres port

2022-09-26 Thread Dick Visser
This is correct, you supplied the port parameter at the task level itself, while you should provide it to the task. Indent one level more. On Mon, 26 Sep 2022 at 12:10, dulhaver via Ansible Project < ansible-project@googlegroups.com> wrote: > I am trying to create a postgres user/role with >

[ansible-project] creating a postgres user - non default postgres port

2022-09-26 Thread dulhaver via Ansible Project
I am trying to create a postgres user/role with community.postgresql.postgresql_user. The instance I am trying to address runs on port 5436 so my TASK looks like - name: create db admin user

Re: [ansible-project] create variable from value gathered on remote

2022-09-26 Thread Todd Lewis
Better put a `-n` on that `sort`. On Tuesday, September 20, 2022 at 5:13:40 AM UTC-4 dulh...@mailbox.org wrote: > this is how I manged this in the end. probably the solution suggested by > @Vladimit Botka is more scientific but I could not indorporate the find > operation required with the