Become and network automation
As of version 2.6, Ansible supportsbecomefor privilege escalation (enteringenablemode or privileged EXEC mode) on all Ansible-maintained network platforms that supportenablemode. Usingbecomereplaces theauthorizeandauth_passoptions in aproviderdictionary.
You must set the connection type to eitherconnection:ansible.netcommon.network_cliorconnection:ansible.netcommon.httpapito usebecomefor privilege escalation on network devices. Check thePlatform Optionsdocumentation for details.
You can use escalated privileges on only the specific tasks that need them, on an entire play, or on all plays. Addingbecome:trueandbecome_method:enableinstructs Ansible to enterenablemode before executing the task, play, or playbook where those parameters are set.
If you see this error message, the task that generated it requiresenablemode to succeed:
To setenablemode for a specific task, addbecomeat the task level:
To set enable mode for all tasks in a single play, addbecomeat the play level: