Giter VIP home page Giter VIP logo

Comments (7)

maspwr avatar maspwr commented on July 23, 2024

This is most likely related to how I am running the playbook. I setup the playbook as:

---
- name: Installing Docker
  hosts: all
  sudo: true
  roles:
    - angstwad.docker_ubuntu

Notice the sudo: true which is required for some of the tasks to run successfully. However this causes the wait_for task to fail on my host (OS X) because I'm not running ansible-playbook with sudo. The easiest fix would be to add sudo: false to the wait_for task like:

- name: Wait for instance to come online
  sudo: false
  local_action:
    module: wait_for
    host: "{{ ansible_ssh_host|default(inventory_hostname) }}"
    port: 22
    delay: 30
    timeout: 600
    state: started
  when: "(ansible_distribution_version == '12.04' and reboot_result|changed)
      or (ansible_distribution_version == '13.10' and cgroup_lite_result|changed)"

from docker.ubuntu.

angstwad avatar angstwad commented on July 23, 2024

So implementing this would be assuming that everyone is escalating privileges via sudo, where some might also be escalating privs via su.

I'll give this some thought, but I don't think implementing strictly sudo: false is the right way.

from docker.ubuntu.

maspwr avatar maspwr commented on July 23, 2024

Where are the docs for the su feature? I can't seem to find them.

from docker.ubuntu.

angstwad avatar angstwad commented on July 23, 2024

I don't think there are docs. But I wrote 98% of the su code in Ansible.

Yeah, if you're running the role as sudo and your remote sudo password
differs from your local sudo password, it'll fail.

There's probably a solution to this. I'm still investigating.

On Wednesday, June 11, 2014, Mark Aaron Shirley [email protected]
wrote:

Where are the docs for the su feature? I can't seem to find them.


Reply to this email directly or view it on GitHub
#9 (comment)
.

from docker.ubuntu.

Wilfred avatar Wilfred commented on July 23, 2024

For what it's worth, I hit this error because I run SSH on a non-standard port. I was able to fix it by adding to my ansible.cfg:

[defaults]
remote_port = 5678

Ideally docker.ubuntu would get this port out of inventory.ini, rather than just falling back to the default.

from docker.ubuntu.

angstwad avatar angstwad commented on July 23, 2024

@Wilfred Default behavior today is to pull the port from inventory, using ansible_ssh_port and defaulting to the defaults/main.yml#ssh_port value of 22. This may not have been pushed to Galaxy, so I'm updating the role there this morning.

- name: Wait for instance to come online
  local_action:
    module: wait_for
    host: "{{ ansible_ssh_host|default(inventory_hostname) }}"
    port: "{{ ansible_ssh_port|default(ssh_port) }}"
    delay: 30
    timeout: 600
    state: started
  when: "(ansible_distribution_version == '12.04' and reboot_result|changed)
      or (ansible_distribution_version == '13.10' and cgroup_lite_result|changed)"

from docker.ubuntu.

angstwad avatar angstwad commented on July 23, 2024

This issue has been open long enough -- I think the solution is to fork the role and add a sudo: false or su: false where necessary, since the options are mutually exclusive anyway and can't be added together on a single task.

from docker.ubuntu.

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.