I am running into an issue and I am not sure what is causing it.
Playbook:
- name: Testing
hosts: testing
become: false
gather_facts: false
tasks:
- name: Services Info
ansible.windows.win_service_info:
name: WSearch
register: services_Info
- name: Output Services
debug:
var: services_Info.services
- name: Output Services
debug:
var: services_Info.services.start_mode
Output for services_Info.services
{
"services_Info.services": [
{
"checkpoint": 0,
"controls_accepted": [],
"dependencies": [
"RPCSS",
"BrokerInfrastructure"
],
"dependency_of": [
"WMPNetworkSvc"
],
"description": "Provides content indexing, property caching, and search results for files, e-mail, and other content.",
"desktop_interact": false,
"display_name": "Windows Search",
"error_control": "normal",
"failure_actions": [
{
"type": "restart",
"delay_ms": 30000
},
{
"type": "restart",
"delay_ms": 30000
},
{
"type": "restart",
"delay_ms": 30000
},
{
"type": "restart",
"delay_ms": 30000
},
{
"type": "restart",
"delay_ms": 30000
},
{
"type": "none",
"delay_ms": 0
}
],
"failure_actions_on_non_crash_failure": true,
"failure_command": null,
"failure_reboot_msg": null,
"failure_reset_period_sec": 86400,
"launch_protection": "none",
"load_order_group": "",
"name": "WSearch",
"path": "C:\\Windows\\system32\\SearchIndexer.exe /Embedding",
"pre_shutdown_timeout_ms": 10000,
"preferred_node": null,
"process_id": 0,
"required_privileges": [
"SeChangeNotifyPrivilege",
"SeManageVolumePrivilege",
"SeImpersonatePrivilege",
"SeAssignPrimaryTokenPrivilege",
"SeIncreaseQuotaPrivilege",
"SeTcbPrivilege"
],
"service_exit_code": 0,
"service_flags": [],
"service_type": "win32_own_process",
"sid_info": "unrestricted",
"start_mode": "disabled",
"state": "stopped",
"triggers": [],
"username": "NT AUTHORITY\\SYSTEM",
"wait_hint_ms": 0,
"win32_exit_code": 0
}
],
"_ansible_verbose_always": true,
"_ansible_no_log": null,
"changed": false
}
The output above is the result of debugging the variable services_Info.services
.
But, when going more specific to include start_mode
I get:
"services_Info.services.start_mode": "VARIABLE IS NOT DEFINED!"