![]() Debug out some of the properties of the returned cron object.Search through that object to find the process with the name cron.Use the from_json filter to convert the returned JSON text to an object.That basic test was successful, so I then updated the playbook to process the returned data: Running a simple command Get-Process and using ConvertTo-Json to make the returned data easier to consume in Ansible. Notice how the executable parameter has been set to the path for PowerShell Core, /usr/bin/pwsh. So I figured I would start there and put together the following basic playbook: This expects an absolute path to the executable. ![]() The shell module has an executable parameter described as “Change the shell used to execute the command. So I was curious to see if it was possible to execute commands in a Linux target using PowerShell Core and if so, how to do it.įor my test I have an Ubuntu 18.04 VM with PowerShell Core 6.2.2 installed: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |