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/tmptxteqxd0 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/tmp46lt5otd/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:21:39 +0000 (0:00:00.013) 0:00:00.013 ********* ok: [/cache/rhel-8-y.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:21:40 +0000 (0:00:01.149) 0:00:01.163 ********* included: /tmp/tmp46lt5otd/tests/tasks/backup.yml for /cache/rhel-8-y.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmp46lt5otd/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:21:40 +0000 (0:00:00.026) 0:00:01.189 ********* included: /tmp/tmp46lt5otd/tests/tasks/setup.yml for /cache/rhel-8-y.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmp46lt5otd/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:21:40 +0000 (0:00:00.024) 0:00:01.213 ********* skipping: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmp46lt5otd/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:21:40 +0000 (0:00:00.041) 0:00:01.254 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmp46lt5otd/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:21:42 +0000 (0:00:01.397) 0:00:02.652 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.7h1vw371", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmp46lt5otd/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:21:42 +0000 (0:00:00.498) 0:00:03.151 ********* ok: [/cache/rhel-8-y.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.7h1vw371/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.7h1vw371/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.008115", "end": "2022-07-21 16:21:43.534484", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:21:43.526369" } ok: [/cache/rhel-8-y.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.7h1vw371/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.7h1vw371/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007755", "end": "2022-07-21 16:21:43.900273", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:21:43.892518" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:21:43 +0000 (0:00:00.876) 0:00:04.027 ********* changed: [/cache/rhel-8-y.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:21:44 +0000 (0:00:00.780) 0:00:04.808 ********* changed: [/cache/rhel-8-y.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/tmp46lt5otd/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:21:45 +0000 (0:00:00.781) 0:00:05.589 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:21:45 +0000 (0:00:00.035) 0:00:05.625 ********* included: /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/rhel-8-y.qcow2.snap TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:21:45 +0000 (0:00:00.029) 0:00:05.654 ********* ok: [/cache/rhel-8-y.qcow2.snap] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:21:45 +0000 (0:00:00.505) 0:00:06.160 ********* skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat_8.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/tmp46lt5otd/tests/roles/linux-system-roles.ssh/vars/RedHat_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.yml" } skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat_8.7.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.7.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:21:45 +0000 (0:00:00.049) 0:00:06.209 ********* ok: [/cache/rhel-8-y.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/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:21:47 +0000 (0:00:01.277) 0:00:07.487 ********* ok: [/cache/rhel-8-y.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/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:21:47 +0000 (0:00:00.482) 0:00:07.970 ********* changed: [/cache/rhel-8-y.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/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:21:48 +0000 (0:00:00.511) 0:00:08.482 ********* changed: [/cache/rhel-8-y.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-1658434908.111459-42724-55034276791456/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-8-y.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:21:49 +0000 (0:00:01.098) 0:00:09.580 ********* ok: [/cache/rhel-8-y.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/tmp46lt5otd/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:21:49 +0000 (0:00:00.365) 0:00:09.946 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:21:49 +0000 (0:00:00.473) 0:00:10.419 ********* [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-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658434908.3543968, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658434909.4423969, "dev": 64515, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 16812272, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658434909.4423969, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "927206102", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:21:50 +0000 (0:00:00.373) 0:00:10.793 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:21:50 +0000 (0:00:00.041) 0:00:10.834 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658434910.3013968, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434909.4463968, "dev": 64515, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 26338045, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434909.0473967, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1085695449", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:21:50 +0000 (0:00:00.371) 0:00:11.206 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658434910.3013968, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434909.4463968, "dev": 64515, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 26338045, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434909.0473967, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1085695449", "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/tmp46lt5otd/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:21:51 +0000 (0:00:00.384) 0:00:11.590 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:21:51 +0000 (0:00:00.047) 0:00:11.638 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:21:51 +0000 (0:00:00.034) 0:00:11.672 ********* changed: [/cache/rhel-8-y.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.005936", "end": "2022-07-21 16:21:51.971510", "rc": 0, "start": "2022-07-21 16:21:51.965574" } STDOUT: user somebody hostname example.com port 22 addkeystoagent false addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardagent no 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-,gss-gex-sha1-,gss-group14-sha1- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 casignaturealgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-256,rsa-sha2-512,ssh-rsa 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 pubkeyacceptedkeytypes ecdsa-sha2-nistp256,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,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,ssh-rsa,ssh-rsa-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_xmss canonicaldomains globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2 sendenv LANG sendenv LC_CTYPE sendenv LC_NUMERIC sendenv LC_TIME sendenv LC_COLLATE sendenv LC_MONETARY sendenv LC_MESSAGES sendenv LC_PAPER sendenv LC_NAME sendenv LC_ADDRESS sendenv LC_TELEPHONE sendenv LC_MEASUREMENT sendenv LC_IDENTIFICATION sendenv LC_ALL sendenv LANGUAGE sendenv XMODIFIERS connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 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/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/05-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-,gss-gex-sha1-,gss-group14-sha1-] 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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] 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/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/05-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-,gss-gex-sha1-,gss-group14-sha1-] 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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:21:51 +0000 (0:00:00.419) 0:00:12.092 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:21:51 +0000 (0:00:00.074) 0:00:12.167 ********* ok: [/cache/rhel-8-y.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/tmp46lt5otd/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:21:52 +0000 (0:00:00.375) 0:00:12.542 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmp46lt5otd/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:21:52 +0000 (0:00:00.046) 0:00:12.589 ********* included: /tmp/tmp46lt5otd/tests/tasks/restore.yml for /cache/rhel-8-y.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmp46lt5otd/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:21:52 +0000 (0:00:00.024) 0:00:12.613 ********* ok: [/cache/rhel-8-y.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.7h1vw371//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.7h1vw371//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.004984", "end": "2022-07-21 16:21:52.880916", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:21:52.875932" } ok: [/cache/rhel-8-y.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.7h1vw371//etc/ssh/ssh_config; then\n cp /tmp/ansible.7h1vw371//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.006537", "end": "2022-07-21 16:21:53.234866", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:21:53.228329" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmp46lt5otd/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:21:52 +0000 (0:00:00.740) 0:00:13.354 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.7h1vw371", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-8-y.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:21:53 +0000 (0:00:00.421) 0:00:13.775 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 1.40s /tmp/tmp46lt5otd/tests/tasks/setup.yml:7 -------------------------------------- linux-system-roles.ssh : Ensure required packages are installed --------- 1.28s /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- Gathering Facts --------------------------------------------------------- 1.15s /tmp/tmp46lt5otd/tests/tests_user_config.yml:2 -------------------------------- linux-system-roles.ssh : Generate the configuration file ---------------- 1.10s /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Backup files ------------------------------------------------------------ 0.88s /tmp/tmp46lt5otd/tests/tasks/backup.yml:13 ------------------------------------ Create a test user ------------------------------------------------------ 0.78s /tmp/tmp46lt5otd/tests/tests_user_config.yml:18 ------------------------------- Create a test group (with the same name as user) ------------------------ 0.78s /tmp/tmp46lt5otd/tests/tests_user_config.yml:14 ------------------------------- Restore backed up files and remove what was not present ----------------- 0.74s /tmp/tmp46lt5otd/tests/tasks/restore.yml:2 ------------------------------------ linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.51s /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.51s /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Create a temporary directory for backup files --------------------------- 0.50s /tmp/tmp46lt5otd/tests/tasks/backup.yml:5 ------------------------------------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.48s /tmp/tmp46lt5otd/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- Download the created configuration file --------------------------------- 0.47s /tmp/tmp46lt5otd/tests/tests_user_config.yml:46 ------------------------------- Remove temporary directory for backup files ----------------------------- 0.42s /tmp/tmp46lt5otd/tests/tasks/restore.yml:15 ----------------------------------- Test the effective configuration using ssh ------------------------------ 0.42s /tmp/tmp46lt5otd/tests/tests_user_config.yml:100 ------------------------------ Stat the configuration file --------------------------------------------- 0.38s /tmp/tmp46lt5otd/tests/tests_user_config.yml:75 ------------------------------- Download the global configuration files too ----------------------------- 0.38s /tmp/tmp46lt5otd/tests/tests_user_config.yml:119 ------------------------------ Stat the .ssh dir ------------------------------------------------------- 0.37s /tmp/tmp46lt5otd/tests/tests_user_config.yml:51 ------------------------------- Make sure the file is readable by user ---------------------------------- 0.37s /tmp/tmp46lt5otd/tests/tests_user_config.yml:68 ------------------------------- Gather information about the user --------------------------------------- 0.37s /tmp/tmp46lt5otd/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/tmptxteqxd0 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/tmpni6azq3t/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:24:16 +0000 (0:00:00.012) 0:00:00.012 ********* ok: [/cache/rhel-8-y.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:24:17 +0000 (0:00:01.118) 0:00:01.131 ********* included: /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml for /cache/rhel-8-y.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:24:17 +0000 (0:00:00.025) 0:00:01.156 ********* included: /tmp/tmpni6azq3t/tests/ssh/tasks/setup.yml for /cache/rhel-8-y.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpni6azq3t/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:24:17 +0000 (0:00:00.024) 0:00:01.181 ********* skipping: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpni6azq3t/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:24:17 +0000 (0:00:00.020) 0:00:01.202 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:24:19 +0000 (0:00:01.398) 0:00:02.600 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.9aj8vrt9", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:24:19 +0000 (0:00:00.492) 0:00:03.092 ********* ok: [/cache/rhel-8-y.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.9aj8vrt9/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.9aj8vrt9/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.007786", "end": "2022-07-21 16:24:19.562245", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:24:19.554459" } ok: [/cache/rhel-8-y.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.9aj8vrt9/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.9aj8vrt9/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007137", "end": "2022-07-21 16:24:19.909936", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:24:19.902799" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:24:20 +0000 (0:00:00.880) 0:00:03.972 ********* changed: [/cache/rhel-8-y.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:24:21 +0000 (0:00:00.770) 0:00:04.742 ********* changed: [/cache/rhel-8-y.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/tmpni6azq3t/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:24:22 +0000 (0:00:00.799) 0:00:05.542 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:24:22 +0000 (0:00:00.037) 0:00:05.580 ********* included: /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/rhel-8-y.qcow2.snap TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:24:22 +0000 (0:00:00.028) 0:00:05.609 ********* ok: [/cache/rhel-8-y.qcow2.snap] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:24:22 +0000 (0:00:00.492) 0:00:06.101 ********* skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat_8.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/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/RedHat_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.yml" } skipping: [/cache/rhel-8-y.qcow2.snap] => (item=RedHat_8.7.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.7.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:24:22 +0000 (0:00:00.050) 0:00:06.151 ********* ok: [/cache/rhel-8-y.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/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:24:23 +0000 (0:00:01.297) 0:00:07.449 ********* ok: [/cache/rhel-8-y.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/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:24:24 +0000 (0:00:00.504) 0:00:07.953 ********* changed: [/cache/rhel-8-y.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/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:24:24 +0000 (0:00:00.510) 0:00:08.464 ********* changed: [/cache/rhel-8-y.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-1658435065.0748196-46107-139657041817180/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-8-y.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:24:26 +0000 (0:00:01.081) 0:00:09.545 ********* ok: [/cache/rhel-8-y.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/tmpni6azq3t/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:24:26 +0000 (0:00:00.358) 0:00:09.904 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:24:26 +0000 (0:00:00.471) 0:00:10.376 ********* [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-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435064.3968813, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435065.4678814, "dev": 64515, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 16812272, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435065.4678814, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "3002350648", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:24:27 +0000 (0:00:00.398) 0:00:10.774 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:24:27 +0000 (0:00:00.035) 0:00:10.810 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435066.3108814, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435065.4718814, "dev": 64515, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 26338045, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435065.0738814, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "4223605995", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:24:27 +0000 (0:00:00.402) 0:00:11.213 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435066.3108814, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435065.4718814, "dev": 64515, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 26338045, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435065.0738814, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "4223605995", "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/tmpni6azq3t/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:24:28 +0000 (0:00:00.432) 0:00:11.645 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:24:28 +0000 (0:00:00.053) 0:00:11.698 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:24:28 +0000 (0:00:00.039) 0:00:11.737 ********* changed: [/cache/rhel-8-y.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.005824", "end": "2022-07-21 16:24:28.110230", "rc": 0, "start": "2022-07-21 16:24:28.104406" } STDOUT: user somebody hostname example.com port 22 addkeystoagent false addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardagent no 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-,gss-gex-sha1-,gss-group14-sha1- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 casignaturealgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-256,rsa-sha2-512,ssh-rsa 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 pubkeyacceptedkeytypes ecdsa-sha2-nistp256,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,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,ssh-rsa,ssh-rsa-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_xmss canonicaldomains globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2 sendenv LANG sendenv LC_CTYPE sendenv LC_NUMERIC sendenv LC_TIME sendenv LC_COLLATE sendenv LC_MONETARY sendenv LC_MESSAGES sendenv LC_PAPER sendenv LC_NAME sendenv LC_ADDRESS sendenv LC_TELEPHONE sendenv LC_MEASUREMENT sendenv LC_IDENTIFICATION sendenv LC_ALL sendenv LANGUAGE sendenv XMODIFIERS connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 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/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/05-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-,gss-gex-sha1-,gss-group14-sha1-] 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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] 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/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/05-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-,gss-gex-sha1-,gss-group14-sha1-] 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,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:24:28 +0000 (0:00:00.438) 0:00:12.176 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:24:28 +0000 (0:00:00.049) 0:00:12.225 ********* ok: [/cache/rhel-8-y.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/tmpni6azq3t/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:24:29 +0000 (0:00:00.363) 0:00:12.589 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:24:29 +0000 (0:00:00.081) 0:00:12.671 ********* included: /tmp/tmpni6azq3t/tests/ssh/tasks/restore.yml for /cache/rhel-8-y.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpni6azq3t/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:24:29 +0000 (0:00:00.027) 0:00:12.698 ********* ok: [/cache/rhel-8-y.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.9aj8vrt9//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.9aj8vrt9//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.006441", "end": "2022-07-21 16:24:29.059149", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:24:29.052708" } ok: [/cache/rhel-8-y.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.9aj8vrt9//etc/ssh/ssh_config; then\n cp /tmp/ansible.9aj8vrt9//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.005830", "end": "2022-07-21 16:24:29.415630", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:24:29.409800" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpni6azq3t/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:24:30 +0000 (0:00:00.783) 0:00:13.482 ********* ok: [/cache/rhel-8-y.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.9aj8vrt9", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-8-y.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:24:30 +0000 (0:00:00.410) 0:00:13.892 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 1.40s /tmp/tmpni6azq3t/tests/ssh/tasks/setup.yml:7 ---------------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 1.30s /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Gathering Facts --------------------------------------------------------- 1.12s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:2 ---------------------------- fedora.linux_system_roles.ssh : Generate the configuration file --------- 1.08s /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Backup files ------------------------------------------------------------ 0.88s /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml:13 -------------------------------- Create a test user ------------------------------------------------------ 0.80s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:18 --------------------------- Restore backed up files and remove what was not present ----------------- 0.78s /tmp/tmpni6azq3t/tests/ssh/tasks/restore.yml:2 -------------------------------- Create a test group (with the same name as user) ------------------------ 0.77s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:14 --------------------------- fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.51s /tmp/tmptxteqxd0/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.50s /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Create a temporary directory for backup files --------------------------- 0.49s /tmp/tmpni6azq3t/tests/ssh/tasks/backup.yml:5 --------------------------------- fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.49s /tmp/tmptxteqxd0/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Download the created configuration file --------------------------------- 0.47s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:45 --------------------------- Test the effective configuration using ssh ------------------------------ 0.44s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:97 --------------------------- Stat the configuration file --------------------------------------------- 0.43s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:73 --------------------------- Remove temporary directory for backup files ----------------------------- 0.41s /tmp/tmpni6azq3t/tests/ssh/tasks/restore.yml:15 ------------------------------- Make sure the file is readable by user ---------------------------------- 0.40s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:66 --------------------------- Stat the .ssh dir ------------------------------------------------------- 0.40s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:50 --------------------------- Download the global configuration files too ----------------------------- 0.36s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:114 -------------------------- Gather information about the user --------------------------------------- 0.36s /tmp/tmpni6azq3t/tests/ssh/tests_user_config.yml:35 ---------------------------