Run Ansible-Playbook on localhost on Windows - python

I know Ansible supports Windows clients/nodes. What I really enjoy about Ansible is that I can create a Linux VM, pull a git repo that contains Ansible playbooks for and without any configuration or setup of a control server, I am able to run the playbook on the local machine.
Since you can execute Python on Windows, would it be possible to run roles/playbooks on localhost on Windows?
This would be the first step for running Ansible in a datacenter with only Windows where it is not possible to even run Linux in VirtualBox.

Ansible won't run on a windows control machine, as stated in the documentation:
Reminder: You Must Have a Linux Control Machine
Note running Ansible from a Windows control machine is NOT a goal of the project. Refrain from asking for this feature, as it limits what technologies, features, and code we can use in the main project in the future. A Linux control machine will be required to manage Windows hosts.
Cygwin is not supported, so please do not ask questions about Ansible running from Cygwin.

Related

node.js spawn python child process on Windows Virtual Machine

I have right now a node.js backend where I'm spawning a Python child_process. The Python file executes successfully and returns the data correctly. However in production, the node.js backend will run on a linux server and the python script needs to be run in a Windows environment.
Is there any possible way to spawn the python process directly on a Windows Virtual Machine instead of the current server? If not, what would be possible alternatives besides using a Windows server for node.js?
I don't think, that in this case the versions really matter, but here they are:
node.js 12.16.2
Python: 3.8.2
Linux server: Ubuntu

Jenkins Master/Slave Windows

Just want a clarification of the following. I am currently in the process of transferring a Bamboo plan into a Jenkins one and everything was working fine up until the point I ran a Python script on my CentOS Virtual Machine. The reason being that Python wants to import a library called winreg which is not available on RedHat distributions.
In order to fix this, I wanted to have my Master be a CentOS machine and my slave be a Windows 10 machine. Is that how it works? Will the plan be built on the Windows 10 machine while the output is handled by the CentOS machine?
Thanks
Yes, it will. This is usual Jenkins using - see documentation.

Heroku bash on windows

I am trying to connect to Heroku bash on windows and use python manage.py shell iPython shell to help me type commands faster.
While this works fine if I am on Mac, on my Windows machine - the colour coding of heroku bash iPython shell and the tab-autocomplete feature does not work.
Is there some other tool I can use or can configure somewhere? I tried installing bash on Windows, and it gives me the same result
You should NOT, NOT, NOT!!#!!!!! be using Heroku's bash shell for casual python coding. This is an awful idea for many reasons:
Heroku dynos don't have a persistent filesystem. Any files on your dyno can be deleted randomly.
The amount of time it will take you to build an ipython setup / configuration from scratch, and get it running on your dyno is not worth the effort.
Heroku dynos are meant to run web processes as they restart randomly -- your terminal session may blow up at any point.
If you really want an authentic 'shell' experience, I recommend using a real shell for development -- either get yourself a virtual machine and install ubuntu, or spin up a ubuntu server machine through a host like DigitalOcean or Amazon.

Python: run a process inside a windows host

I need to run a process inside a windows host from a linux host using python.
I saw WMI python library but seems to work only from a windows host, not linux, how can I do?
I neeed something like PSEXEC, but it works only for windows.
Since you cannot install anything on the windows host, does it have openoffice, or libreoffice installed?
You coult then use the Python interpreter bundled with it to create a python script that listens to xmlrpc and get you job done, controling this script remotely.
If there is no Python installed on the windows side, and yur remote host is Linux, there is this recipe here: http://code.activestate.com/recipes/577945-execute-remote-commands-on-windows-like-psexec/
It does depend on windows - as it imports win32wnet - in my experience, these windows specific modules will run fine in a Windows python installed on a Wine configuration on a Linux machinne.
An easy solution is to run a SSH server on the windows box and use the paramiko library on the client side.

Is it possible to run pydev connected to a virtualbox instance?

At the moment I'm developing using a simple editor, putty, and a VirtualBox instance of a linux server. I've heard good things about pydev and would like to try it, but I'd like to use the python install & terminal from my VirtualBox guest OS.
I'm already using a Shared Folder with VirtualBox so my Guest OS can see my local files.
Is it possible to tell pydev to use this "remote" host over SSH to execute its python-related commands?
UPDATE:
My main environment is windows, but I'd also like to be able to work this way on OS X.
I assume your host box is windows.
I also assume that pydev will run under linux (since it's eclipse based). Are you ok installing the dev environment on your linux server?
In which case:
install and run xming on your windows box
Install eclipse & pydev on your linux box
Configure x forwarding in putty
Run pydev through putty and you'll have the UI appear on your windows machine like normal
Then pydev will be running on the linux box quite happily, and so using the python environment on there.
Downsides: you will need to install the X libraries & java on your server (installing eclipse using your normal package manager should be enough), although you won't need to run X itself, since that's what Xming is for.
UPDATE:
Let me understand the situation, Windows is hosting the virtualBox which host the linux.
You connect to the linux using putty.
Python files are on the linux machine and you wish to edit them from your Windows using pydev. So either do that using the sharing features of virtual box (which can work for you in vboth ways) or use ssh to edit the linux files from windows.
both options would be valid for MacOSx AFAIK
Below you cna find the way to do so over SSH
You map a netwrok drive over SSH and then you can access the files via that drive letter
see more at
http://www.neophob.com/serendipity/index.php?/archives/103-Map-a-Network-drive-net-use-over-SSH.html
and
http://smithii.com/map_a_network_drive_over_ssh_in_windows

Categories

Resources