Thanks to all.
This is what I'm doing:
Playbook:
---
- name: Connect to remote IRIS DB
hosts: localhost
tasks:
- name: using my custom module
IRIS: <-- New Module
name: superuser
password: secret
instance: SCR
namespace: WORK
commands:
- w !,”Hello”
- w !,”World”
register: result
- name: show output
debug:
var: result
This is the logic:
ssh localhost
iris session “{{instance}}” -U "{{namespace}}" <- connecting to IRIS DB
username: "{{name}}" <- send
variable name when username prompt
password: "{{password}}" < - send
variable password when password prompt
>“{{commands[0]}}” < - send
variable command when > prompt
>“{{commands[1]}}”
H
On Monday, December 5, 2022 at 10:47:21 PM UTC+11 Michael Ströder wrote:
> On 12/5/22 09:23, phillip.from.oz wrote:
> > When writing Ansible custom module, how is the code (python) connect to
> > the remote host?
> >
> > Is it the code of the Ansible custom module responsible for ssh to the
> > remote host?
>
> No, for most modules.
>
> I'd recommend that you describe what you're trying to achieve.
>
> Ciao, Michael.
>
>
--
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/e7e74f21-45d1-488f-a486-cab1788a6842n%40googlegroups.com.