Ansible uses SSH to connect to hosts, where it then executes tasks on the those hosts as that user. For some tasks, escalated system privileges are required. To execute escalated system privileged tasks, the user you use to connect to the remote hosts as should be configured with full sudo privileges on the remote hosts. Ansible uses sudo to become the root user, in order to execute those system level tasks requiring root privileges. As a consequence of this privilege requirement, the connection parameters used when running the Ansible playbooks to install or upgrade ServAssure products, must be defined at run time.
CommScope recommends the following parameters when running Ansible commands:
ansible-playbook -b -i host_inventoryplaybookName -u user -k -K
Where the parameters are:
- -i
- Represents the next line to be the location of the inventory file to use host_inventory. For example: /opt/arris/ansible/inventory/host_inventory.
- playbookName
- The file name of the Ansible playbook to execute.
- -u remote_user
- The username used when connecting to the host servers from Ansible.
- -b
- become — The user becomes sudo to perform all the necessary steps in installing the application.
- -k
- ask-pass — Prompt for the user password to be entered if required.
- -K
- ask-become-pass — Prompt for the password to enable the user to use sudo functions, if required.
In general, these parameters provide the best connection success, and prevent issues with some Ansible tasks that may fail due to incorrect privilege setup.
![Screen capture of command line prompts. First is "SSH password:" the second is "BECOME password[defaults to SSH password]:"](GUID-11B6202C-3B45-4DD1-A103-8EB28317D209-low.png)
For the first prompt, enter the password for the specified remote_user, for the second prompt, BECOME password[defaults to SSH password]:, enter the password of the "arris" account.
