Hi Jeremy,
I use this inventory file to access remote windows machines through the Ansible model source:
[winwin]
192.168.1.84 ansible_shell_type=powershell
[winwin:vars]
ansible_user=administrator
ansible_password=password
ansible_port=5985
ansible_connection=winrm
ansible_winrm_scheme=http
ansible_winrm_server_cert_validation=ignore
I hope it is useful.
Regards!
Hi Jeremy,
Another place to look is the ansible.cfg
file, let me share my configuration:
[defaults]
inventory = /path/to/my/hosts
gather_subset = all
nocows = 1
The host
file (inventory):
[winwin]
10.0.1.53 ansible_shell_type=powershell
[winwin:vars]
ansible_user=administrator
ansible_password=password
ansible_port=5985
ansible_connection=winrm
ansible_winrm_scheme=http
ansible_winrm_server_cert_validation=ignore
My full project Configuration:
#Tue Jan 25 08:32:47 CLST 2022
#edit below
project.ansible-config-file-path=/path/to/my/ansible.cfg
project.ansible-executable=/bin/bash
project.ansible-ssh-passphrase-option=option.password
project.ansible-windows-executable=powershell.exe
project.description=
project.disable.executions=false
project.disable.schedule=false
project.execution.history.cleanup.batch=500
project.execution.history.cleanup.enabled=false
project.execution.history.cleanup.retention.days=60
project.execution.history.cleanup.retention.minimum=50
project.execution.history.cleanup.schedule=0 0 0 1/1 * ? *
project.jobs.gui.groupExpandLevel=1
project.label=
project.name=ProjectANSIBLE
project.nodeCache.enabled=true
project.nodeCache.firstLoadSynch=true
project.output.allowUnsanitized=false
project.ssh-authentication=privateKey
project.ssh-keypath=/home/user_name/.ssh/id_rsa
resources.source.1.type=local
resources.source.2.config.ansible-config-file-path=/path/to/my/ansible.cfg
resources.source.2.config.ansible-gather-facts=true
resources.source.2.config.ansible-ignore-errors=true
resources.source.2.config.ansible-inventory=/path/to/my/hosts
resources.source.2.type=com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory
service.FileCopier.default.provider=com.batix.rundeck.plugins.AnsibleFileCopier
service.NodeExecutor.default.provider=com.batix.rundeck.plugins.AnsibleNodeExecutor
And my Ansible model source configuration.
I use this job definition to test the node:
- defaultTab: nodes
description: ''
executionEnabled: true
id: 76d0a0b2-e27d-4fea-a8a5-a32be4430dbe
loglevel: INFO
name: HelloWorldWindows
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
rankOrder: ascending
successOnEmptyNodeFilter: false
threadcount: '1'
filter: 'name: 10.0.1.53 '
nodesSelectedByDefault: true
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- exec: whoami
keepgoing: false
strategy: node-first
uuid: 76d0a0b2-e27d-4fea-a8a5-a32be4430dbe
The execution.
Greetings.