You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a tiny remark: When you have the above, mostly one will want/need to use another user than root, at least to access the system.
Instead of using -u root one may prefer to add --sudo, so that the non-root ansible user will try to execute the command using sudo.
eg: ansible ws01 -m yum -a 'pkg=vim-enhanced state=installed' -i hosts -u remadmin --sudo
Where remadmin is a user that can do keybased ssh to the system ws01 and is a nopasswd sudoer.
The text was updated successfully, but these errors were encountered:
- name: install latest version of apacheyum:
name: httpd state: latest
Issue-
"msg": "You need to be root to perform this command.\n",
"rc": 1,
"results": [
"Loaded plugins: product-id, search-disabled-repos, subscription-manager\n"
]
Just a tiny remark: When you have the above, mostly one will want/need to use another user than root, at least to access the system.
Instead of using
-u root
one may prefer to add--sudo
, so that the non-root ansible user will try to execute the command using sudo.eg:
ansible ws01 -m yum -a 'pkg=vim-enhanced state=installed' -i hosts -u remadmin --sudo
Where
remadmin
is a user that can do keybased ssh to the system ws01 and is a nopasswd sudoer.The text was updated successfully, but these errors were encountered: