today, I want to create an AD-Group, for thst I need to use a Windows-Module. See following Playbook:
---
- name: Linux AD Admin Group
hosts: all
become: yes
tasks:
- name: set interpreter for PowerShell
ansible.builtin.set_fact:
ansible_powershell_interpreter: /bin/pwsh
- name: Create a group in a custom path
microsoft.ad.group:
domain_username: "{{ ansible_user }}@local.de"
domain_password: "{{ ansible_password }}"
domain_server: local.de
name: "05-{{ hostname }}-ADM"
scope: global
path: OU=ComputerGroups,DC=local,DC=de
state: present
delegate_to: localhost
The thing is, on the Windowshost itself I cant run the Script, SSH ist not installed and should not be. So I want to do this on the localhost, for that i have installed Powershell 7. Reachable over /bin/pwsh
. But what do I get:
fatal: [CGN889]: FAILED! => {
"changed": false,
"module_stdout": "rn/bin/sh: 1: powershell: not foundrn",
"msg": "The module failed to execute correctly, you probably need to set the interpreter.nSee stdout/stderr for the exact error",
"rc": 127
Does anyone know, how to change the path of the powershell interpreter?