aim-web2.1.0rc9
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# system_detect_roles
|
||||
|
||||
Operator defaults are intentionally low-precedence; inventory and explicit run options may override them.
|
||||
|
||||
```yaml
|
||||
---
|
||||
# Windows feature & service identifiers
|
||||
ad_ds_feature_name: AD-Domain-Services
|
||||
dhcp_windows_service_name: DHCPServer
|
||||
veeam_services:
|
||||
vbr: VeeamBackupSvc
|
||||
vbo: Veeam.Archiver.Service
|
||||
em: VeeamEnterpriseManagerSvc
|
||||
unifi_linux_services:
|
||||
- unifi
|
||||
- unifi.service
|
||||
unifi_linux_packages:
|
||||
- unifi
|
||||
want_linux_check_certificate: false
|
||||
want_windows_citrix: false
|
||||
want_windows_surebackup: false
|
||||
want_windows_backup: false
|
||||
```
|
||||
|
||||
## Structured result integration
|
||||
|
||||
Current reporting behavior and field semantics are specified in
|
||||
[scripts/docs/OPERATION_RESULTS.md](../../scripts/docs/OPERATION_RESULTS.md).
|
||||
The calling catalog playbook owns publication; helper roles do not implicitly export
|
||||
arbitrary facts, module results or debug data. Existing defaults above retain their
|
||||
precedence. See the current validation/sanity documents before using the new candidate.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# Windows feature & service identifiers
|
||||
ad_ds_feature_name: AD-Domain-Services
|
||||
dhcp_windows_service_name: DHCPServer
|
||||
veeam_services:
|
||||
vbr: VeeamBackupSvc
|
||||
vbo: Veeam.Archiver.Service
|
||||
em: VeeamEnterpriseManagerSvc
|
||||
unifi_linux_services:
|
||||
- unifi
|
||||
- unifi.service
|
||||
unifi_linux_packages:
|
||||
- unifi
|
||||
want_linux_check_certificate: false
|
||||
want_windows_citrix: false
|
||||
want_windows_surebackup: false
|
||||
want_windows_backup: false
|
||||
@@ -0,0 +1,132 @@
|
||||
---
|
||||
# Read-only capability discovery. This does not assign inventory groups.
|
||||
- name: Windows | Detect AD DS feature (DC)
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_feature_info:
|
||||
name: '{{ ad_ds_feature_name | default(''AD-Domain-Services'') }}'
|
||||
register: _win_dc_feature
|
||||
failed_when: false
|
||||
- name: 'Windows | Fallback: check NTDS service (DC)'
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: NTDS
|
||||
register: _win_ntds_svc
|
||||
failed_when: false
|
||||
- name: Windows | Check DHCP service
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: '{{ dhcp_windows_service_name | default(''DHCPServer'') }}'
|
||||
register: _win_dhcp_svc
|
||||
failed_when: false
|
||||
- name: Windows | Check Veeam VBR service
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: '{{ veeam_services.vbr | default(''VeeamBackupSvc'') }}'
|
||||
register: _veeam_vbr
|
||||
failed_when: false
|
||||
- name: Windows | Check Veeam VBO service
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: '{{ veeam_services.vbo | default(''Veeam.Archiver.Service'') }}'
|
||||
register: _veeam_vbo
|
||||
failed_when: false
|
||||
- name: Windows | Check Veeam Enterprise Manager service
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: '{{ veeam_services.em | default(''VeeamEnterpriseManagerSvc'') }}'
|
||||
register: _veeam_em
|
||||
failed_when: false
|
||||
- name: Windows | Detect Hyper-V feature
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_feature_info:
|
||||
name: '{{ hyperv_feature_name | default(''Hyper-V'') }}'
|
||||
register: _win_hyperv_feature
|
||||
failed_when: false
|
||||
- name: 'Windows | Fallback: check Hyper-V VMMS service'
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_service_info:
|
||||
name: '{{ hyperv_vmms_service_name | default(''vmms'') }}'
|
||||
register: _win_hyperv_vmms_svc
|
||||
failed_when: false
|
||||
- name: Windows | Set Veeam/DC/DHCP booleans (base)
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.builtin.set_fact:
|
||||
is_dc: |-
|
||||
{{
|
||||
(
|
||||
(_win_dc_feature.features | default([]))
|
||||
| selectattr('installed')
|
||||
| list
|
||||
| length > 0
|
||||
)
|
||||
or
|
||||
(_win_ntds_svc.exists | default(false))
|
||||
}}
|
||||
is_dhcp_server: '{{ _win_dhcp_svc.exists | default(false) }}'
|
||||
has_veeam_vbr: '{{ _veeam_vbr.exists | default(false) }}'
|
||||
has_veeam_vbo: '{{ _veeam_vbo.exists | default(false) }}'
|
||||
has_veeam_em: '{{ _veeam_em.exists | default(false) }}'
|
||||
is_hyperv_host: |-
|
||||
{{
|
||||
(
|
||||
(_win_hyperv_feature.features | default([]))
|
||||
| selectattr('installed')
|
||||
| list
|
||||
| length > 0
|
||||
)
|
||||
or
|
||||
(_win_hyperv_vmms_svc.exists | default(false))
|
||||
}}
|
||||
- name: Windows | Debug summary
|
||||
when:
|
||||
- ansible_facts['os_family'] == "Windows"
|
||||
- aim_debug | default(false) | bool
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
is_dc: '{{ is_dc }}'
|
||||
is_dhcp_server: '{{ is_dhcp_server }}'
|
||||
has_veeam_vbr: '{{ has_veeam_vbr }}'
|
||||
has_veeam_vbo: '{{ has_veeam_vbo }}'
|
||||
has_veeam_em: '{{ has_veeam_em }}'
|
||||
is_hyperv_host: '{{ is_hyperv_host }}'
|
||||
- name: Linux | Collect service facts
|
||||
when: ansible_facts['os_family'] != "Windows"
|
||||
ansible.builtin.service_facts: null
|
||||
- name: Linux | Collect package facts
|
||||
when: ansible_facts['os_family'] != "Windows"
|
||||
ansible.builtin.package_facts:
|
||||
manager: auto
|
||||
- name: Linux | Set UniFi flags
|
||||
when: ansible_facts['os_family'] != "Windows"
|
||||
vars:
|
||||
svcs: '{{ ansible_facts.services | default({}) }}'
|
||||
pkgs: '{{ ansible_facts.packages | default({}) | list }}'
|
||||
ansible.builtin.set_fact:
|
||||
is_unifi_controller: |-
|
||||
{{
|
||||
(unifi_linux_services | select('in', svcs.keys()) | list | length > 0)
|
||||
or
|
||||
(pkgs | intersect(unifi_linux_packages) | length > 0)
|
||||
}}
|
||||
is_unifi_os_server: |-
|
||||
{{
|
||||
'uosserver.service' in svcs
|
||||
}}
|
||||
- name: Linux | Debug summary
|
||||
when:
|
||||
- ansible_facts['os_family'] != "Windows"
|
||||
- aim_debug | default(false) | bool
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
is_unifi_controller: '{{ is_unifi_controller }}'
|
||||
is_unifi_os_server: '{{ is_unifi_os_server }}'
|
||||
- name: Normalize detection booleans
|
||||
ansible.builtin.set_fact:
|
||||
is_dc: '{{ is_dc | default(false) }}'
|
||||
is_dhcp_server: '{{ is_dhcp_server | default(false) }}'
|
||||
has_veeam_vbr: '{{ has_veeam_vbr | default(false) }}'
|
||||
has_veeam_vbo: '{{ has_veeam_vbo | default(false) }}'
|
||||
has_veeam_em: '{{ has_veeam_em | default(false) }}'
|
||||
is_unifi_controller: '{{ is_unifi_controller | default(false) }}'
|
||||
is_unifi_os_server: '{{ is_unifi_os_server | default(false) }}'
|
||||
is_hyperv_host: '{{ is_hyperv_host | default(false) }}'
|
||||
Reference in New Issue
Block a user