ansible-playbook [core 2.12.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /tmp/tmp08vsdpvi executable location = /usr/bin/ansible-playbook python version = 3.9.13 (main, May 18 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] jinja version = 2.11.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmposga18ev/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:24:29 +0000 (0:00:00.013) 0:00:00.013 ********* ok: [/cache/rhel-9.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:24:30 +0000 (0:00:01.120) 0:00:01.134 ********* included: /tmp/tmposga18ev/tests/tasks/backup.yml for /cache/rhel-9.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmposga18ev/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:24:30 +0000 (0:00:00.027) 0:00:01.161 ********* included: /tmp/tmposga18ev/tests/tasks/setup.yml for /cache/rhel-9.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmposga18ev/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:24:30 +0000 (0:00:00.027) 0:00:01.188 ********* skipping: [/cache/rhel-9.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmposga18ev/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:24:30 +0000 (0:00:00.046) 0:00:01.235 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmposga18ev/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:24:31 +0000 (0:00:00.951) 0:00:02.187 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.l2p16i5v", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmposga18ev/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:24:32 +0000 (0:00:00.441) 0:00:02.628 ********* ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /etc/ssh/ssh_config.d/00-ansible.conf; then\n mkdir -p /tmp/ansible.l2p16i5v/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.l2p16i5v/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.007217", "end": "2022-07-21 16:24:31.692434", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:24:31.685217" } ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /etc/ssh/ssh_config; then\n mkdir -p /tmp/ansible.l2p16i5v/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.l2p16i5v/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007571", "end": "2022-07-21 16:24:32.039393", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:24:32.031822" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmposga18ev/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:24:33 +0000 (0:00:00.844) 0:00:03.473 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:24:33 +0000 (0:00:00.550) 0:00:04.023 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "comment": "", "create_home": true, "group": 1001, "home": "/home/tester123", "name": "tester123", "shell": "/bin/bash", "state": "present", "system": false, "uid": 1001 } TASK [Run role] **************************************************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:24:34 +0000 (0:00:00.588) 0:00:04.612 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:24:34 +0000 (0:00:00.034) 0:00:04.646 ********* included: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/rhel-9.qcow2.snap TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:24:34 +0000 (0:00:00.028) 0:00:04.675 ********* ok: [/cache/rhel-9.qcow2.snap] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:24:34 +0000 (0:00:00.493) 0:00:05.168 ********* skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-9.qcow2.snap] => (item=RedHat_9.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/vars/RedHat_9.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_9.yml" } skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat_9.0.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_9.0.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:24:34 +0000 (0:00:00.051) 0:00:05.220 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [linux-system-roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:24:35 +0000 (0:00:00.813) 0:00:06.033 ********* ok: [/cache/rhel-9.qcow2.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions] *** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:24:36 +0000 (0:00:00.479) 0:00:06.512 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "gid": 1001, "group": "tester123", "mode": "0700", "owner": "tester123", "path": "/home/tester123/.ssh/", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 6, "state": "directory", "uid": 1001 } TASK [linux-system-roles.ssh : Generate the configuration file] **************** task path: /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:24:36 +0000 (0:00:00.505) 0:00:07.017 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "dest": "/home/tester123/.ssh/config", "gid": 1001, "group": "tester123", "md5sum": "df1b5553fea0fc8007bd9d80d983bbbe", "mode": "0600", "owner": "tester123", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 98, "src": "/root/.ansible/tmp/ansible-tmp-1658435076.8536568-46773-141395581390401/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-9.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:24:37 +0000 (0:00:01.112) 0:00:08.130 ********* ok: [/cache/rhel-9.qcow2.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:24:38 +0000 (0:00:00.367) 0:00:08.498 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:24:38 +0000 (0:00:00.484) 0:00:08.982 ********* [WARNING]: Module remote_tmp /home/tester123/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp dir with the correct permissions manually ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435075.582214, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435076.686214, "dev": 64516, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25716300, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435076.686214, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "3348996829", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:24:39 +0000 (0:00:00.381) 0:00:09.364 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:24:39 +0000 (0:00:00.035) 0:00:09.400 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435077.550214, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435076.6872141, "dev": 64516, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25227, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435076.283214, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "2686096753", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:24:39 +0000 (0:00:00.379) 0:00:09.779 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435077.550214, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435076.6872141, "dev": 64516, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25227, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435076.283214, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "2686096753", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify the options are in the file] ************************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:24:39 +0000 (0:00:00.370) 0:00:10.150 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:24:39 +0000 (0:00:00.079) 0:00:10.229 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.038) 0:00:10.268 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.008275", "end": "2022-07-21 16:24:39.229106", "rc": 0, "start": "2022-07-21 16:24:39.220831" } STDOUT: user somebody hostname example.com port 22 addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false checkhostip no compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapikeyexchange no gssapidelegatecredentials no gssapitrustdns no gssapirenewalforcesrekey no gssapikexalgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto sessiontype default stdinnull no forkafterauthentication no streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys true canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr hostkeyalgorithms ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedacceptedalgorithms ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512 casignaturealgorithms ecdsa-sha2-nistp256,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-256,rsa-sha2-512 loglevel DEBUG3 macs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 securitykeyprovider internal pubkeyacceptedalgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ecdsa_sk identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_ed25519_sk identityfile ~/.ssh/id_xmss canonicaldomains none globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile /home/tester123/.ssh/known_hosts /home/tester123/.ssh/known_hosts2 logverbose none permitremoteopen any addkeystoagent false forwardagent no connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.7p1, OpenSSL 3.0.1 14 Dec 2021 debug1: Reading configuration data /home/tester123/.ssh/config debug1: /home/tester123/.ssh/config line 5: Applying options for example debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512] debug1: configuration requests final Match pass debug1: re-parsing configuration debug1: Reading configuration data /home/tester123/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512] debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/tester123/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/tester123/.ssh/known_hosts2' TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.395) 0:00:10.664 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmposga18ev/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.077) 0:00:10.741 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkluY2x1ZGUgL2V0Yy9zc2gvc3NoX2NvbmZpZy5kLyouY29uZgo=", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.398) 0:00:11.140 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmposga18ev/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.049) 0:00:11.189 ********* included: /tmp/tmposga18ev/tests/tasks/restore.yml for /cache/rhel-9.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmposga18ev/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:24:40 +0000 (0:00:00.027) 0:00:11.216 ********* ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.l2p16i5v//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.l2p16i5v//etc/ssh/ssh_config.d/00-ansible.conf $(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nelif test -f /etc/ssh/ssh_config.d/00-ansible.conf; then\n rm /etc/ssh/ssh_config.d/00-ansible.conf\nfi\n", "delta": "0:00:00.005169", "end": "2022-07-21 16:24:40.188952", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:24:40.183783" } ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.l2p16i5v//etc/ssh/ssh_config; then\n cp /tmp/ansible.l2p16i5v//etc/ssh/ssh_config $(dirname /etc/ssh/ssh_config)\nelif test -f /etc/ssh/ssh_config; then\n rm /etc/ssh/ssh_config\nfi\n", "delta": "0:00:00.005235", "end": "2022-07-21 16:24:40.525878", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:24:40.520643" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmposga18ev/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:24:41 +0000 (0:00:00.739) 0:00:11.956 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.l2p16i5v", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-9.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:24:42 +0000 (0:00:00.400) 0:00:12.356 ********* =============================================================================== Gathering Facts --------------------------------------------------------- 1.12s /tmp/tmposga18ev/tests/tests_user_config.yml:2 -------------------------------- linux-system-roles.ssh : Generate the configuration file ---------------- 1.11s /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Make sure openssh is installed before creating backup ------------------- 0.95s /tmp/tmposga18ev/tests/tasks/setup.yml:7 -------------------------------------- Backup files ------------------------------------------------------------ 0.84s /tmp/tmposga18ev/tests/tasks/backup.yml:13 ------------------------------------ linux-system-roles.ssh : Ensure required packages are installed --------- 0.81s /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- Restore backed up files and remove what was not present ----------------- 0.74s /tmp/tmposga18ev/tests/tasks/restore.yml:2 ------------------------------------ Create a test user ------------------------------------------------------ 0.59s /tmp/tmposga18ev/tests/tests_user_config.yml:18 ------------------------------- Create a test group (with the same name as user) ------------------------ 0.55s /tmp/tmposga18ev/tests/tests_user_config.yml:14 ------------------------------- linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.51s /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.49s /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Download the created configuration file --------------------------------- 0.48s /tmp/tmposga18ev/tests/tests_user_config.yml:46 ------------------------------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.48s /tmp/tmposga18ev/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- Create a temporary directory for backup files --------------------------- 0.44s /tmp/tmposga18ev/tests/tasks/backup.yml:5 ------------------------------------- Remove temporary directory for backup files ----------------------------- 0.40s /tmp/tmposga18ev/tests/tasks/restore.yml:15 ----------------------------------- Download the global configuration files too ----------------------------- 0.40s /tmp/tmposga18ev/tests/tests_user_config.yml:119 ------------------------------ Test the effective configuration using ssh ------------------------------ 0.40s /tmp/tmposga18ev/tests/tests_user_config.yml:100 ------------------------------ Stat the .ssh dir ------------------------------------------------------- 0.38s /tmp/tmposga18ev/tests/tests_user_config.yml:51 ------------------------------- Make sure the file is readable by user ---------------------------------- 0.38s /tmp/tmposga18ev/tests/tests_user_config.yml:68 ------------------------------- Stat the configuration file --------------------------------------------- 0.37s /tmp/tmposga18ev/tests/tests_user_config.yml:75 ------------------------------- Gather information about the user --------------------------------------- 0.37s /tmp/tmposga18ev/tests/tests_user_config.yml:35 ------------------------------- ansible-playbook [core 2.12.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /tmp/tmp08vsdpvi executable location = /usr/bin/ansible-playbook python version = 3.9.13 (main, May 18 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] jinja version = 2.11.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:26:46 +0000 (0:00:00.013) 0:00:00.013 ********* ok: [/cache/rhel-9.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:26:47 +0000 (0:00:01.140) 0:00:01.153 ********* included: /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml for /cache/rhel-9.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:26:47 +0000 (0:00:00.026) 0:00:01.180 ********* included: /tmp/tmpbvj7axe_/tests/ssh/tasks/setup.yml for /cache/rhel-9.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:26:47 +0000 (0:00:00.046) 0:00:01.227 ********* skipping: [/cache/rhel-9.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:26:47 +0000 (0:00:00.022) 0:00:01.249 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:26:48 +0000 (0:00:00.984) 0:00:02.233 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.7a_bnqfi", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:26:49 +0000 (0:00:00.450) 0:00:02.684 ********* ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /etc/ssh/ssh_config.d/00-ansible.conf; then\n mkdir -p /tmp/ansible.7a_bnqfi/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.7a_bnqfi/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.007482", "end": "2022-07-21 16:26:48.402721", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:26:48.395239" } ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /etc/ssh/ssh_config; then\n mkdir -p /tmp/ansible.7a_bnqfi/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.7a_bnqfi/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007386", "end": "2022-07-21 16:26:48.763090", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:26:48.755704" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:26:49 +0000 (0:00:00.876) 0:00:03.560 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:26:50 +0000 (0:00:00.558) 0:00:04.118 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "comment": "", "create_home": true, "group": 1001, "home": "/home/tester123", "name": "tester123", "shell": "/bin/bash", "state": "present", "system": false, "uid": 1001 } TASK [Run role] **************************************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:26:51 +0000 (0:00:00.623) 0:00:04.742 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:26:51 +0000 (0:00:00.037) 0:00:04.779 ********* included: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/rhel-9.qcow2.snap TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:26:51 +0000 (0:00:00.029) 0:00:04.808 ********* ok: [/cache/rhel-9.qcow2.snap] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:26:51 +0000 (0:00:00.508) 0:00:05.317 ********* skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-9.qcow2.snap] => (item=RedHat_9.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/RedHat_9.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_9.yml" } skipping: [/cache/rhel-9.qcow2.snap] => (item=RedHat_9.0.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_9.0.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:26:51 +0000 (0:00:00.053) 0:00:05.370 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [fedora.linux_system_roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:26:52 +0000 (0:00:00.807) 0:00:06.178 ********* ok: [/cache/rhel-9.qcow2.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions] *** task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:26:53 +0000 (0:00:00.492) 0:00:06.670 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "gid": 1001, "group": "tester123", "mode": "0700", "owner": "tester123", "path": "/home/tester123/.ssh/", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 6, "state": "directory", "uid": 1001 } TASK [fedora.linux_system_roles.ssh : Generate the configuration file] ********* task path: /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:26:53 +0000 (0:00:00.507) 0:00:07.178 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "dest": "/home/tester123/.ssh/config", "gid": 1001, "group": "tester123", "md5sum": "df1b5553fea0fc8007bd9d80d983bbbe", "mode": "0600", "owner": "tester123", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 98, "src": "/root/.ansible/tmp/ansible-tmp-1658435213.65721-50175-114445130383647/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-9.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:26:54 +0000 (0:00:01.099) 0:00:08.278 ********* ok: [/cache/rhel-9.qcow2.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:26:55 +0000 (0:00:00.371) 0:00:08.650 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:26:55 +0000 (0:00:00.476) 0:00:09.126 ********* [WARNING]: Module remote_tmp /home/tester123/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp dir with the correct permissions manually ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435212.3693995, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435213.4713995, "dev": 64516, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25716300, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435213.4713995, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "3651152971", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:26:55 +0000 (0:00:00.390) 0:00:09.517 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:26:55 +0000 (0:00:00.037) 0:00:09.554 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435214.3313994, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435213.4723995, "dev": 64516, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25227, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435213.0753994, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "218668816", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:26:56 +0000 (0:00:00.384) 0:00:09.939 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435214.3313994, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435213.4723995, "dev": 64516, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 25227, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435213.0753994, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "218668816", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify the options are in the file] ************************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:26:56 +0000 (0:00:00.414) 0:00:10.353 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:26:56 +0000 (0:00:00.051) 0:00:10.404 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:26:56 +0000 (0:00:00.034) 0:00:10.439 ********* changed: [/cache/rhel-9.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.007467", "end": "2022-07-21 16:26:56.068703", "rc": 0, "start": "2022-07-21 16:26:56.061236" } STDOUT: user somebody hostname example.com port 22 addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false checkhostip no compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapikeyexchange no gssapidelegatecredentials no gssapitrustdns no gssapirenewalforcesrekey no gssapikexalgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto sessiontype default stdinnull no forkafterauthentication no streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys true canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr hostkeyalgorithms ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedacceptedalgorithms ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512 casignaturealgorithms ecdsa-sha2-nistp256,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-256,rsa-sha2-512 loglevel DEBUG3 macs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 securitykeyprovider internal pubkeyacceptedalgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ecdsa_sk identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_ed25519_sk identityfile ~/.ssh/id_xmss canonicaldomains none globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile /home/tester123/.ssh/known_hosts /home/tester123/.ssh/known_hosts2 logverbose none permitremoteopen any addkeystoagent false forwardagent no connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.7p1, OpenSSL 3.0.1 14 Dec 2021 debug1: Reading configuration data /home/tester123/.ssh/config debug1: /home/tester123/.ssh/config line 5: Applying options for example debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512] debug1: configuration requests final Match pass debug1: re-parsing configuration debug1: Reading configuration data /home/tester123/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512] debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/tester123/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/tester123/.ssh/known_hosts2' TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:26:57 +0000 (0:00:00.426) 0:00:10.865 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:26:57 +0000 (0:00:00.075) 0:00:10.941 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkluY2x1ZGUgL2V0Yy9zc2gvc3NoX2NvbmZpZy5kLyouY29uZgo=", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:26:57 +0000 (0:00:00.368) 0:00:11.309 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:26:57 +0000 (0:00:00.076) 0:00:11.385 ********* included: /tmp/tmpbvj7axe_/tests/ssh/tasks/restore.yml for /cache/rhel-9.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:26:57 +0000 (0:00:00.027) 0:00:11.413 ********* ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.7a_bnqfi//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.7a_bnqfi//etc/ssh/ssh_config.d/00-ansible.conf $(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nelif test -f /etc/ssh/ssh_config.d/00-ansible.conf; then\n rm /etc/ssh/ssh_config.d/00-ansible.conf\nfi\n", "delta": "0:00:00.005477", "end": "2022-07-21 16:26:57.031883", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:26:57.026406" } ok: [/cache/rhel-9.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.7a_bnqfi//etc/ssh/ssh_config; then\n cp /tmp/ansible.7a_bnqfi//etc/ssh/ssh_config $(dirname /etc/ssh/ssh_config)\nelif test -f /etc/ssh/ssh_config; then\n rm /etc/ssh/ssh_config\nfi\n", "delta": "0:00:00.005540", "end": "2022-07-21 16:26:57.377547", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:26:57.372007" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpbvj7axe_/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:26:58 +0000 (0:00:00.762) 0:00:12.175 ********* ok: [/cache/rhel-9.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.7a_bnqfi", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-9.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:26:58 +0000 (0:00:00.384) 0:00:12.559 ********* =============================================================================== Gathering Facts --------------------------------------------------------- 1.14s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:2 ---------------------------- fedora.linux_system_roles.ssh : Generate the configuration file --------- 1.10s /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Make sure openssh is installed before creating backup ------------------- 0.98s /tmp/tmpbvj7axe_/tests/ssh/tasks/setup.yml:7 ---------------------------------- Backup files ------------------------------------------------------------ 0.88s /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml:13 -------------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 0.81s /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Restore backed up files and remove what was not present ----------------- 0.76s /tmp/tmpbvj7axe_/tests/ssh/tasks/restore.yml:2 -------------------------------- Create a test user ------------------------------------------------------ 0.62s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:18 --------------------------- Create a test group (with the same name as user) ------------------------ 0.56s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:14 --------------------------- fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.51s /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.51s /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.49s /tmp/tmp08vsdpvi/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Download the created configuration file --------------------------------- 0.48s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:45 --------------------------- Create a temporary directory for backup files --------------------------- 0.45s /tmp/tmpbvj7axe_/tests/ssh/tasks/backup.yml:5 --------------------------------- Test the effective configuration using ssh ------------------------------ 0.43s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:97 --------------------------- Stat the configuration file --------------------------------------------- 0.41s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:73 --------------------------- Stat the .ssh dir ------------------------------------------------------- 0.39s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:50 --------------------------- Make sure the file is readable by user ---------------------------------- 0.38s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:66 --------------------------- Remove temporary directory for backup files ----------------------------- 0.38s /tmp/tmpbvj7axe_/tests/ssh/tasks/restore.yml:15 ------------------------------- Gather information about the user --------------------------------------- 0.37s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:35 --------------------------- Download the global configuration files too ----------------------------- 0.37s /tmp/tmpbvj7axe_/tests/ssh/tests_user_config.yml:114 --------------------------