We are trying the following
- name: Configure Orion Agent
shell: |
set timeout 30
spawn service swiagentd init
expect “Choose an option>”
send “2”
exit 0
args:
executable: /usr/bin/expect
We are able to spawn the process but it looks like the expect part never works
“changed”: true,
“cmd”: “set timeout 30\n spawn service swiagentd init\n\n expect "Choose an option>"\n send "2"\n\n exit 0”,
“delta”: “0:00:00.132261”,
“end”: “2019-01-15 10:08:43.611145”,
“invocation”: {
“module_args”: {
“_raw_params”: “set timeout 30\n spawn service swiagentd init\n\n expect "Choose an option>"\n send "2"\n\n exit 0”,
“_uses_shell”: true,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: “/usr/bin/expect”,
“removes”: null,
“stdin”: null,
“warn”: true
}
},
“rc”: 0,
“start”: “2019-01-15 10:08:43.478884”,
“stderr”: “”,
“stderr_lines”: ,
“stdout”: “spawn service swiagentd init\r\n\r\nSolarWinds Orion Agent [2.0.0.70] Settings, OpenSSL [OpenSSL 1.0.2k-fips 26 Jan 2017]\r\n 0. Cancel and Exit without Saving\r\n 1. Agent Mode (1 - Agent Initiated, 0 - Server Initiated) [1]\r\n 2. Orion Poller Hostname/IP [localhost]\r\n 3. Orion Poller Port [17778]\r\n 4. Orion Username [admin]\r\n 5. Orion Password \r\n 6. Proxy Settings… [mode=disabled]\r\n 7. Save Changes and Exit\r\n\r\nChoose an option>”,
“stdout_lines”: [
“spawn service swiagentd init”,
“”,
“SolarWinds Orion Agent [2.0.0.70] Settings, OpenSSL [OpenSSL 1.0.2k-fips 26 Jan 2017]”,
" 0. Cancel and Exit without Saving",
" 1. Agent Mode (1 - Agent Initiated, 0 - Server Initiated) [1]",
" 2. Orion Poller Hostname/IP [localhost]",
" 3. Orion Poller Port [17778]",
" 4. Orion Username [admin]",
" 5. Orion Password ",
" 6. Proxy Settings… [mode=disabled]",
" 7. Save Changes and Exit",
“”,
“Choose an option>”
]
}