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/tmp0677phw8 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: rhel-7_setup.yml ***************************************************** 1 plays in /cache/rhel-7_setup.yml PLAY [Setup repos] ************************************************************* META: ran handlers TASK [set up internal repositories] ******************************************** task path: /cache/rhel-7_setup.yml:5 Thursday 21 July 2022 20:09:31 +0000 (0:00:00.017) 0:00:00.017 ********* ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-7.qcow2 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Thursday 21 July 2022 20:09:33 +0000 (0:00:01.403) 0:00:01.421 ********* =============================================================================== set up internal repositories -------------------------------------------- 1.40s /cache/rhel-7_setup.yml:5 ----------------------------------------------------- PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmpwdhrsu3c/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:09:33 +0000 (0:00:00.015) 0:00:01.437 ********* ok: [/cache/rhel-7.qcow2] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:09:34 +0000 (0:00:00.955) 0:00:02.393 ********* included: /tmp/tmpwdhrsu3c/tests/tasks/backup.yml for /cache/rhel-7.qcow2 TASK [Setup] ******************************************************************* task path: /tmp/tmpwdhrsu3c/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:09:34 +0000 (0:00:00.025) 0:00:02.418 ********* included: /tmp/tmpwdhrsu3c/tests/tasks/setup.yml for /cache/rhel-7.qcow2 TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpwdhrsu3c/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:09:34 +0000 (0:00:00.026) 0:00:02.444 ********* skipping: [/cache/rhel-7.qcow2] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpwdhrsu3c/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:09:34 +0000 (0:00:00.021) 0:00:02.465 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "rc": 0, "results": [ "openssh-clients-7.4p1-22.el7_9.x86_64 providing openssh-clients is already installed" ] } TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmpwdhrsu3c/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:09:35 +0000 (0:00:00.648) 0:00:03.114 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.yfUsPD", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpwdhrsu3c/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:09:35 +0000 (0:00:00.421) 0:00:03.536 ********* ok: [/cache/rhel-7.qcow2] => (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.yfUsPD/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.yfUsPD/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.004111", "end": "2022-07-21 16:09:36.124009", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:09:36.119898" } ok: [/cache/rhel-7.qcow2] => (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.yfUsPD/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.yfUsPD/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.011474", "end": "2022-07-21 16:09:36.443756", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:09:36.432282" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:09:36 +0000 (0:00:00.761) 0:00:04.297 ********* changed: [/cache/rhel-7.qcow2] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:09:36 +0000 (0:00:00.449) 0:00:04.747 ********* changed: [/cache/rhel-7.qcow2] => { "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/tmpwdhrsu3c/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:09:37 +0000 (0:00:00.505) 0:00:05.252 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:09:37 +0000 (0:00:00.033) 0:00:05.285 ********* included: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/rhel-7.qcow2 TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:09:37 +0000 (0:00:00.025) 0:00:05.311 ********* ok: [/cache/rhel-7.qcow2] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:09:37 +0000 (0:00:00.408) 0:00:05.719 ********* skipping: [/cache/rhel-7.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-7.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-7.qcow2] => (item=RedHat_7.yml) => { "ansible_facts": { "__ssh_defaults": { "Host": { "Condition": "*", "ForwardX11Trusted": true, "GSSAPIAuthentication": true, "SendEnv": [ "LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES", "LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT", "LC_IDENTIFICATION LC_ALL LANGUAGE", "XMODIFIERS" ] } } }, "ansible_included_var_files": [ "/tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/vars/RedHat_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_7.yml" } skipping: [/cache/rhel-7.qcow2] => (item=RedHat_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_7.9.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:09:37 +0000 (0:00:00.066) 0:00:05.786 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "rc": 0, "results": [ "openssh-7.4p1-22.el7_9.x86_64 providing openssh is already installed", "openssh-clients-7.4p1-22.el7_9.x86_64 providing openssh-clients is already installed" ] } TASK [linux-system-roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:09:38 +0000 (0:00:00.487) 0:00:06.274 ********* ok: [/cache/rhel-7.qcow2] => { "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/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:09:38 +0000 (0:00:00.433) 0:00:06.707 ********* changed: [/cache/rhel-7.qcow2] => { "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/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:09:39 +0000 (0:00:00.463) 0:00:07.170 ********* changed: [/cache/rhel-7.qcow2] => { "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-1658434179.1398973-28979-196369460344459/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-7.qcow2 TASK [Gather information about the user] *************************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:09:40 +0000 (0:00:00.973) 0:00:08.143 ********* ok: [/cache/rhel-7.qcow2] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:09:40 +0000 (0:00:00.286) 0:00:08.430 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:09:40 +0000 (0:00:00.422) 0:00:08.853 ********* [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-7.qcow2] => { "changed": false, "stat": { "atime": 1658434179.3120127, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658434180.2820125, "dev": 64769, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 20971591, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658434180.2820125, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "1095235977", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.366) 0:00:09.219 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.035) 0:00:09.255 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "stat": { "atime": 1658434181.0010126, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434180.2830126, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 15848, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434179.9230125, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "18446744072361892805", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.333) 0:00:09.589 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "stat": { "atime": 1658434181.0010126, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434180.2830126, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 15848, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434179.9230125, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "18446744072361892805", "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/tmpwdhrsu3c/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.318) 0:00:09.907 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.049) 0:00:09.957 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:09:41 +0000 (0:00:00.037) 0:00:09.994 ********* changed: [/cache/rhel-7.qcow2] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.008777", "end": "2022-07-21 16:09:42.517096", "rc": 0, "start": "2022-07-21 16:09:42.508319" } STDOUT: user somebody hostname example.com port 22 addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no forwardagent no forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapidelegatecredentials no hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no protocol 2 proxyusefdpass no pubkeyauthentication yes requesttty auto rhostsrsaauthentication no rsaauthentication yes streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false useprivilegedport no verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 compressionlevel 6 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss 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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 loglevel DEBUG3 macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 pubkeyacceptedkeytypes 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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 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 fingerprinthash SHA256 MD5 connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos lowdelay throughput rekeylimit 0 0 streamlocalbindmask 0177 STDERR: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 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 debug1: /etc/ssh/ssh_config line 4: Applying options for * TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:09:42 +0000 (0:00:00.376) 0:00:10.370 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:09:42 +0000 (0:00:00.070) 0:00:10.441 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkhvc3QgKgogIEZvcndhcmRYMTFUcnVzdGVkIHllcwogIEdTU0FQSUF1dGhlbnRpY2F0aW9uIHllcwogIFNlbmRFbnYgTEFORyBMQ19DVFlQRSBMQ19OVU1FUklDIExDX1RJTUUgTENfQ09MTEFURSBMQ19NT05FVEFSWSBMQ19NRVNTQUdFUwpTZW5kRW52IExDX1BBUEVSIExDX05BTUUgTENfQUREUkVTUyBMQ19URUxFUEhPTkUgTENfTUVBU1VSRU1FTlQKU2VuZEVudiBMQ19JREVOVElGSUNBVElPTiBMQ19BTEwgTEFOR1VBR0UKU2VuZEVudiBYTU9ESUZJRVJTCg==", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:09:42 +0000 (0:00:00.280) 0:00:10.721 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:09:42 +0000 (0:00:00.070) 0:00:10.791 ********* included: /tmp/tmpwdhrsu3c/tests/tasks/restore.yml for /cache/rhel-7.qcow2 TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpwdhrsu3c/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:09:42 +0000 (0:00:00.024) 0:00:10.815 ********* ok: [/cache/rhel-7.qcow2] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.yfUsPD//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.yfUsPD//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.003802", "end": "2022-07-21 16:09:43.306939", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:09:43.303137" } ok: [/cache/rhel-7.qcow2] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.yfUsPD//etc/ssh/ssh_config; then\n cp /tmp/ansible.yfUsPD//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.006928", "end": "2022-07-21 16:09:43.588944", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:09:43.582016" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpwdhrsu3c/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:09:43 +0000 (0:00:00.624) 0:00:11.440 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "path": "/tmp/ansible.yfUsPD", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-7.qcow2 : ok=31 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:09:43 +0000 (0:00:00.313) 0:00:11.753 ********* =============================================================================== set up internal repositories -------------------------------------------- 1.40s /cache/rhel-7_setup.yml:5 ----------------------------------------------------- linux-system-roles.ssh : Generate the configuration file ---------------- 0.97s /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Gathering Facts --------------------------------------------------------- 0.96s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:2 -------------------------------- Backup files ------------------------------------------------------------ 0.76s /tmp/tmpwdhrsu3c/tests/tasks/backup.yml:13 ------------------------------------ Make sure openssh is installed before creating backup ------------------- 0.65s /tmp/tmpwdhrsu3c/tests/tasks/setup.yml:7 -------------------------------------- Restore backed up files and remove what was not present ----------------- 0.62s /tmp/tmpwdhrsu3c/tests/tasks/restore.yml:2 ------------------------------------ Create a test user ------------------------------------------------------ 0.51s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:18 ------------------------------- linux-system-roles.ssh : Ensure required packages are installed --------- 0.49s /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.46s /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- Create a test group (with the same name as user) ------------------------ 0.45s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:14 ------------------------------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.43s /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- Download the created configuration file --------------------------------- 0.42s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:46 ------------------------------- Create a temporary directory for backup files --------------------------- 0.42s /tmp/tmpwdhrsu3c/tests/tasks/backup.yml:5 ------------------------------------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.41s /tmp/tmpwdhrsu3c/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Test the effective configuration using ssh ------------------------------ 0.38s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:100 ------------------------------ Stat the .ssh dir ------------------------------------------------------- 0.37s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:51 ------------------------------- Make sure the file is readable by user ---------------------------------- 0.33s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:68 ------------------------------- Stat the configuration file --------------------------------------------- 0.32s /tmp/tmpwdhrsu3c/tests/tests_user_config.yml:75 ------------------------------- Remove temporary directory for backup files ----------------------------- 0.31s /tmp/tmpwdhrsu3c/tests/tasks/restore.yml:15 ----------------------------------- Gather information about the user --------------------------------------- 0.29s /tmp/tmpwdhrsu3c/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/tmp0677phw8 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: rhel-7_setup.yml ***************************************************** 1 plays in /cache/rhel-7_setup.yml PLAY [Setup repos] ************************************************************* META: ran handlers TASK [set up internal repositories] ******************************************** task path: /cache/rhel-7_setup.yml:5 Thursday 21 July 2022 20:11:45 +0000 (0:00:00.017) 0:00:00.017 ********* ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => (item=None) => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } ok: [/cache/rhel-7.qcow2] => { "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-7.qcow2 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Thursday 21 July 2022 20:11:46 +0000 (0:00:01.352) 0:00:01.370 ********* =============================================================================== set up internal repositories -------------------------------------------- 1.35s /cache/rhel-7_setup.yml:5 ----------------------------------------------------- PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:11:46 +0000 (0:00:00.035) 0:00:01.406 ********* ok: [/cache/rhel-7.qcow2] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:11:47 +0000 (0:00:00.924) 0:00:02.331 ********* included: /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml for /cache/rhel-7.qcow2 TASK [Setup] ******************************************************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:11:47 +0000 (0:00:00.026) 0:00:02.358 ********* included: /tmp/tmpxz37r5cb/tests/ssh/tasks/setup.yml for /cache/rhel-7.qcow2 TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:11:47 +0000 (0:00:00.025) 0:00:02.384 ********* skipping: [/cache/rhel-7.qcow2] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:11:47 +0000 (0:00:00.021) 0:00:02.405 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "rc": 0, "results": [ "openssh-clients-7.4p1-22.el7_9.x86_64 providing openssh-clients is already installed" ] } TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:11:48 +0000 (0:00:00.658) 0:00:03.064 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.5gGU5w", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:11:48 +0000 (0:00:00.420) 0:00:03.484 ********* ok: [/cache/rhel-7.qcow2] => (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.5gGU5w/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.5gGU5w/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.003850", "end": "2022-07-21 16:11:49.228427", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:11:49.224577" } ok: [/cache/rhel-7.qcow2] => (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.5gGU5w/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.5gGU5w/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.009396", "end": "2022-07-21 16:11:49.519586", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:11:49.510190" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:11:49 +0000 (0:00:00.729) 0:00:04.213 ********* changed: [/cache/rhel-7.qcow2] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:11:49 +0000 (0:00:00.444) 0:00:04.658 ********* changed: [/cache/rhel-7.qcow2] => { "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/tmpxz37r5cb/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:11:50 +0000 (0:00:00.514) 0:00:05.172 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:11:50 +0000 (0:00:00.035) 0:00:05.207 ********* included: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/rhel-7.qcow2 TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:11:50 +0000 (0:00:00.026) 0:00:05.234 ********* ok: [/cache/rhel-7.qcow2] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:11:50 +0000 (0:00:00.403) 0:00:05.637 ********* skipping: [/cache/rhel-7.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/rhel-7.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } ok: [/cache/rhel-7.qcow2] => (item=RedHat_7.yml) => { "ansible_facts": { "__ssh_defaults": { "Host": { "Condition": "*", "ForwardX11Trusted": true, "GSSAPIAuthentication": true, "SendEnv": [ "LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES", "LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT", "LC_IDENTIFICATION LC_ALL LANGUAGE", "XMODIFIERS" ] } } }, "ansible_included_var_files": [ "/tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/RedHat_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "RedHat_7.yml" } skipping: [/cache/rhel-7.qcow2] => (item=RedHat_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_7.9.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:11:50 +0000 (0:00:00.052) 0:00:05.690 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "rc": 0, "results": [ "openssh-7.4p1-22.el7_9.x86_64 providing openssh is already installed", "openssh-clients-7.4p1-22.el7_9.x86_64 providing openssh-clients is already installed" ] } TASK [fedora.linux_system_roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:11:51 +0000 (0:00:00.488) 0:00:06.179 ********* ok: [/cache/rhel-7.qcow2] => { "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/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:11:51 +0000 (0:00:00.425) 0:00:06.604 ********* changed: [/cache/rhel-7.qcow2] => { "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/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:11:52 +0000 (0:00:00.459) 0:00:07.063 ********* changed: [/cache/rhel-7.qcow2] => { "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-1658434312.4038734-32781-188755697435103/source", "state": "file", "uid": 1001 } META: role_complete for /cache/rhel-7.qcow2 TASK [Gather information about the user] *************************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:11:53 +0000 (0:00:00.984) 0:00:08.048 ********* ok: [/cache/rhel-7.qcow2] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:11:53 +0000 (0:00:00.305) 0:00:08.353 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:11:54 +0000 (0:00:00.420) 0:00:08.774 ********* [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-7.qcow2] => { "changed": false, "stat": { "atime": 1658434312.358263, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658434313.342263, "dev": 64769, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 20971591, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658434313.342263, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "18446744073538099284", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:11:54 +0000 (0:00:00.341) 0:00:09.115 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:11:54 +0000 (0:00:00.066) 0:00:09.182 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "stat": { "atime": 1658434314.078263, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434313.343263, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 298, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434312.986263, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1603024322", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:11:54 +0000 (0:00:00.356) 0:00:09.538 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "stat": { "atime": 1658434314.078263, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434313.343263, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 298, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434312.986263, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1603024322", "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/tmpxz37r5cb/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.304) 0:00:09.842 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.077) 0:00:09.920 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.036) 0:00:09.956 ********* changed: [/cache/rhel-7.qcow2] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.008657", "end": "2022-07-21 16:11:55.635706", "rc": 0, "start": "2022-07-21 16:11:55.627049" } STDOUT: user somebody hostname example.com port 22 addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no forwardagent no forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapidelegatecredentials no hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no protocol 2 proxyusefdpass no pubkeyauthentication yes requesttty auto rhostsrsaauthentication no rsaauthentication yes streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false useprivilegedport no verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 compressionlevel 6 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss 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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 loglevel DEBUG3 macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 pubkeyacceptedkeytypes 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,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 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 fingerprinthash SHA256 MD5 connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos lowdelay throughput rekeylimit 0 0 streamlocalbindmask 0177 STDERR: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 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 debug1: /etc/ssh/ssh_config line 4: Applying options for * TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.375) 0:00:10.332 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.071) 0:00:10.403 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkhvc3QgKgogIEZvcndhcmRYMTFUcnVzdGVkIHllcwogIEdTU0FQSUF1dGhlbnRpY2F0aW9uIHllcwogIFNlbmRFbnYgTEFORyBMQ19DVFlQRSBMQ19OVU1FUklDIExDX1RJTUUgTENfQ09MTEFURSBMQ19NT05FVEFSWSBMQ19NRVNTQUdFUwpTZW5kRW52IExDX1BBUEVSIExDX05BTUUgTENfQUREUkVTUyBMQ19URUxFUEhPTkUgTENfTUVBU1VSRU1FTlQKU2VuZEVudiBMQ19JREVOVElGSUNBVElPTiBMQ19BTEwgTEFOR1VBR0UKU2VuZEVudiBYTU9ESUZJRVJTCg==", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:11:55 +0000 (0:00:00.323) 0:00:10.727 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:11:56 +0000 (0:00:00.103) 0:00:10.831 ********* included: /tmp/tmpxz37r5cb/tests/ssh/tasks/restore.yml for /cache/rhel-7.qcow2 TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:11:56 +0000 (0:00:00.026) 0:00:10.857 ********* ok: [/cache/rhel-7.qcow2] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.5gGU5w//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.5gGU5w//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.003804", "end": "2022-07-21 16:11:56.485573", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 16:11:56.481769" } ok: [/cache/rhel-7.qcow2] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.5gGU5w//etc/ssh/ssh_config; then\n cp /tmp/ansible.5gGU5w//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.007024", "end": "2022-07-21 16:11:56.773045", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 16:11:56.766021" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpxz37r5cb/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:11:56 +0000 (0:00:00.612) 0:00:11.470 ********* ok: [/cache/rhel-7.qcow2] => { "changed": false, "path": "/tmp/ansible.5gGU5w", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/rhel-7.qcow2 : ok=31 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:11:57 +0000 (0:00:00.327) 0:00:11.797 ********* =============================================================================== set up internal repositories -------------------------------------------- 1.35s /cache/rhel-7_setup.yml:5 ----------------------------------------------------- fedora.linux_system_roles.ssh : Generate the configuration file --------- 0.98s /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Gathering Facts --------------------------------------------------------- 0.92s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:2 ---------------------------- Backup files ------------------------------------------------------------ 0.73s /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml:13 -------------------------------- Make sure openssh is installed before creating backup ------------------- 0.66s /tmp/tmpxz37r5cb/tests/ssh/tasks/setup.yml:7 ---------------------------------- Restore backed up files and remove what was not present ----------------- 0.61s /tmp/tmpxz37r5cb/tests/ssh/tasks/restore.yml:2 -------------------------------- Create a test user ------------------------------------------------------ 0.51s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:18 --------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 0.49s /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.46s /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Create a test group (with the same name as user) ------------------------ 0.44s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:14 --------------------------- fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.43s /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Create a temporary directory for backup files --------------------------- 0.42s /tmp/tmpxz37r5cb/tests/ssh/tasks/backup.yml:5 --------------------------------- Download the created configuration file --------------------------------- 0.42s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:45 --------------------------- fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.40s /tmp/tmp0677phw8/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Test the effective configuration using ssh ------------------------------ 0.38s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:97 --------------------------- Make sure the file is readable by user ---------------------------------- 0.36s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:66 --------------------------- Stat the .ssh dir ------------------------------------------------------- 0.34s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:50 --------------------------- Remove temporary directory for backup files ----------------------------- 0.33s /tmp/tmpxz37r5cb/tests/ssh/tasks/restore.yml:15 ------------------------------- Download the global configuration files too ----------------------------- 0.32s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:114 -------------------------- Gather information about the user --------------------------------------- 0.31s /tmp/tmpxz37r5cb/tests/ssh/tests_user_config.yml:35 ---------------------------