Code Monkey home page Code Monkey logo

Comments (3)

jarv avatar jarv commented on June 9, 2024

by default all commands will be run as --user and it won't use sudo by
default, in your example the command needs to be run as root.
In your top level playbook you can tell ansible to always use sudo which
might be simpler than setting sudo for every task.
http://ansible.cc/docs/playbooks.html#playbook-language-example

On Mon, May 13, 2013 at 5:52 PM, VikParuchuri [email protected]:

I am periodically merging master into my branch that configures the ml
api, and the biggest issue is the removal of sudo in the common playbook.
How is the lack of sudo working?

For example, this will fail:

  • name: Create data dir
    file: path={{ app_base_dir }}/data state=directory owner=root group=root
    tags:
    • pre_install

This will succeed:

  • name: Create data dir
    file: path={{ app_base_dir }}/data state=directory owner=root group=root
    sudo: True
    tags:
    • pre_install

Am I doing something wrong with users or the ansible command?

I am running:

ansible-playbook mlapi_sandbox.yml -i ./ec2.py -c ssh --user=ubuntu -v

This is happening in the aws-sandbox account.


Reply to this email directly or view it on GitHubhttps://github.com/edx/configuration/issues/60
.

from configuration.

jrbl avatar jrbl commented on June 9, 2024

So, sudo isn't an activity variable, it's a playbook variable. So once it's
set by any activity, it's set for all activities.

It was dropped out of common because I felt it should be defined as close
as possible to the scope in which it applied, e.g., edx_prod.yml,
edx_stage.yml, oc edx_custom.yml. So in your case, Vik, I'd define it
after the - host line in mlapi_sandbox.yml, like so:

  • host tag_my_boxes
  • sudo: True
  • vars yadda yadda yadda

HTH,
Joe

On Mon, May 13, 2013 at 2:52 PM, VikParuchuri [email protected]:

I am periodically merging master into my branch that configures the ml
api, and the biggest issue is the removal of sudo in the common playbook.
How is the lack of sudo working?

For example, this will fail:

  • name: Create data dir
    file: path={{ app_base_dir }}/data state=directory owner=root group=root
    tags:
    • pre_install

This will succeed:

  • name: Create data dir
    file: path={{ app_base_dir }}/data state=directory owner=root group=root
    sudo: True
    tags:
    • pre_install

Am I doing something wrong with users or the ansible command?

I am running:

ansible-playbook mlapi_sandbox.yml -i ./ec2.py -c ssh --user=ubuntu -v

This is happening in the aws-sandbox account.


Reply to this email directly or view it on GitHubhttps://github.com/edx/configuration/issues/60
.

from configuration.

VikParuchuri avatar VikParuchuri commented on June 9, 2024

Thanks a lot, John and Joe!

from configuration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.