Giter VIP home page Giter VIP logo

Comments (12)

jmal98 avatar jmal98 commented on August 20, 2024 1

Great, glad it fixed it.

The update image has been pushed to Docker hub.

from ansiblecm.

jmal98 avatar jmal98 commented on August 20, 2024

I'm not familiar with using Ansible to manage Windows machines but I have reviewed the article and it looks like I just need to add the pywinrm dependency to the image and it should work. I do not have a way to test the change to see if it works for your use case, but I will push the change and build a "latest" image tag. Would you be able to test it and make sure it works for your use case?

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

I will give it a shot!

from ansiblecm.

jmal98 avatar jmal98 commented on August 20, 2024

Did it work for your use case?

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

Apologies for the delay - finally got some time to work on this.
I am getting this error when attempting to connect using kerbos
FAILED! => {"msg": "The installed version of WinRM does not support transport(s) [u'kerbos']"}

I wonder if these steps can be added to the docker file, and then the config file could be passed in?

https://docs.ansible.com/ansible/devel/user_guide/windows_winrm.html#installing-the-kerberos-library

it also could be that i just don't know what I am doing. Would it be possible to upgrade this image to use python 3 instead of 2? not sure if that will make a difference.

from ansiblecm.

jmal98 avatar jmal98 commented on August 20, 2024

Thank you for the link. I have pushed an update to use kerberos deps.

As for the config, I believe you should be able to provide it via a mount (i.e. -v). For example, something like this should work:

docker run -it --rm -v $PWD:/tmp/playbook:Z -v $PWD/krb5.conf:/etc/krb5.conf:Z jmal98/ansiblecm site.yml -i inventory/hosts

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

thanks! I will give it another shot!

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

@jmal98 this worked successfully for me - thank you so much!

Edit: Apparently I am a liar. I got my playbook to work but not inside of the docker container. Here is the error I received.

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 138, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 554, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/normal.py", line 46, in run
    result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 795, in _execute_module
    res = self._low_level_execute_command(cmd, sudoable=sudoable, in_data=in_data)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/__init__.py", line 902, in _low_level_execute_command
    rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 472, in exec_command
    super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/__init__.py", line 38, in wrapped
    self._connect()
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 441, in _connect
    self.protocol = self._winrm_connect()
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 334, in _winrm_connect
    self._kerb_auth(self._winrm_user, self._winrm_pass)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 299, in _kerb_auth
    env=krb5env)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1025, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

fatal: [wwa00923.deluxe.com]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

from ansiblecm.

jmal98 avatar jmal98 commented on August 20, 2024

I pushed an update to include more of the kerberos dependencies. Can you give it another try?

Also, does the playbook you're using delegate any tasks to the machine running the playbook?

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

I will as soon as I can. As for the playbook It is using the windows modules to connect to a remote windows server 2016 to perform the tasks. Does that answer your question?

from ansiblecm.

jmal98 avatar jmal98 commented on August 20, 2024

Yes, it does. Thanks

from ansiblecm.

lilasquared avatar lilasquared commented on August 20, 2024

@jmal98 using the build of the latest image my playbook is working and managing my windows nodes! You should publish this to the docker registry!

from ansiblecm.

Related Issues (9)

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.