Yes kai it was the problem!

Now i am sure the number of exit is correct and the configuration go fine, 
at the end now i get this message, even if the configuration is done i get 
such an error how can i avoid it? I mean now this error it is not an error, 
after i finished the configuration i exited the CLI and that's all.

*fatal: [stefano2]: FAILED! => {*
*    "changed": true,*
*    "cmd": "telnet 0 2200",*
*    "delta": "0:00:01.291377",*
*    "end": "2017-11-17 17:42:29.319194",*
*    "failed": true,*
*    "invocation": {*
*        "module_args": {*
*            "chdir": null,*
*            "command": "telnet 0 2200",*
*            "creates": null,*
*            "echo": false,*
*            "removes": null,*
*            "responses": {*
*                "Enable Common Criteria Compatibility mode.*": "n",*
*                "Enable Secure Backup mode.*": "n",*
*                "Password": "password",*
*                "Press any key to continue\\.": "",*
*                "idg#": [*
*                    "configure terminal",*
*                    "exit"*
*                ],*
*                "idg\\(config web-mgmt\\)#": [*
*                    "admin-state enabled",*
*                    "local-address 127.0.0.1 9090",*
*                    "exit"*
*                ],*
*                "idg\\(config\\)#": [*
*                    "web-mgmt",*
*                    "write memory",*
*                    "exit"*
*                ],*
*                "login": "admin"*
*            },*
*            "timeout": 30*
*        }*
*    },*
*    "msg": "non-zero return code",*
*    "rc": 1,*
*    "start": "2017-11-17 17:42:28.027817",*
*    "stdout": "Trying 0.0.0.0...\r\r\nConnected to 0.\r\r\nEscape 
character is '^]'.\r\r\nstefano2.prv\r\nUnauthorized access 
prohibited.\r\nlogin: admin\r\nPassword: 
*********\r\n**************************************************************** 
\r\nATTENTION: Use care when making your selections for operational 
\r\nmodes. If you select an incorrect mode for your environment, \r\nthe 
only way to change an operational mode is to reinitialize \r\nthe 
appliance. \r\n\r\nPress any key to 
continue.\r\n**************************************************************** 
\r\n\nSecure backup mode allows you to create a secure backup to recover 
the \r\nconfiguration of an appliance. A secure backup contains private 
data from \r\nthe appliance, including certificates, keys, and user data. 
\r\nYou cannot see the data in the backup, for only a DataPower appliance 
can decrypt the backup. \r\n\r\nYou should enable this mode to create 
secure backups for use after an \r\nappliance failure or during end-of-life 
migration. \r\n\r\nEnable Secure Backup mode? Yes/No [y/n]:n\r\n\nCommon 
Criteria places the appliance in a mode that \r\nenforces a set of policies 
that is required to pass Common Criteria \r\nsecurity testing 
(EAL4).\r\n\r\nIf you are unsure about whether to enable this mode, you 
should probably \r\nanswer no.\r\n\r\nEnable Common Criteria Compatibility 
mode? Yes/No [y/n]: n\r\n\r\nWelcome to IBM DataPower Gateway console 
configuration. \r\nCopyright IBM Corporation 1999-2016 \r\n\r\nVersion: 
IDG.7.5.0.0 build 274960 on Mar 11, 2016 3:09:45 PM\r\nSerial number: 
0000001\r\n\r\n\r\n% The platform or the OS distribution is not 
supported\r\n\r\n\r\n% The appliance is in failsafe console mode. Only the 
default domain and a serial console interface are active. In this failsafe 
mode the appliance cannot accept client requests. Contact IBM 
Support.\r\n\r\nYou must read and agree to the terms of the license 
agreement using the WebGUI.\r\nIf you did not configure the Web Management 
Interface, you must do it now with \r\nthe following command:\r\n configure 
terminal;web-mgmt;admin-state enabled;local-address 0 9090;exit\r\n\r\nidg# 
configure terminal\r\nGlobal configuration mode\r\nidg(config)# 
web-mgmt\r\nModify Web Management Service configuration\r\n\r\nidg(config 
web-mgmt)# admin-state enabled\r\nidg(config web-mgmt)# local-address 
127.0.0.1 9090\r\nidg(config web-mgmt)# exit\r\n\r\n% The appliance is in 
failsafe console mode. Only the default domain and a serial console 
interface are active. In this failsafe mode the appliance cannot accept 
client requests. Contact IBM Support.\r\n\r\nidg(config)# write 
memory\r\n\r\n% Saving configuration failed - disabled.\r\n\r\nidg(config)# 
exit\r\n\r\n% The appliance is in failsafe console mode. Only the default 
domain and a serial console interface are active. In this failsafe mode the 
appliance cannot accept client requests. Contact IBM Support.\r\n\r\nidg# 
exit\r\nGoodbye.\r\nConnection closed by foreign host.",*
*    "stdout_lines": [*
*        "Trying 0.0.0.0...",*
*        "",*
*        "Connected to 0.",*
*        "",*
*        "Escape character is '^]'.",*
*        "",*
*        "stefano2.prv",*
*        "Unauthorized access prohibited.",*
*        "login: admin",*
*        "Password: *********",*
*        "**************************************************************** 
",*
*        "ATTENTION: Use care when making your selections for operational 
",*
*        "modes. If you select an incorrect mode for your environment, ",*
*        "the only way to change an operational mode is to reinitialize ",*
*        "the appliance. ",*
*        "",*
*        "Press any key to continue.",*
*        "**************************************************************** 
",*
*        "",*
*        "Secure backup mode allows you to create a secure backup to 
recover the ",*
*        "configuration of an appliance. A secure backup contains private 
data from ",*
*        "the appliance, including certificates, keys, and user data. ",*
*        "You cannot see the data in the backup, for only a DataPower 
appliance can decrypt the backup. ",*
*        "",*
*        "You should enable this mode to create secure backups for use 
after an ",*
*        "appliance failure or during end-of-life migration. ",*
*        "",*
*        "Enable Secure Backup mode? Yes/No [y/n]:n",*
*        "",*
*        "Common Criteria places the appliance in a mode that ",*
*        "enforces a set of policies that is required to pass Common 
Criteria ",*
*        "security testing (EAL4).",*
*        "",*
*        "If you are unsure about whether to enable this mode, you should 
probably ",*
*        "answer no.",*
*        "",*
*        "Enable Common Criteria Compatibility mode? Yes/No [y/n]: n",*
*        "",*
*        "Welcome to IBM DataPower Gateway console configuration. ",*
*        "Copyright IBM Corporation 1999-2016 ",*
*        "",*
*        "Version: IDG.7.5.0.0 build 274960 on Mar 11, 2016 3:09:45 PM",*
*        "Serial number: 0000001",*
*        "",*
*        "",*
*        "% The platform or the OS distribution is not supported",*
*        "",*
*        "",*
*        "% The appliance is in failsafe console mode. Only the default 
domain and a serial console interface are active. In this failsafe mode the 
appliance cannot accept client requests. Contact IBM Support.",*
*        "",*
*        "You must read and agree to the terms of the license agreement 
using the WebGUI.",*
*        "If you did not configure the Web Management Interface, you must 
do it now with ",*
*        "the following command:",*
*        " configure terminal;web-mgmt;admin-state enabled;local-address 0 
9090;exit",*
*        "",*
*        "idg# configure terminal",*
*        "Global configuration mode",*
*        "idg(config)# web-mgmt",*
*        "Modify Web Management Service configuration",*
*        "",*
*        "idg(config web-mgmt)# admin-state enabled",*
*        "idg(config web-mgmt)# local-address 127.0.0.1 9090",*
*        "idg(config web-mgmt)# exit",*
*        "",*
*        "% The appliance is in failsafe console mode. Only the default 
domain and a serial console interface are active. In this failsafe mode the 
appliance cannot accept client requests. Contact IBM Support.",*
*        "",*
*        "idg(config)# write memory",*
*        "",*
*        "% Saving configuration failed - disabled.",*
*        "",*
*        "idg(config)# exit",*
*        "",*
*        "% The appliance is in failsafe console mode. Only the default 
domain and a serial console interface are active. In this failsafe mode the 
appliance cannot accept client requests. Contact IBM Support.",*
*        "",*
*        "idg# exit",*
*        "Goodbye.",*
*        "Connection closed by foreign host."*
*    ]*
*}*
  

