Hi All, I am facing similar issues with the enable mode, wondering if we were able to find a solution to this.
Thank you very much in advance. Your help is really really appreciated. Regards, Konpal Maharwal On Thursday, 22 December 2022 at 13:18:41 UTC [email protected] wrote: > Dear all, > > Does anybody know how to perform the privilege escalation to "enable" in > Proxy SG via Ansible? > > I have tried the following code, with no luck: > > ****OS = JUNOS because I could not find SG OS and somebody told us to use > "junos" instead. It works to launch regular commands but It does not work > to escalate to "enable".* > > - hosts: bluecoat > gather_facts: no > connection: local > vars: > ansible_connection: network_cli > ansible_user: "{{ lookup('env', 'ANSIBLE_NET_USERNAME') }}" > ansible_password: "{{ lookup('env', 'ANSIBLE_NET_PASSWORD') }}" > ansible_port: 22 > ansible_network_os: junos > tasks: > > - name: Show SSL Keyring > cli_command: > command: "show ssl keyring" > #### prompt: "Password:" > #### answer: "{{ lookup('env', 'ANSIBLE_NET_PASSWORD') }}" > vars: > ansible_become: yes > ansible_become_method: enable > ansible_become_password: "{{ lookup('env', 'ANSIBLE_NET_PASSWORD') > }}" > register: ssl_keyring > > > *Error:* It says "invalid input" because the command only works in > *enable* mode, so the escalation did not work. > > { > "changed": false, > "stdout": "^\n% Invalid input detected at '^' marker.", > "invocation": { > "module_args": { > "command": "show ssl keyring", > "newline": true, > "sendonly": false, > "check_all": false, > "prompt": null, > "answer": null > } > }, > "stdout_lines": [ > "^", > "% Invalid input detected at '^' marker." > ], > "_ansible_no_log": false > } > > Thank you very much in advance. Your help is really really appreciated. > > Regards, > Vicente. > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d0af43b6-e1bf-4bb9-b97a-8b32d8ed8c68n%40googlegroups.com.
