You need to be root to execute - ansibleAnsible sudo does not workAnsible cannot make dir /$HOME/.ansible/cpReload PATH for the entire playbookansible playbook: setup and connect to docker (authentication or permission failure)getting MODULE FAILURE error with pipelining = True in ansibleAnsible : You should rebuild using libgmp >= 5 to avoid timing attack vulnerabilityyum distro-sync on ansibleAnsible service task fails with “Could not find the requested service XXX”Installing package via Ansible using a user with limited sudo rightsRun Same Ansible Playbook for Different Local Users
How can a jailer prevent the Forge Cleric's Artisan's Blessing from being used?
node command while defining a coordinate in TikZ
Installing PowerShell on 32-bit Kali OS fails
Lightning Web Component - do I need to track changes for every single input field in a form
What does the "3am" section means in manpages?
Simple recursive Sudoku solver
Can I use my Chinese passport to enter China after I acquired another citizenship?
Golf game boilerplate
Is there an Impartial Brexit Deal comparison site?
Pronouncing Homer as in modern Greek
Why are on-board computers allowed to change controls without notifying the pilots?
A workplace installs custom certificates on personal devices, can this be used to decrypt HTTPS traffic?
Is a naturally all "male" species possible?
In Star Trek IV, why did the Bounty go back to a time when whales were already rare?
Teaching indefinite integrals that require special-casing
What (else) happened July 1st 1858 in London?
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Can a Bard use an arcane focus?
How do I repair my stair bannister?
What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?
Can a Gentile theist be saved?
Java - What do constructor type arguments mean when placed *before* the type?
Simulating a probability of 1 of 2^N with less than N random bits
Can I rely on these GitHub repository files?
You need to be root to execute - ansible
Ansible sudo does not workAnsible cannot make dir /$HOME/.ansible/cpReload PATH for the entire playbookansible playbook: setup and connect to docker (authentication or permission failure)getting MODULE FAILURE error with pipelining = True in ansibleAnsible : You should rebuild using libgmp >= 5 to avoid timing attack vulnerabilityyum distro-sync on ansibleAnsible service task fails with “Could not find the requested service XXX”Installing package via Ansible using a user with limited sudo rightsRun Same Ansible Playbook for Different Local Users
I have a lab setup with ansible controller + node and exploring few areas.
I am so far setup an user account named ansible
in both machines and enabled ssh keybased authentication
Also setup sudo premissions for the user in both machines
When I try to run the below playbook , It works on the local machine and fails on the other node.
--- #Install Telnet
- hosts: all
name: Install Telnet
become: true
become_user: ansible
become_method: sudo
tasks:
- yum:
name: telnet
state: latest
Output is as follows
`[ansible@host1 playbooks]$ ansible-playbook telnetDeployYUM.yml
PLAY [Install Telnet] ***********************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.64.6]
ok: [192.168.64.5]
TASK [yum] **********************************************************************************************************************************************************************************
ok: [192.168.64.5]
fatal: [192.168.64.6]: FAILED! => "changed": true, "msg": "You need to be root to perform this command.n", "obsoletes": "grub2": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "grub2-tools": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "rc": 1, "results": ["Loaded plugins: fastestmirrorn"]
to retry, use: --limit @/home/ansible/playbooks/telnetDeployYUM.retry
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.64.5 : ok=2 changed=0 unreachable=0 failed=0
192.168.64.6 : ok=1 changed=0 unreachable=0 failed=1
[ansible@host1 playbooks]$
`
I could also manually able to run sudo yum
on the failed target as ansible user
I believe sudo set up in correct
[ansible@host2 root]$ sudo whoami
root
Can experts share some insights on what I am missing with respect to my failed machine , Thanks.
ansible
add a comment |
I have a lab setup with ansible controller + node and exploring few areas.
I am so far setup an user account named ansible
in both machines and enabled ssh keybased authentication
Also setup sudo premissions for the user in both machines
When I try to run the below playbook , It works on the local machine and fails on the other node.
--- #Install Telnet
- hosts: all
name: Install Telnet
become: true
become_user: ansible
become_method: sudo
tasks:
- yum:
name: telnet
state: latest
Output is as follows
`[ansible@host1 playbooks]$ ansible-playbook telnetDeployYUM.yml
PLAY [Install Telnet] ***********************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.64.6]
ok: [192.168.64.5]
TASK [yum] **********************************************************************************************************************************************************************************
ok: [192.168.64.5]
fatal: [192.168.64.6]: FAILED! => "changed": true, "msg": "You need to be root to perform this command.n", "obsoletes": "grub2": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "grub2-tools": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "rc": 1, "results": ["Loaded plugins: fastestmirrorn"]
to retry, use: --limit @/home/ansible/playbooks/telnetDeployYUM.retry
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.64.5 : ok=2 changed=0 unreachable=0 failed=0
192.168.64.6 : ok=1 changed=0 unreachable=0 failed=1
[ansible@host1 playbooks]$
`
I could also manually able to run sudo yum
on the failed target as ansible user
I believe sudo set up in correct
[ansible@host2 root]$ sudo whoami
root
Can experts share some insights on what I am missing with respect to my failed machine , Thanks.
ansible
add a comment |
I have a lab setup with ansible controller + node and exploring few areas.
I am so far setup an user account named ansible
in both machines and enabled ssh keybased authentication
Also setup sudo premissions for the user in both machines
When I try to run the below playbook , It works on the local machine and fails on the other node.
--- #Install Telnet
- hosts: all
name: Install Telnet
become: true
become_user: ansible
become_method: sudo
tasks:
- yum:
name: telnet
state: latest
Output is as follows
`[ansible@host1 playbooks]$ ansible-playbook telnetDeployYUM.yml
PLAY [Install Telnet] ***********************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.64.6]
ok: [192.168.64.5]
TASK [yum] **********************************************************************************************************************************************************************************
ok: [192.168.64.5]
fatal: [192.168.64.6]: FAILED! => "changed": true, "msg": "You need to be root to perform this command.n", "obsoletes": "grub2": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "grub2-tools": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "rc": 1, "results": ["Loaded plugins: fastestmirrorn"]
to retry, use: --limit @/home/ansible/playbooks/telnetDeployYUM.retry
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.64.5 : ok=2 changed=0 unreachable=0 failed=0
192.168.64.6 : ok=1 changed=0 unreachable=0 failed=1
[ansible@host1 playbooks]$
`
I could also manually able to run sudo yum
on the failed target as ansible user
I believe sudo set up in correct
[ansible@host2 root]$ sudo whoami
root
Can experts share some insights on what I am missing with respect to my failed machine , Thanks.
ansible
I have a lab setup with ansible controller + node and exploring few areas.
I am so far setup an user account named ansible
in both machines and enabled ssh keybased authentication
Also setup sudo premissions for the user in both machines
When I try to run the below playbook , It works on the local machine and fails on the other node.
--- #Install Telnet
- hosts: all
name: Install Telnet
become: true
become_user: ansible
become_method: sudo
tasks:
- yum:
name: telnet
state: latest
Output is as follows
`[ansible@host1 playbooks]$ ansible-playbook telnetDeployYUM.yml
PLAY [Install Telnet] ***********************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.64.6]
ok: [192.168.64.5]
TASK [yum] **********************************************************************************************************************************************************************************
ok: [192.168.64.5]
fatal: [192.168.64.6]: FAILED! => "changed": true, "msg": "You need to be root to perform this command.n", "obsoletes": "grub2": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "grub2-tools": "dist": "x86_64", "repo": "@anaconda", "version": "1:2.02-0.64.el7.centos", "rc": 1, "results": ["Loaded plugins: fastestmirrorn"]
to retry, use: --limit @/home/ansible/playbooks/telnetDeployYUM.retry
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.64.5 : ok=2 changed=0 unreachable=0 failed=0
192.168.64.6 : ok=1 changed=0 unreachable=0 failed=1
[ansible@host1 playbooks]$
`
I could also manually able to run sudo yum
on the failed target as ansible user
I believe sudo set up in correct
[ansible@host2 root]$ sudo whoami
root
Can experts share some insights on what I am missing with respect to my failed machine , Thanks.
ansible
ansible
asked Mar 8 at 8:02
user2190101user2190101
3433520
3433520
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Below should work fine
- hosts: all
name: Install Telnet
become: yes
tasks:
- yum:
name: telnet
state: latest
ansible or user through which ansible is getting executed should be in sudoers file.
You are changing your user to ansible which is not required.
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
add a comment |
Run with -vvvv
to see what ansible is doing.
Have you setup ansible
in sudoers
for password less privilege elevation?
you are getting a message that it is waiting for "escalation prompt". That means when you are running with become, you are failing to become since it needs the password. Make sure your test user is in /etc/sudoers
AND you have it marked for that user to NOT need to enter a password when running sudo commands. The entry should end with :NOPASSWD
on the line in that file.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058963%2fyou-need-to-be-root-to-execute-ansible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Below should work fine
- hosts: all
name: Install Telnet
become: yes
tasks:
- yum:
name: telnet
state: latest
ansible or user through which ansible is getting executed should be in sudoers file.
You are changing your user to ansible which is not required.
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
add a comment |
Below should work fine
- hosts: all
name: Install Telnet
become: yes
tasks:
- yum:
name: telnet
state: latest
ansible or user through which ansible is getting executed should be in sudoers file.
You are changing your user to ansible which is not required.
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
add a comment |
Below should work fine
- hosts: all
name: Install Telnet
become: yes
tasks:
- yum:
name: telnet
state: latest
ansible or user through which ansible is getting executed should be in sudoers file.
You are changing your user to ansible which is not required.
Below should work fine
- hosts: all
name: Install Telnet
become: yes
tasks:
- yum:
name: telnet
state: latest
ansible or user through which ansible is getting executed should be in sudoers file.
You are changing your user to ansible which is not required.
edited Mar 18 at 15:31
answered Mar 8 at 13:21
error404error404
56958
56958
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
add a comment |
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
yes , thats correct. It was the mistake.
– user2190101
Mar 18 at 14:17
add a comment |
Run with -vvvv
to see what ansible is doing.
Have you setup ansible
in sudoers
for password less privilege elevation?
you are getting a message that it is waiting for "escalation prompt". That means when you are running with become, you are failing to become since it needs the password. Make sure your test user is in /etc/sudoers
AND you have it marked for that user to NOT need to enter a password when running sudo commands. The entry should end with :NOPASSWD
on the line in that file.
add a comment |
Run with -vvvv
to see what ansible is doing.
Have you setup ansible
in sudoers
for password less privilege elevation?
you are getting a message that it is waiting for "escalation prompt". That means when you are running with become, you are failing to become since it needs the password. Make sure your test user is in /etc/sudoers
AND you have it marked for that user to NOT need to enter a password when running sudo commands. The entry should end with :NOPASSWD
on the line in that file.
add a comment |
Run with -vvvv
to see what ansible is doing.
Have you setup ansible
in sudoers
for password less privilege elevation?
you are getting a message that it is waiting for "escalation prompt". That means when you are running with become, you are failing to become since it needs the password. Make sure your test user is in /etc/sudoers
AND you have it marked for that user to NOT need to enter a password when running sudo commands. The entry should end with :NOPASSWD
on the line in that file.
Run with -vvvv
to see what ansible is doing.
Have you setup ansible
in sudoers
for password less privilege elevation?
you are getting a message that it is waiting for "escalation prompt". That means when you are running with become, you are failing to become since it needs the password. Make sure your test user is in /etc/sudoers
AND you have it marked for that user to NOT need to enter a password when running sudo commands. The entry should end with :NOPASSWD
on the line in that file.
answered Mar 8 at 9:06
ferminx360ferminx360
537
537
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058963%2fyou-need-to-be-root-to-execute-ansible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown