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/tmpb2a4zynw 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/tmp507tgphv/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:34:11 +0000 (0:00:00.013) 0:00:00.013 ********* ok: [/cache/fedora-35.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:34:13 +0000 (0:00:01.089) 0:00:01.102 ********* included: /tmp/tmp507tgphv/tests/tasks/backup.yml for /cache/fedora-35.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmp507tgphv/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:34:13 +0000 (0:00:00.026) 0:00:01.129 ********* included: /tmp/tmp507tgphv/tests/tasks/setup.yml for /cache/fedora-35.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmp507tgphv/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:34:13 +0000 (0:00:00.025) 0:00:01.154 ********* skipping: [/cache/fedora-35.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmp507tgphv/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:34:13 +0000 (0:00:00.045) 0:00:01.200 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmp507tgphv/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:34:15 +0000 (0:00:01.953) 0:00:03.154 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.tkwkpaf6", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 40, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmp507tgphv/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:34:15 +0000 (0:00:00.487) 0:00:03.641 ********* ok: [/cache/fedora-35.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.tkwkpaf6/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.tkwkpaf6/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.008836", "end": "2022-07-21 20:34:15.419694", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:34:15.410858" } ok: [/cache/fedora-35.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.tkwkpaf6/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.tkwkpaf6/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007845", "end": "2022-07-21 20:34:15.785387", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:34:15.777542" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:34:16 +0000 (0:00:00.877) 0:00:04.519 ********* changed: [/cache/fedora-35.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:34:17 +0000 (0:00:00.564) 0:00:05.084 ********* changed: [/cache/fedora-35.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/tmp507tgphv/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:34:17 +0000 (0:00:00.621) 0:00:05.705 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:34:17 +0000 (0:00:00.034) 0:00:05.740 ********* included: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/fedora-35.qcow2.snap TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:34:17 +0000 (0:00:00.026) 0:00:05.766 ********* ok: [/cache/fedora-35.qcow2.snap] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:34:18 +0000 (0:00:00.521) 0:00:06.288 ********* skipping: [/cache/fedora-35.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/fedora-35.qcow2.snap] => (item=Fedora.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/tmp507tgphv/tests/roles/linux-system-roles.ssh/vars/Fedora.yml" ], "ansible_loop_var": "item", "changed": false, "item": "Fedora.yml" } skipping: [/cache/fedora-35.qcow2.snap] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/fedora-35.qcow2.snap] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:34:18 +0000 (0:00:00.050) 0:00:06.338 ********* ok: [/cache/fedora-35.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/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:34:20 +0000 (0:00:01.786) 0:00:08.124 ********* ok: [/cache/fedora-35.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/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:34:20 +0000 (0:00:00.534) 0:00:08.659 ********* changed: [/cache/fedora-35.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": 0, "state": "directory", "uid": 1001 } TASK [linux-system-roles.ssh : Generate the configuration file] **************** task path: /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:34:21 +0000 (0:00:00.529) 0:00:09.189 ********* changed: [/cache/fedora-35.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-1658435661.2036335-55244-16294484123513/source", "state": "file", "uid": 1001 } META: role_complete for /cache/fedora-35.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:34:22 +0000 (0:00:01.110) 0:00:10.300 ********* ok: [/cache/fedora-35.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/tmp507tgphv/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:34:22 +0000 (0:00:00.385) 0:00:10.685 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:34:23 +0000 (0:00:00.495) 0:00:11.181 ********* [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/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435660.450194, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435661.5521939, "dev": 37, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 267, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435661.5521939, "nlink": 1, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 12, "uid": 1001, "version": "46", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:34:23 +0000 (0:00:00.416) 0:00:11.598 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:34:23 +0000 (0:00:00.038) 0:00:11.636 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435662.445194, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435661.5521939, "dev": 37, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 268, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435661.138194, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "47", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:34:23 +0000 (0:00:00.390) 0:00:12.026 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435662.445194, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435661.5521939, "dev": 37, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 268, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435661.138194, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "47", "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/tmp507tgphv/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:34:24 +0000 (0:00:00.426) 0:00:12.453 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:34:24 +0000 (0:00:00.049) 0:00:12.502 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:34:24 +0000 (0:00:00.037) 0:00:12.540 ********* changed: [/cache/fedora-35.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.006837", "end": "2022-07-21 20:34:24.254622", "rc": 0, "start": "2022-07-21 20:34:24.247785" } 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 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 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 1.1.1o FIPS 3 May 2022 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/tmp507tgphv/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:34:24 +0000 (0:00:00.450) 0:00:12.991 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:34:25 +0000 (0:00:00.078) 0:00:13.070 ********* ok: [/cache/fedora-35.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/tmp507tgphv/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:34:25 +0000 (0:00:00.367) 0:00:13.437 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmp507tgphv/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:34:25 +0000 (0:00:00.057) 0:00:13.494 ********* included: /tmp/tmp507tgphv/tests/tasks/restore.yml for /cache/fedora-35.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmp507tgphv/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:34:25 +0000 (0:00:00.027) 0:00:13.522 ********* ok: [/cache/fedora-35.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.tkwkpaf6//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.tkwkpaf6//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.005660", "end": "2022-07-21 20:34:25.192027", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:34:25.186367" } ok: [/cache/fedora-35.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.tkwkpaf6//etc/ssh/ssh_config; then\n cp /tmp/ansible.tkwkpaf6//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.006083", "end": "2022-07-21 20:34:25.553435", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:34:25.547352" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmp507tgphv/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:34:26 +0000 (0:00:00.767) 0:00:14.289 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.tkwkpaf6", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/fedora-35.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:34:26 +0000 (0:00:00.399) 0:00:14.689 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 1.95s /tmp/tmp507tgphv/tests/tasks/setup.yml:7 -------------------------------------- linux-system-roles.ssh : Ensure required packages are installed --------- 1.79s /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- linux-system-roles.ssh : Generate the configuration file ---------------- 1.11s /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Gathering Facts --------------------------------------------------------- 1.09s /tmp/tmp507tgphv/tests/tests_user_config.yml:2 -------------------------------- Backup files ------------------------------------------------------------ 0.88s /tmp/tmp507tgphv/tests/tasks/backup.yml:13 ------------------------------------ Restore backed up files and remove what was not present ----------------- 0.77s /tmp/tmp507tgphv/tests/tasks/restore.yml:2 ------------------------------------ Create a test user ------------------------------------------------------ 0.62s /tmp/tmp507tgphv/tests/tests_user_config.yml:18 ------------------------------- Create a test group (with the same name as user) ------------------------ 0.56s /tmp/tmp507tgphv/tests/tests_user_config.yml:14 ------------------------------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.53s /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.53s /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.52s /tmp/tmp507tgphv/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Download the created configuration file --------------------------------- 0.50s /tmp/tmp507tgphv/tests/tests_user_config.yml:46 ------------------------------- Create a temporary directory for backup files --------------------------- 0.49s /tmp/tmp507tgphv/tests/tasks/backup.yml:5 ------------------------------------- Test the effective configuration using ssh ------------------------------ 0.45s /tmp/tmp507tgphv/tests/tests_user_config.yml:100 ------------------------------ Stat the configuration file --------------------------------------------- 0.43s /tmp/tmp507tgphv/tests/tests_user_config.yml:75 ------------------------------- Stat the .ssh dir ------------------------------------------------------- 0.42s /tmp/tmp507tgphv/tests/tests_user_config.yml:51 ------------------------------- Remove temporary directory for backup files ----------------------------- 0.40s /tmp/tmp507tgphv/tests/tasks/restore.yml:15 ----------------------------------- Make sure the file is readable by user ---------------------------------- 0.39s /tmp/tmp507tgphv/tests/tests_user_config.yml:68 ------------------------------- Gather information about the user --------------------------------------- 0.39s /tmp/tmp507tgphv/tests/tests_user_config.yml:35 ------------------------------- Download the global configuration files too ----------------------------- 0.37s /tmp/tmp507tgphv/tests/tests_user_config.yml:119 ------------------------------ 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/tmpb2a4zynw 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/tmpdljjmvxt/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:37:00 +0000 (0:00:00.012) 0:00:00.012 ********* ok: [/cache/fedora-35.qcow2.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:37:01 +0000 (0:00:01.111) 0:00:01.124 ********* included: /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml for /cache/fedora-35.qcow2.snap TASK [Setup] ******************************************************************* task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:37:01 +0000 (0:00:00.027) 0:00:01.151 ********* included: /tmp/tmpdljjmvxt/tests/ssh/tasks/setup.yml for /cache/fedora-35.qcow2.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:37:01 +0000 (0:00:00.026) 0:00:01.177 ********* skipping: [/cache/fedora-35.qcow2.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:37:01 +0000 (0:00:00.043) 0:00:01.221 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:37:03 +0000 (0:00:01.992) 0:00:03.214 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.a1hcnbac", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 40, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:37:03 +0000 (0:00:00.484) 0:00:03.698 ********* ok: [/cache/fedora-35.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.a1hcnbac/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.a1hcnbac/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.008269", "end": "2022-07-21 20:37:03.923313", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:37:03.915044" } ok: [/cache/fedora-35.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.a1hcnbac/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.a1hcnbac/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.009311", "end": "2022-07-21 20:37:04.286888", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:37:04.277577" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:37:04 +0000 (0:00:00.881) 0:00:04.580 ********* changed: [/cache/fedora-35.qcow2.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:37:05 +0000 (0:00:00.555) 0:00:05.135 ********* changed: [/cache/fedora-35.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/tmpdljjmvxt/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:37:05 +0000 (0:00:00.613) 0:00:05.748 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:37:06 +0000 (0:00:00.038) 0:00:05.787 ********* included: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/fedora-35.qcow2.snap TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:37:06 +0000 (0:00:00.028) 0:00:05.816 ********* ok: [/cache/fedora-35.qcow2.snap] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:37:06 +0000 (0:00:00.506) 0:00:06.323 ********* skipping: [/cache/fedora-35.qcow2.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/fedora-35.qcow2.snap] => (item=Fedora.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/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/Fedora.yml" ], "ansible_loop_var": "item", "changed": false, "item": "Fedora.yml" } skipping: [/cache/fedora-35.qcow2.snap] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/fedora-35.qcow2.snap] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:37:06 +0000 (0:00:00.053) 0:00:06.376 ********* ok: [/cache/fedora-35.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/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:37:08 +0000 (0:00:01.805) 0:00:08.182 ********* ok: [/cache/fedora-35.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/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:37:08 +0000 (0:00:00.537) 0:00:08.720 ********* changed: [/cache/fedora-35.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": 0, "state": "directory", "uid": 1001 } TASK [fedora.linux_system_roles.ssh : Generate the configuration file] ********* task path: /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:37:09 +0000 (0:00:00.537) 0:00:09.257 ********* changed: [/cache/fedora-35.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-1658435829.5700803-58621-54721937603447/source", "state": "file", "uid": 1001 } META: role_complete for /cache/fedora-35.qcow2.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:37:10 +0000 (0:00:01.132) 0:00:10.390 ********* ok: [/cache/fedora-35.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/tmpdljjmvxt/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:37:11 +0000 (0:00:00.391) 0:00:10.782 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:37:11 +0000 (0:00:00.497) 0:00:11.280 ********* [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/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435828.9638371, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435830.086837, "dev": 37, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 267, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435830.086837, "nlink": 1, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 12, "uid": 1001, "version": "46", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:37:11 +0000 (0:00:00.404) 0:00:11.685 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:37:11 +0000 (0:00:00.069) 0:00:11.755 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435830.990837, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435830.0878372, "dev": 37, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 268, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435829.665837, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "46", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:37:12 +0000 (0:00:00.441) 0:00:12.197 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "stat": { "atime": 1658435830.990837, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435830.0878372, "dev": 37, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 268, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435829.665837, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "46", "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/tmpdljjmvxt/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:37:12 +0000 (0:00:00.386) 0:00:12.583 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:37:12 +0000 (0:00:00.077) 0:00:12.660 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:37:12 +0000 (0:00:00.063) 0:00:12.724 ********* changed: [/cache/fedora-35.qcow2.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.006566", "end": "2022-07-21 20:37:12.850066", "rc": 0, "start": "2022-07-21 20:37:12.843500" } 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 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 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 1.1.1o FIPS 3 May 2022 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/tmpdljjmvxt/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:37:13 +0000 (0:00:00.419) 0:00:13.143 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:37:13 +0000 (0:00:00.076) 0:00:13.220 ********* ok: [/cache/fedora-35.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/tmpdljjmvxt/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:37:13 +0000 (0:00:00.413) 0:00:13.633 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:37:13 +0000 (0:00:00.049) 0:00:13.682 ********* included: /tmp/tmpdljjmvxt/tests/ssh/tasks/restore.yml for /cache/fedora-35.qcow2.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:37:13 +0000 (0:00:00.026) 0:00:13.709 ********* ok: [/cache/fedora-35.qcow2.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.a1hcnbac//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.a1hcnbac//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.007110", "end": "2022-07-21 20:37:13.858089", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:37:13.850979" } ok: [/cache/fedora-35.qcow2.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.a1hcnbac//etc/ssh/ssh_config; then\n cp /tmp/ansible.a1hcnbac//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.006201", "end": "2022-07-21 20:37:14.237959", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:37:14.231758" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpdljjmvxt/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:37:14 +0000 (0:00:00.817) 0:00:14.527 ********* ok: [/cache/fedora-35.qcow2.snap] => { "changed": false, "path": "/tmp/ansible.a1hcnbac", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/fedora-35.qcow2.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:37:15 +0000 (0:00:00.417) 0:00:14.944 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 1.99s /tmp/tmpdljjmvxt/tests/ssh/tasks/setup.yml:7 ---------------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 1.81s /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 fedora.linux_system_roles.ssh : Generate the configuration file --------- 1.13s /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Gathering Facts --------------------------------------------------------- 1.11s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:2 ---------------------------- Backup files ------------------------------------------------------------ 0.88s /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml:13 -------------------------------- Restore backed up files and remove what was not present ----------------- 0.82s /tmp/tmpdljjmvxt/tests/ssh/tasks/restore.yml:2 -------------------------------- Create a test user ------------------------------------------------------ 0.61s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:18 --------------------------- Create a test group (with the same name as user) ------------------------ 0.56s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:14 --------------------------- fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.54s /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.54s /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.51s /tmp/tmpb2a4zynw/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Download the created configuration file --------------------------------- 0.50s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:45 --------------------------- Create a temporary directory for backup files --------------------------- 0.48s /tmp/tmpdljjmvxt/tests/ssh/tasks/backup.yml:5 --------------------------------- Make sure the file is readable by user ---------------------------------- 0.44s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:66 --------------------------- Test the effective configuration using ssh ------------------------------ 0.42s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:97 --------------------------- Remove temporary directory for backup files ----------------------------- 0.42s /tmp/tmpdljjmvxt/tests/ssh/tasks/restore.yml:15 ------------------------------- Download the global configuration files too ----------------------------- 0.41s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:114 -------------------------- Stat the .ssh dir ------------------------------------------------------- 0.40s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:50 --------------------------- Gather information about the user --------------------------------------- 0.39s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:35 --------------------------- Stat the configuration file --------------------------------------------- 0.39s /tmp/tmpdljjmvxt/tests/ssh/tests_user_config.yml:73 ---------------------------