ibmi_tcp_server_service – Manage tcp server
Synopsis
Manage and query IBMi tcp server service.
For non-IBMi targets, use the ansible.builtin.service module instead.
Parameters
- become_user
The name of the user profile that the IBM i task will run under.
Use this option to set a user with desired privileges to run the task.
required: falsetype: str- become_user_password
Use this option to set the password of the user specified in
become_user.required: falsetype: str- extra_parameters
Extra parameter is appended at the end of tcp server service command.
required: falsetype: strdefault:- joblog
If set to
true, append JOBLOG to stderr/stderr_lines.required: falsetype: bool- name_list
The name of the tcp server service. The valid value are
*ALL,*AUTOSTART,*BOOTP,*DBG,*DDM,*DHCP,*DIRSRV,*DLFM,*DNS,*DOMINO,*EDRSQL,*FTP,*HTTP,*HOD,*IAS,*INETD,*LPD,*MGTC,*NETSVR,*NSLD,*NTP,*ODPA,*OMPROUTED,*ONDMD,*POP,*QOS,*REXEC,*ROUTED,*SLP,*SMTP,*SNMP,*SRVSPTPRX,*SSHD,*TCM,*TELNET,*TFTP,*VPN,*WEBFACING.required: Truetype: listelements: str- state
started/stoppedare idempotent actions that will not run commands unless necessary.required: Truetype: strchoices: started, stopped
Examples
- name: Start http server with tcp server service
ibm.power_ibmi.ibmi_tcp_server_service:
name_list: ['*HTTP']
state: 'started'
joblog: True
- name: Stop ssh server
ibm.power_ibmi.ibmi_tcp_server_service:
name_list: ['*SSH']
state: 'stopped'
joblog: True
- name: Restart ssh server (in the same playbook as stopping ssh server)
ibm.power_ibmi.ibmi_tcp_server_service:
name_list: ['*SSH']
state: 'started'
joblog: True
See Also
See also
service_module
Return Values
- job_log
The IBM i job log of the task executed.returned: alwaystype: listsample:[{"FROM_INSTRUCTION": "318F", "FROM_LIBRARY": "QSYS", "FROM_MODULE": "", "FROM_PROCEDURE": "", "FROM_PROGRAM": "QWTCHGJB", "FROM_USER": "CHANGLE", "MESSAGE_FILE": "QCPFMSG", "MESSAGE_ID": "CPD0912", "MESSAGE_LIBRARY": "QSYS", "MESSAGE_SECOND_LEVEL_TEXT": "Cause . . . . . : This message is used by application programs as a general escape message.", "MESSAGE_SUBTYPE": "", "MESSAGE_TEXT": "Printer device PRT01 not found.", "MESSAGE_TIMESTAMP": "2020-05-20-21.41.40.845897", "MESSAGE_TYPE": "DIAGNOSTIC", "ORDINAL_POSITION": "5", "SEVERITY": "20", "TO_INSTRUCTION": "9369", "TO_LIBRARY": "QSYS", "TO_MODULE": "QSQSRVR", "TO_PROCEDURE": "QSQSRVR", "TO_PROGRAM": "QSQSRVR"}]- start
The command execution start time.returned: alwaystype: strsample: 2019-12-02 11:07:53.757435- end
The command execution end time.returned: alwaystype: strsample: 2019-12-02 11:07:54.064969- delta
The command execution delta time.returned: alwaystype: strsample: 0:00:00.307534- stdout
The command standard output.returned: alwaystype: strsample: CPC2102: Library TESTLIB created- stderr
The command standard error.returned: alwaystype: strsample: CPF2111:Library TESTLIB already exists- cmd
The command executed by the task.returned: alwaystype: strsample: CRTLIB LIB(TESTLIB)- rc
The command return code (0 means success, non-zero means failure).returned: alwaystype: intsample: 255- stdout_lines
The command standard output split in lines.returned: alwaystype: listsample:["CPC2102: Library TESTLIB created."]- stderr_lines
The command standard error split in lines.returned: alwaystype: listsample:["CPF2111:Library TESTLIB already exists."]