a6977f3796
testrun playbook which displays powershell version
27 lines
724 B
YAML
27 lines
724 B
YAML
---
|
|
- name: First windows playbook
|
|
hosts: all
|
|
gather_facts: no
|
|
collections:
|
|
- ansible.windows
|
|
|
|
tasks:
|
|
- name: Get powershell version, requires powershell 7
|
|
ansible.windows.win_powershell:
|
|
script: |
|
|
$PSVersionTable.PSVersion.ToString()
|
|
executable: pwsh.exe
|
|
register: win_out
|
|
vars:
|
|
ansible_connection: amazon.aws.aws_ssm
|
|
ansible_aws_ssm_bucket_name: rosm-ansible-040216112220
|
|
ansible_aws_ssm_region: ap-east-1
|
|
ansible_aws_ssm_retries: 2
|
|
ansible_aws_ssm_timeout: 20
|
|
ansible_shell_type: powershell
|
|
#ansible_shell_executable: pwsh.exe
|
|
|
|
- name: Show output
|
|
debug:
|
|
msg: "{{ win_out.output[0] }}"
|