diff --git a/roles/ldap_server/molecule/default/tests/test_default.py b/roles/ldap_server/molecule/default/tests/test_default.py index 989689754a958832a765daea6a912420d11b6115..48179b115bfebfbd51d3f913f3573ad9da8a35f7 100644 --- a/roles/ldap_server/molecule/default/tests/test_default.py +++ b/roles/ldap_server/molecule/default/tests/test_default.py @@ -179,15 +179,15 @@ def test_ldap_tls_private_key_file(host): with host.sudo(): - inventory_hostname = host.ansible.get_variables()['inventory_hostname'] + hostname = host.run('hostname').stdout.strip() - key = host.file('/etc/ssl/private/%s_ldap.key' % inventory_hostname) + key = host.file('/etc/ssl/private/%s_ldap.key' % hostname) assert key.is_file assert key.user == 'root' assert key.group == 'openldap' assert key.mode == 0o640 - assert key.content_string == open('tests/data/x509/server/%s_ldap.key.pem' % inventory_hostname).read() + assert key.content_string == open('tests/data/x509/server/%s_ldap.key.pem' % hostname).read() def test_ldap_tls_certificate_file(host): @@ -197,15 +197,15 @@ def test_ldap_tls_certificate_file(host): with host.sudo(): - inventory_hostname = host.ansible.get_variables()['inventory_hostname'] + hostname = host.run('hostname').stdout.strip() - cert = host.file('/etc/ssl/certs/%s_ldap.pem' % inventory_hostname) + cert = host.file('/etc/ssl/certs/%s_ldap.pem' % hostname) assert cert.is_file assert cert.user == 'root' assert cert.group == 'root' assert cert.mode == 0o644 - assert cert.content_string == open('tests/data/x509/server/%s_ldap.cert.pem' % inventory_hostname).read() + assert cert.content_string == open('tests/data/x509/server/%s_ldap.cert.pem' % hostname).read() def test_ldap_server_dh_parameter_file(host): diff --git a/roles/ldap_server/molecule/default/tests/test_mandatory.py b/roles/ldap_server/molecule/default/tests/test_mandatory.py index 696680218870356df326cfd70084396b44c278c7..bed8fc0b3ede8be9b655305ee03c41f3f897674b 100644 --- a/roles/ldap_server/molecule/default/tests/test_mandatory.py +++ b/roles/ldap_server/molecule/default/tests/test_mandatory.py @@ -42,15 +42,15 @@ def test_certificate_validity_check_configuration(host): correctly. """ - inventory_hostname = host.ansible.get_variables()['inventory_hostname'] + hostname = host.run('hostname').stdout.strip() - config = host.file('/etc/check_certificate/%s_ldap.conf' % inventory_hostname) + config = host.file('/etc/check_certificate/%s_ldap.conf' % hostname) assert config.is_file assert config.user == 'root' assert config.group == 'root' assert config.mode == 0o644 - assert config.content_string == "/etc/ssl/certs/%s_ldap.pem" % inventory_hostname + assert config.content_string == "/etc/ssl/certs/%s_ldap.pem" % hostname def test_tls_connectivity(host): diff --git a/roles/ldap_server/molecule/default/tests/test_optional.py b/roles/ldap_server/molecule/default/tests/test_optional.py index 788c004018b1bf8ebbabbc237df9c115fafacdc4..f9e1197b3742be1893f9604fea18fadaec1ac515 100644 --- a/roles/ldap_server/molecule/default/tests/test_optional.py +++ b/roles/ldap_server/molecule/default/tests/test_optional.py @@ -44,15 +44,15 @@ def test_certificate_validity_check_configuration(host): correctly. """ - inventory_hostname = host.ansible.get_variables()['inventory_hostname'] + hostname = host.run('hostname').stdout.strip() - config = host.file('/etc/check_certificate/%s_ldap.conf' % inventory_hostname) + config = host.file('/etc/check_certificate/%s_ldap.conf' % hostname) assert config.is_file assert config.user == 'root' assert config.group == 'root' assert config.mode == 0o644 - assert config.content_string == "/etc/ssl/certs/%s_ldap.pem" % inventory_hostname + assert config.content_string == "/etc/ssl/certs/%s_ldap.pem" % hostname def test_tls_connectivity(host):