On Wednesday, 15 November 2017 15:07:58 UTC+1, [email protected] 
wrote:
>
> HI
>
> I created an ansble role which install on the target hosts IBM api connect 
> gateways software and enable the service.
> I would improve this role adding configuration steps.
>
> After the installation the APIC gateways need to be configured accessing 
> to a dedicated command line interface, the first access is made of the 
> following steps:
>
> $ telnet 0 2200      *//command to launch to access the CLI*
> Trying 0.0.0.0...
> Connected to 0.
> Escape character is '^]'.
> stefano2.prv
> Unauthorized access prohibited.
>
> login: user          *//here i need to write the username*
> Password: *****  *// as well as the password*
>
> ****************************************************************
> ATTENTION: Use care when making your selections for operational
> modes. If you select an incorrect mode for your environment,
> the only way to change an operational mode is to reinitialize
> the appliance.
>
> Press any key to continue.
> ****************************************************************
>
> I'm stuck here, i tried to add these lines:
>
>  * - name: Launch the CLI first time*
> *    expect:*
> *      command: telnet 0 2200*
> *      responses:*
> *        Question:*
> *          login: "user"*
> *          Password: "password"*
> *          Press any key to continue.: /bin/bash -c "echo"*
>
> Every time i try to run the role i gt this error at the end:
>
> *TASK [Launch the CLI first time] 
> *************************************************************************************************************************************************************************
> *fatal: [stefano3]: FAILED! => {"changed": false, "failed": true, "msg": 
> "The pexpect python module is required"}*
> *fatal: [stefano2]: FAILED! => {"changed": false, "failed": true, "msg": 
> "The pexpect python module is required"}*
> *        to retry, use: --limit @/etc/ansible/api_gateways/apigw.retry*
>
> Could you help me? 
> How can i answer to the "Press any key to continue"? 
>
> Or maybe there are further errors i did not get in the previous steps.
>
>
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d3111570-0a25-409d-8562-936533d1deda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to