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/tmpond44ouu 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/tmpkp2113mn/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:15:30 +0000 (0:00:00.013) 0:00:00.013 ********* ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:15:31 +0000 (0:00:00.977) 0:00:00.991 ********* included: /tmp/tmpkp2113mn/tests/tasks/backup.yml for /cache/centos-7.qcow2c.snap TASK [Setup] ******************************************************************* task path: /tmp/tmpkp2113mn/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:15:31 +0000 (0:00:00.026) 0:00:01.017 ********* included: /tmp/tmpkp2113mn/tests/tasks/setup.yml for /cache/centos-7.qcow2c.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmpkp2113mn/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:15:31 +0000 (0:00:00.024) 0:00:01.042 ********* skipping: [/cache/centos-7.qcow2c.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmpkp2113mn/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:15:31 +0000 (0:00:00.021) 0:00:01.063 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmpkp2113mn/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:15:32 +0000 (0:00:00.639) 0:00:01.703 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.YVfn3p", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmpkp2113mn/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:15:32 +0000 (0:00:00.382) 0:00:02.085 ********* ok: [/cache/centos-7.qcow2c.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.YVfn3p/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.YVfn3p/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.003694", "end": "2022-07-21 20:15:32.244696", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:15:32.241002" } ok: [/cache/centos-7.qcow2c.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.YVfn3p/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.YVfn3p/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.009109", "end": "2022-07-21 20:15:32.561180", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:15:32.552071" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:15:33 +0000 (0:00:00.717) 0:00:02.803 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:15:34 +0000 (0:00:00.443) 0:00:03.246 ********* changed: [/cache/centos-7.qcow2c.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/tmpkp2113mn/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:15:34 +0000 (0:00:00.506) 0:00:03.752 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:15:34 +0000 (0:00:00.033) 0:00:03.786 ********* included: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/centos-7.qcow2c.snap TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:15:34 +0000 (0:00:00.025) 0:00:03.812 ********* ok: [/cache/centos-7.qcow2c.snap] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:15:34 +0000 (0:00:00.396) 0:00:04.209 ********* skipping: [/cache/centos-7.qcow2c.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-7.qcow2c.snap] => (item=CentOS_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/tmpkp2113mn/tests/roles/linux-system-roles.ssh/vars/CentOS_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.yml" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.9.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:15:35 +0000 (0:00:00.050) 0:00:04.259 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:15:35 +0000 (0:00:00.510) 0:00:04.770 ********* ok: [/cache/centos-7.qcow2c.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/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:15:35 +0000 (0:00:00.430) 0:00:05.201 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "gid": 1001, "group": "tester123", "mode": "0700", "owner": "tester123", "path": "/home/tester123/.ssh/", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 6, "state": "directory", "uid": 1001 } TASK [linux-system-roles.ssh : Generate the configuration file] **************** task path: /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:15:36 +0000 (0:00:00.440) 0:00:05.641 ********* changed: [/cache/centos-7.qcow2c.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-1658434536.468495-36055-167226319897425/source", "state": "file", "uid": 1001 } META: role_complete for /cache/centos-7.qcow2c.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:15:37 +0000 (0:00:00.951) 0:00:06.592 ********* ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:15:37 +0000 (0:00:00.301) 0:00:06.893 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:15:38 +0000 (0:00:00.433) 0:00:07.327 ********* [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/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434535.3989258, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658434536.3409257, "dev": 64769, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 8417352, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658434536.3409257, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "18446744072069244305", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:15:38 +0000 (0:00:00.344) 0:00:07.671 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:15:38 +0000 (0:00:00.038) 0:00:07.710 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434537.0879257, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434536.3419256, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 12587074, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434535.9929256, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "749466379", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:15:38 +0000 (0:00:00.332) 0:00:08.042 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434537.0879257, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434536.3419256, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 12587074, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434535.9929256, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "749466379", "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/tmpkp2113mn/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.304) 0:00:08.347 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.050) 0:00:08.397 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.037) 0:00:08.435 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.008636", "end": "2022-07-21 20:15:38.553844", "rc": 0, "start": "2022-07-21 20:15:38.545208" } 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/tmpkp2113mn/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.362) 0:00:08.797 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.047) 0:00:08.845 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmpkp2113mn/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.294) 0:00:09.140 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmpkp2113mn/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.049) 0:00:09.189 ********* included: /tmp/tmpkp2113mn/tests/tasks/restore.yml for /cache/centos-7.qcow2c.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmpkp2113mn/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:15:39 +0000 (0:00:00.026) 0:00:09.215 ********* ok: [/cache/centos-7.qcow2c.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.YVfn3p//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.YVfn3p//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.003758", "end": "2022-07-21 20:15:39.320161", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:15:39.316403" } ok: [/cache/centos-7.qcow2c.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.YVfn3p//etc/ssh/ssh_config; then\n cp /tmp/ansible.YVfn3p//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.006961", "end": "2022-07-21 20:15:39.606602", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:15:39.599641" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmpkp2113mn/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:15:40 +0000 (0:00:00.634) 0:00:09.849 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "path": "/tmp/ansible.YVfn3p", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-7.qcow2c.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:15:40 +0000 (0:00:00.340) 0:00:10.190 ********* =============================================================================== Gathering Facts --------------------------------------------------------- 0.98s /tmp/tmpkp2113mn/tests/tests_user_config.yml:2 -------------------------------- linux-system-roles.ssh : Generate the configuration file ---------------- 0.95s /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Backup files ------------------------------------------------------------ 0.72s /tmp/tmpkp2113mn/tests/tasks/backup.yml:13 ------------------------------------ Make sure openssh is installed before creating backup ------------------- 0.64s /tmp/tmpkp2113mn/tests/tasks/setup.yml:7 -------------------------------------- Restore backed up files and remove what was not present ----------------- 0.63s /tmp/tmpkp2113mn/tests/tasks/restore.yml:2 ------------------------------------ linux-system-roles.ssh : Ensure required packages are installed --------- 0.51s /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- Create a test user ------------------------------------------------------ 0.51s /tmp/tmpkp2113mn/tests/tests_user_config.yml:18 ------------------------------- Create a test group (with the same name as user) ------------------------ 0.44s /tmp/tmpkp2113mn/tests/tests_user_config.yml:14 ------------------------------- linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.44s /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- Download the created configuration file --------------------------------- 0.43s /tmp/tmpkp2113mn/tests/tests_user_config.yml:46 ------------------------------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.43s /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.40s /tmp/tmpkp2113mn/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Create a temporary directory for backup files --------------------------- 0.38s /tmp/tmpkp2113mn/tests/tasks/backup.yml:5 ------------------------------------- Test the effective configuration using ssh ------------------------------ 0.36s /tmp/tmpkp2113mn/tests/tests_user_config.yml:100 ------------------------------ Stat the .ssh dir ------------------------------------------------------- 0.34s /tmp/tmpkp2113mn/tests/tests_user_config.yml:51 ------------------------------- Remove temporary directory for backup files ----------------------------- 0.34s /tmp/tmpkp2113mn/tests/tasks/restore.yml:15 ----------------------------------- Make sure the file is readable by user ---------------------------------- 0.33s /tmp/tmpkp2113mn/tests/tests_user_config.yml:68 ------------------------------- Stat the configuration file --------------------------------------------- 0.30s /tmp/tmpkp2113mn/tests/tests_user_config.yml:75 ------------------------------- Gather information about the user --------------------------------------- 0.30s /tmp/tmpkp2113mn/tests/tests_user_config.yml:35 ------------------------------- Download the global configuration files too ----------------------------- 0.29s /tmp/tmpkp2113mn/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/tmpond44ouu 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/tmp3c63ut4b/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:17:23 +0000 (0:00:00.014) 0:00:00.014 ********* ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:17:24 +0000 (0:00:01.006) 0:00:01.021 ********* included: /tmp/tmp3c63ut4b/tests/ssh/tasks/backup.yml for /cache/centos-7.qcow2c.snap TASK [Setup] ******************************************************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:17:24 +0000 (0:00:00.027) 0:00:01.048 ********* included: /tmp/tmp3c63ut4b/tests/ssh/tasks/setup.yml for /cache/centos-7.qcow2c.snap TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:17:24 +0000 (0:00:00.026) 0:00:01.074 ********* skipping: [/cache/centos-7.qcow2c.snap] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:17:24 +0000 (0:00:00.021) 0:00:01.096 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmp3c63ut4b/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:17:24 +0000 (0:00:00.654) 0:00:01.751 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.mp2O_U", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:17:25 +0000 (0:00:00.401) 0:00:02.152 ********* ok: [/cache/centos-7.qcow2c.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.mp2O_U/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.mp2O_U/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.003850", "end": "2022-07-21 20:17:25.496273", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:17:25.492423" } ok: [/cache/centos-7.qcow2c.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.mp2O_U/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.mp2O_U/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.010705", "end": "2022-07-21 20:17:25.830863", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:17:25.820158" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:17:26 +0000 (0:00:00.752) 0:00:02.905 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:17:26 +0000 (0:00:00.450) 0:00:03.356 ********* changed: [/cache/centos-7.qcow2c.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/tmp3c63ut4b/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:17:27 +0000 (0:00:00.517) 0:00:03.873 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:17:27 +0000 (0:00:00.036) 0:00:03.910 ********* included: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/centos-7.qcow2c.snap TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:17:27 +0000 (0:00:00.027) 0:00:03.938 ********* ok: [/cache/centos-7.qcow2c.snap] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:17:27 +0000 (0:00:00.403) 0:00:04.342 ********* skipping: [/cache/centos-7.qcow2c.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-7.qcow2c.snap] => (item=CentOS_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/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/CentOS_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.yml" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.9.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:17:27 +0000 (0:00:00.052) 0:00:04.395 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:17:28 +0000 (0:00:00.511) 0:00:04.907 ********* ok: [/cache/centos-7.qcow2c.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/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:17:28 +0000 (0:00:00.425) 0:00:05.332 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "gid": 1001, "group": "tester123", "mode": "0700", "owner": "tester123", "path": "/home/tester123/.ssh/", "secontext": "unconfined_u:object_r:ssh_home_t:s0", "size": 6, "state": "directory", "uid": 1001 } TASK [fedora.linux_system_roles.ssh : Generate the configuration file] ********* task path: /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:17:28 +0000 (0:00:00.443) 0:00:05.775 ********* changed: [/cache/centos-7.qcow2c.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-1658434649.0074792-39039-275162319292728/source", "state": "file", "uid": 1001 } META: role_complete for /cache/centos-7.qcow2c.snap TASK [Gather information about the user] *************************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:17:29 +0000 (0:00:00.957) 0:00:06.733 ********* ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:17:30 +0000 (0:00:00.314) 0:00:07.048 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:17:30 +0000 (0:00:00.434) 0:00:07.482 ********* [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/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434648.702726, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658434649.6487257, "dev": 64769, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 8417352, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658434649.6487257, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "18446744073498903957", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:17:30 +0000 (0:00:00.352) 0:00:07.834 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:17:31 +0000 (0:00:00.065) 0:00:07.900 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434650.405726, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434649.649726, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 12587074, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434649.3037257, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1608058175", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:17:31 +0000 (0:00:00.333) 0:00:08.233 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1658434650.405726, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658434649.649726, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 12587074, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658434649.3037257, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "1608058175", "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/tmp3c63ut4b/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:17:31 +0000 (0:00:00.314) 0:00:08.548 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:17:31 +0000 (0:00:00.050) 0:00:08.599 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:17:31 +0000 (0:00:00.034) 0:00:08.633 ********* changed: [/cache/centos-7.qcow2c.snap] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.008718", "end": "2022-07-21 20:17:31.933447", "rc": 0, "start": "2022-07-21 20:17:31.924729" } 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/tmp3c63ut4b/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:17:32 +0000 (0:00:00.386) 0:00:09.020 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:17:32 +0000 (0:00:00.077) 0:00:09.097 ********* ok: [/cache/centos-7.qcow2c.snap] => { "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/tmp3c63ut4b/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:17:32 +0000 (0:00:00.340) 0:00:09.438 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:17:32 +0000 (0:00:00.076) 0:00:09.515 ********* included: /tmp/tmp3c63ut4b/tests/ssh/tasks/restore.yml for /cache/centos-7.qcow2c.snap TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:17:32 +0000 (0:00:00.027) 0:00:09.542 ********* ok: [/cache/centos-7.qcow2c.snap] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.mp2O_U//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.mp2O_U//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.004559", "end": "2022-07-21 20:17:32.827765", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:17:32.823206" } ok: [/cache/centos-7.qcow2c.snap] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.mp2O_U//etc/ssh/ssh_config; then\n cp /tmp/ansible.mp2O_U//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.007457", "end": "2022-07-21 20:17:33.114736", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:17:33.107279" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmp3c63ut4b/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:17:33 +0000 (0:00:00.645) 0:00:10.188 ********* ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "path": "/tmp/ansible.mp2O_U", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-7.qcow2c.snap : ok=30 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:17:33 +0000 (0:00:00.361) 0:00:10.549 ********* =============================================================================== Gathering Facts --------------------------------------------------------- 1.01s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:2 ---------------------------- fedora.linux_system_roles.ssh : Generate the configuration file --------- 0.96s /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Backup files ------------------------------------------------------------ 0.75s /tmp/tmp3c63ut4b/tests/ssh/tasks/backup.yml:13 -------------------------------- Make sure openssh is installed before creating backup ------------------- 0.65s /tmp/tmp3c63ut4b/tests/ssh/tasks/setup.yml:7 ---------------------------------- Restore backed up files and remove what was not present ----------------- 0.65s /tmp/tmp3c63ut4b/tests/ssh/tasks/restore.yml:2 -------------------------------- Create a test user ------------------------------------------------------ 0.52s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:18 --------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 0.51s /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Create a test group (with the same name as user) ------------------------ 0.45s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:14 --------------------------- fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.44s /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Download the created configuration file --------------------------------- 0.43s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:45 --------------------------- fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.43s /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.40s /tmp/tmpond44ouu/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Create a temporary directory for backup files --------------------------- 0.40s /tmp/tmp3c63ut4b/tests/ssh/tasks/backup.yml:5 --------------------------------- Test the effective configuration using ssh ------------------------------ 0.39s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:97 --------------------------- Remove temporary directory for backup files ----------------------------- 0.36s /tmp/tmp3c63ut4b/tests/ssh/tasks/restore.yml:15 ------------------------------- Stat the .ssh dir ------------------------------------------------------- 0.35s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:50 --------------------------- Download the global configuration files too ----------------------------- 0.34s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:114 -------------------------- Make sure the file is readable by user ---------------------------------- 0.33s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:66 --------------------------- Stat the configuration file --------------------------------------------- 0.31s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:73 --------------------------- Gather information about the user --------------------------------------- 0.31s /tmp/tmp3c63ut4b/tests/ssh/tests_user_config.yml:35 ---------------------------