Debian Codegraph @

ansible_collections/microsoft/ad/tests/integration/targets/domain_controller/test.yml

raw
1 - name: ensure time is in sync
2 hosts: windows
3 gather_facts: no
4 tasks:
5 - name: get current host datetime
6 command: date +%s
7 changed_when: False
8 delegate_to: localhost
9 run_once: True
10 register: local_time
11
12 - name: set datetime on Windows
13 ansible.windows.win_powershell:
14 parameters:
15 SecondsSinceEpoch: '{{ local_time.stdout | trim }}'
16 script: |
17 param($SecondsSinceEpoch)
18
19 $utc = [System.DateTimeKind]::Utc
20 $epoch = New-Object -TypeName System.DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0, $utc
21 $date = $epoch.AddSeconds($SecondsSinceEpoch)
22
23 Set-Date -Date $date
24
25 - name: run microsoft.ad.domain_controller tests
26 hosts: TEST
27 gather_facts: no
28
29 tasks:
30 - import_tasks: tasks/main.yml