Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo: a password is required - django-admin.py inspectdb #36

Open
TinajaLabs opened this issue Feb 14, 2019 · 2 comments
Open

sudo: a password is required - django-admin.py inspectdb #36

TinajaLabs opened this issue Feb 14, 2019 · 2 comments

Comments

@TinajaLabs
Copy link

Running on Centos 7

$  ansible --version
ansible 2.7.1
  python version = 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
fatal:
  [charts]:
    FAILED! => {
      "changed": false,
      ` "module_stderr": "Shared connection to <ipaddress> closed.\r\n",
      "module_stdout": "\u001b]0;c7h-template.cbase.ecm\u0007sudo: a password is required\r\n",
      "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
      "rc": 1
    }

When running this part of django-admin.yml

- name: django-admin.py - Inspect graphite db
  command: django-admin.py inspectdb
  environment:
    DJANGO_SETTINGS_MODULE: graphite.settings
    PYTHONPATH: "{{ graphite_install_path}}/webapp/"
  become: true
  become_user: "{{ graphite_user }}"
  register: result
  changed_when: false

Any tips appreciated,
Chris.

@nsg
Copy link
Owner

nsg commented Mar 3, 2019

I have noticed that "sudo: a password is required" and similar error messages are used a lot of different "I can't connect or auth" type of errors. Most likely it's either an connection, or an privilege escalation error.

I usually add a few "-v" like -vvvvv to the command to see the actual command that Ansible tries to execute and runs it manually to track these problems down.

A few places to look at are, the ssh-agent or similar, keyrings, hanging existing connections to that server, ssh config (global and user specific), ansible.cfg (global, user and local). If you are able to ssh in to the server by executing the command manually, try to figure out the difference between your environment and the environment Ansible executes the command.

Considered that this issue is a few weeks old, I hope you already have solved it :)

@TinajaLabs
Copy link
Author

Thanks. I'll look it up tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants