OpenSwitch Ansible user with non-bash access

Hi,

We have been using Ansible playbooks to configure OpenSwitch using the ops_template module. For this we have been using admin account that has access to the bash prompt in the OpenSwitch and it has been working fine.

We are making changes to the admin account privileges and default shell for admin account. Admin user will default to “vtysh” shell and with a command “start-shell” moves to bash.

With this change, the playbook (the below command) will fail as bash access is not available. Can some please suggest how to fix this issue ? Basically we want to use an user in the playbook that doesn’t have bash access.

ansible-playbook .yaml -vvv

SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/home/master/.ansible/cp/ansible-ssh-%h-%p-%r ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1468907294.61-280623960073589” && echo ansible-tmp-1468907294.61-280623960073589=“echo $HOME/.ansible/tmp/ansible-tmp-1468907294.61-280623960073589” ) && sleep 0’“'”‘’

We tried passing start-shell to the ssh command above, but it doesn’t work.

Thanks,
Ganesh

I suspect that will require a feature update to the existing module… can you file an issue at github.com/ansible/ansible-modules-core so we can track this? thanks