如何在不使用 Ansible 的情况下使用 ansible希望创建 nessus 用户 (nessuscli)来执行与此处相同的操作?我正在尝试没有运气:
#!/usr/bin/expect -f
set timeout -5
spawn /opt/nessus/sbin/nessuscli adduser
expect "(.*)Login(.*):\r"
send -- "admin\r"
expect "(.*)Login password(.*)\r" send -- "password\r"
expect "(.*)Login password(.*)\r" send -- "password\r"
expect "(.*)system administrator(.*)\r" send -- "y\r"
expect "(.*)rules set(.*):\r" send -- "\n\r"
expect "(.*)ok(.*):\r" send -- "y\r"
expect eof