forked from linux-system-roles/ad_integration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests_basic_join.yml
More file actions
45 lines (39 loc) · 1.35 KB
/
tests_basic_join.yml
File metadata and controls
45 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# SPDX-License-Identifier: MIT
---
- name: Ensure that the role runs with mandatory parameters populated
hosts: all,!ad
vars:
# sample realm that will skip joining realm step
ad_integration_realm: "{{ __ad_integration_sample_realm }}"
ad_integration_password: Secret123
tasks:
- name: Set test realm
set_fact:
__ad_integration_sample_realm: MiXeD.cAsE
- name: Test - Run the system role
include_tasks: tasks/run_role_with_clear_facts.yml
- name: Test - Check packages are present
block:
- name: Gather package facts
package_facts:
- name: Assert that expected packages are installed
assert:
that:
- "'realmd' in ansible_facts.packages"
- "'PackageKit' in ansible_facts.packages"
- name: Test - Check that realmd config is present
stat:
path: /etc/realmd.conf
register: __stat_result
failed_when: not __stat_result.stat.exists
changed_when: false
- name: Test - Check realmd headers
include_tasks: tasks/check_header.yml
vars:
__file: /etc/realmd.conf
__fingerprint: "system_role:ad_integration"
- name: Check that realm name is all lower case
command: >-
grep -xF "[{{ __ad_integration_sample_realm | lower }}]"
/etc/realmd.conf
changed_when: false