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/tmpppg9msr1 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: centos-8_setup.yml *************************************************** 1 plays in /cache/centos-8_setup.yml PLAY [Enable HA repos] ********************************************************* META: ran handlers TASK [Enable HA repos] ********************************************************* task path: /cache/centos-8_setup.yml:5 Thursday 21 July 2022 20:36:12 +0000 (0:00:00.018) 0:00:00.018 ********* changed: [/cache/centos-8.qcow2] => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "cmd": [ "dnf", "config-manager", "--set-enabled", "ha" ], "delta": "0:00:00.192123", "end": "2022-07-21 20:36:12.473884", "rc": 0, "start": "2022-07-21 20:36:12.281761" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-8.qcow2 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Thursday 21 July 2022 20:36:13 +0000 (0:00:00.765) 0:00:00.784 ********* =============================================================================== Enable HA repos --------------------------------------------------------- 0.77s /cache/centos-8_setup.yml:5 --------------------------------------------------- PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmptdmnrt7v/tests/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:2 Thursday 21 July 2022 20:36:13 +0000 (0:00:00.018) 0:00:00.803 ********* ok: [/cache/centos-8.qcow2] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:11 Thursday 21 July 2022 20:36:14 +0000 (0:00:01.028) 0:00:01.831 ********* included: /tmp/tmptdmnrt7v/tests/tasks/backup.yml for /cache/centos-8.qcow2 TASK [Setup] ******************************************************************* task path: /tmp/tmptdmnrt7v/tests/tasks/backup.yml:2 Thursday 21 July 2022 20:36:14 +0000 (0:00:00.028) 0:00:01.859 ********* included: /tmp/tmptdmnrt7v/tests/tasks/setup.yml for /cache/centos-8.qcow2 TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmptdmnrt7v/tests/tasks/setup.yml:2 Thursday 21 July 2022 20:36:14 +0000 (0:00:00.026) 0:00:01.885 ********* skipping: [/cache/centos-8.qcow2] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmptdmnrt7v/tests/tasks/setup.yml:7 Thursday 21 July 2022 20:36:14 +0000 (0:00:00.019) 0:00:01.905 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmptdmnrt7v/tests/tasks/backup.yml:5 Thursday 21 July 2022 20:36:16 +0000 (0:00:02.109) 0:00:04.015 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.nv6v_ozo", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmptdmnrt7v/tests/tasks/backup.yml:13 Thursday 21 July 2022 20:36:16 +0000 (0:00:00.486) 0:00:04.502 ********* ok: [/cache/centos-8.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.nv6v_ozo/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.nv6v_ozo/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.007798", "end": "2022-07-21 20:36:16.584802", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:36:16.577004" } ok: [/cache/centos-8.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.nv6v_ozo/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.nv6v_ozo/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.008755", "end": "2022-07-21 20:36:16.938564", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:36:16.929809" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:14 Thursday 21 July 2022 20:36:17 +0000 (0:00:00.740) 0:00:05.242 ********* changed: [/cache/centos-8.qcow2] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:18 Thursday 21 July 2022 20:36:18 +0000 (0:00:00.802) 0:00:06.045 ********* changed: [/cache/centos-8.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/tmptdmnrt7v/tests/tests_user_config.yml:23 Thursday 21 July 2022 20:36:19 +0000 (0:00:00.794) 0:00:06.839 ********* TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:2 Thursday 21 July 2022 20:36:19 +0000 (0:00:00.031) 0:00:06.871 ********* included: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml for /cache/centos-8.qcow2 TASK [linux-system-roles.ssh : Ensure ansible_facts used by role] ************** task path: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:36:19 +0000 (0:00:00.024) 0:00:06.895 ********* ok: [/cache/centos-8.qcow2] TASK [linux-system-roles.ssh : Set platform/version specific variables] ******** task path: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:8 Thursday 21 July 2022 20:36:19 +0000 (0:00:00.500) 0:00:07.395 ********* skipping: [/cache/centos-8.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-8.qcow2] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-8.qcow2] => (item=CentOS_8.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/vars/CentOS_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_8.yml" } ok: [/cache/centos-8.qcow2] => (item=CentOS_8.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/vars/CentOS_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_8.yml" } TASK [linux-system-roles.ssh : Ensure required packages are installed] ********* task path: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 Thursday 21 July 2022 20:36:19 +0000 (0:00:00.057) 0:00:07.453 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [linux-system-roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 Thursday 21 July 2022 20:36:21 +0000 (0:00:01.888) 0:00:09.341 ********* ok: [/cache/centos-8.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/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 Thursday 21 July 2022 20:36:22 +0000 (0:00:00.501) 0:00:09.843 ********* changed: [/cache/centos-8.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/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 Thursday 21 July 2022 20:36:22 +0000 (0:00:00.523) 0:00:10.367 ********* changed: [/cache/centos-8.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-1658435782.7729497-59495-15029331152407/source", "state": "file", "uid": 1001 } META: role_complete for /cache/centos-8.qcow2 TASK [Gather information about the user] *************************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:35 Thursday 21 July 2022 20:36:23 +0000 (0:00:01.095) 0:00:11.462 ********* ok: [/cache/centos-8.qcow2] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:46 Thursday 21 July 2022 20:36:24 +0000 (0:00:00.360) 0:00:11.823 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:51 Thursday 21 July 2022 20:36:24 +0000 (0:00:00.485) 0:00:12.309 ********* [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-8.qcow2] => { "changed": false, "stat": { "atime": 1658435782.0605464, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435783.1465464, "dev": 64513, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 4195559, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435783.1465464, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "3974678573", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:60 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.397) 0:00:12.706 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:68 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.035) 0:00:12.742 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "stat": { "atime": 1658435784.0075464, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435783.1505463, "dev": 64513, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 9166425, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435782.7445464, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "2755807606", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:75 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.405) 0:00:13.147 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "stat": { "atime": 1658435784.0075464, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435783.1505463, "dev": 64513, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 9166425, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435782.7445464, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "2755807606", "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/tmptdmnrt7v/tests/tests_user_config.yml:81 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.399) 0:00:13.547 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:92 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.046) 0:00:13.593 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:100 Thursday 21 July 2022 20:36:25 +0000 (0:00:00.033) 0:00:13.627 ********* changed: [/cache/centos-8.qcow2] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.006943", "end": "2022-07-21 20:36:25.756120", "rc": 0, "start": "2022-07-21 20:36:25.749177" } STDOUT: user somebody hostname example.com port 22 addkeystoagent false addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardagent no forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapikeyexchange no gssapidelegatecredentials no gssapitrustdns no gssapirenewalforcesrekey no gssapikexalgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 casignaturealgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-256,rsa-sha2-512,ssh-rsa loglevel DEBUG3 macs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 pubkeyacceptedkeytypes ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,ssh-rsa,ssh-rsa-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_xmss canonicaldomains globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2 sendenv LANG sendenv LC_CTYPE sendenv LC_NUMERIC sendenv LC_TIME sendenv LC_COLLATE sendenv LC_MONETARY sendenv LC_MESSAGES sendenv LC_PAPER sendenv LC_NAME sendenv LC_ADDRESS sendenv LC_TELEPHONE sendenv LC_MEASUREMENT sendenv LC_IDENTIFICATION sendenv LC_ALL sendenv LANGUAGE sendenv XMODIFIERS connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 debug1: Reading configuration data /home/tester123/.ssh/config debug1: /home/tester123/.ssh/config line 5: Applying options for example debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] debug1: configuration requests final Match pass debug1: re-parsing configuration debug1: Reading configuration data /home/tester123/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:110 Thursday 21 July 2022 20:36:26 +0000 (0:00:00.431) 0:00:14.059 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:119 Thursday 21 July 2022 20:36:26 +0000 (0:00:00.071) 0:00:14.130 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkluY2x1ZGUgL2V0Yy9zc2gvc3NoX2NvbmZpZy5kLyouY29uZgo=", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:124 Thursday 21 July 2022 20:36:26 +0000 (0:00:00.360) 0:00:14.491 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmptdmnrt7v/tests/tests_user_config.yml:134 Thursday 21 July 2022 20:36:26 +0000 (0:00:00.072) 0:00:14.563 ********* included: /tmp/tmptdmnrt7v/tests/tasks/restore.yml for /cache/centos-8.qcow2 TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmptdmnrt7v/tests/tasks/restore.yml:2 Thursday 21 July 2022 20:36:26 +0000 (0:00:00.025) 0:00:14.588 ********* ok: [/cache/centos-8.qcow2] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.nv6v_ozo//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.nv6v_ozo//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.005903", "end": "2022-07-21 20:36:26.706438", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:36:26.700535" } ok: [/cache/centos-8.qcow2] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.nv6v_ozo//etc/ssh/ssh_config; then\n cp /tmp/ansible.nv6v_ozo//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.005910", "end": "2022-07-21 20:36:27.054546", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:36:27.048636" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmptdmnrt7v/tests/tasks/restore.yml:15 Thursday 21 July 2022 20:36:27 +0000 (0:00:00.767) 0:00:15.356 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "path": "/tmp/ansible.nv6v_ozo", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-8.qcow2 : ok=31 changed=6 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:36:28 +0000 (0:00:00.391) 0:00:15.747 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 2.11s /tmp/tmptdmnrt7v/tests/tasks/setup.yml:7 -------------------------------------- linux-system-roles.ssh : Ensure required packages are installed --------- 1.89s /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:5 ---------- linux-system-roles.ssh : Generate the configuration file ---------------- 1.10s /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:28 --------- Gathering Facts --------------------------------------------------------- 1.03s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:2 -------------------------------- Create a test group (with the same name as user) ------------------------ 0.80s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:14 ------------------------------- Create a test user ------------------------------------------------------ 0.79s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:18 ------------------------------- Restore backed up files and remove what was not present ----------------- 0.77s /tmp/tmptdmnrt7v/tests/tasks/restore.yml:2 ------------------------------------ Enable HA repos --------------------------------------------------------- 0.77s /cache/centos-8_setup.yml:5 --------------------------------------------------- Backup files ------------------------------------------------------------ 0.74s /tmp/tmptdmnrt7v/tests/tasks/backup.yml:13 ------------------------------------ linux-system-roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.52s /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:17 --------- linux-system-roles.ssh : Gather information about the user for user configuration --- 0.50s /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/main.yml:10 --------- linux-system-roles.ssh : Ensure ansible_facts used by role -------------- 0.50s /tmp/tmptdmnrt7v/tests/roles/linux-system-roles.ssh/tasks/set_vars.yml:2 ------ Create a temporary directory for backup files --------------------------- 0.49s /tmp/tmptdmnrt7v/tests/tasks/backup.yml:5 ------------------------------------- Download the created configuration file --------------------------------- 0.49s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:46 ------------------------------- Test the effective configuration using ssh ------------------------------ 0.43s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:100 ------------------------------ Make sure the file is readable by user ---------------------------------- 0.41s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:68 ------------------------------- Stat the configuration file --------------------------------------------- 0.40s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:75 ------------------------------- Stat the .ssh dir ------------------------------------------------------- 0.40s /tmp/tmptdmnrt7v/tests/tests_user_config.yml:51 ------------------------------- Remove temporary directory for backup files ----------------------------- 0.39s /tmp/tmptdmnrt7v/tests/tasks/restore.yml:15 ----------------------------------- Gather information about the user --------------------------------------- 0.36s /tmp/tmptdmnrt7v/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/tmpppg9msr1 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: centos-8_setup.yml *************************************************** 1 plays in /cache/centos-8_setup.yml PLAY [Enable HA repos] ********************************************************* META: ran handlers TASK [Enable HA repos] ********************************************************* task path: /cache/centos-8_setup.yml:5 Thursday 21 July 2022 20:39:42 +0000 (0:00:00.019) 0:00:00.019 ********* changed: [/cache/centos-8.qcow2] => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "cmd": [ "dnf", "config-manager", "--set-enabled", "ha" ], "delta": "0:00:00.196637", "end": "2022-07-21 20:39:41.728617", "rc": 0, "start": "2022-07-21 20:39:41.531980" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-8.qcow2 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Thursday 21 July 2022 20:39:42 +0000 (0:00:00.780) 0:00:00.799 ********* =============================================================================== Enable HA repos --------------------------------------------------------- 0.78s /cache/centos-8_setup.yml:5 --------------------------------------------------- PLAYBOOK: tests_user_config.yml ************************************************ 1 plays in /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml PLAY [Test a creation of configuration file in the user directory] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:2 Thursday 21 July 2022 20:39:42 +0000 (0:00:00.017) 0:00:00.817 ********* ok: [/cache/centos-8.qcow2] META: ran handlers TASK [Backup configuration files] ********************************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:11 Thursday 21 July 2022 20:39:43 +0000 (0:00:01.022) 0:00:01.839 ********* included: /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml for /cache/centos-8.qcow2 TASK [Setup] ******************************************************************* task path: /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml:2 Thursday 21 July 2022 20:39:43 +0000 (0:00:00.025) 0:00:01.865 ********* included: /tmp/tmppdxivynv/tests/ssh/tasks/setup.yml for /cache/centos-8.qcow2 TASK [Ensure facts used by test] *********************************************** task path: /tmp/tmppdxivynv/tests/ssh/tasks/setup.yml:2 Thursday 21 July 2022 20:39:43 +0000 (0:00:00.023) 0:00:01.888 ********* skipping: [/cache/centos-8.qcow2] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/tmppdxivynv/tests/ssh/tasks/setup.yml:7 Thursday 21 July 2022 20:39:43 +0000 (0:00:00.018) 0:00:01.907 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Create a temporary directory for backup files] *************************** task path: /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml:5 Thursday 21 July 2022 20:39:46 +0000 (0:00:02.206) 0:00:04.113 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.5036tz0l", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml:13 Thursday 21 July 2022 20:39:46 +0000 (0:00:00.477) 0:00:04.591 ********* ok: [/cache/centos-8.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.5036tz0l/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf);\n cp /etc/ssh/ssh_config.d/00-ansible.conf /tmp/ansible.5036tz0l/$(dirname /etc/ssh/ssh_config.d/00-ansible.conf)\nfi\n", "delta": "0:00:00.008545", "end": "2022-07-21 20:39:45.927426", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:39:45.918881" } ok: [/cache/centos-8.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.5036tz0l/$(dirname /etc/ssh/ssh_config);\n cp /etc/ssh/ssh_config /tmp/ansible.5036tz0l/$(dirname /etc/ssh/ssh_config)\nfi\n", "delta": "0:00:00.007696", "end": "2022-07-21 20:39:46.272314", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:39:46.264618" } TASK [Create a test group (with the same name as user)] ************************ task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:14 Thursday 21 July 2022 20:39:47 +0000 (0:00:00.743) 0:00:05.334 ********* changed: [/cache/centos-8.qcow2] => { "changed": true, "gid": 1001, "name": "tester123", "state": "present", "system": false } TASK [Create a test user] ****************************************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:18 Thursday 21 July 2022 20:39:48 +0000 (0:00:00.786) 0:00:06.121 ********* changed: [/cache/centos-8.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/tmppdxivynv/tests/ssh/tests_user_config.yml:23 Thursday 21 July 2022 20:39:48 +0000 (0:00:00.782) 0:00:06.903 ********* TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Thursday 21 July 2022 20:39:49 +0000 (0:00:00.035) 0:00:06.939 ********* included: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for /cache/centos-8.qcow2 TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Thursday 21 July 2022 20:39:49 +0000 (0:00:00.026) 0:00:06.966 ********* ok: [/cache/centos-8.qcow2] TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:7 Thursday 21 July 2022 20:39:49 +0000 (0:00:00.513) 0:00:07.479 ********* skipping: [/cache/centos-8.qcow2] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-8.qcow2] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-8.qcow2] => (item=CentOS_8.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/CentOS_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_8.yml" } ok: [/cache/centos-8.qcow2] => (item=CentOS_8.yml) => { "ansible_facts": { "__ssh_defaults": { "Include": "/etc/ssh/ssh_config.d/*.conf" }, "__ssh_drop_in_name": "00-ansible", "__ssh_supports_drop_in": true }, "ansible_included_var_files": [ "/tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/CentOS_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_8.yml" } TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] *** task path: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Thursday 21 July 2022 20:39:49 +0000 (0:00:00.061) 0:00:07.540 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [fedora.linux_system_roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 Thursday 21 July 2022 20:39:51 +0000 (0:00:01.869) 0:00:09.410 ********* ok: [/cache/centos-8.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/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Thursday 21 July 2022 20:39:52 +0000 (0:00:00.515) 0:00:09.926 ********* changed: [/cache/centos-8.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/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Thursday 21 July 2022 20:39:52 +0000 (0:00:00.520) 0:00:10.446 ********* changed: [/cache/centos-8.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-1658435992.6015363-63200-201174362923251/source", "state": "file", "uid": 1001 } META: role_complete for /cache/centos-8.qcow2 TASK [Gather information about the user] *************************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:35 Thursday 21 July 2022 20:39:53 +0000 (0:00:01.122) 0:00:11.569 ********* ok: [/cache/centos-8.qcow2] => { "ansible_facts": { "getent_passwd": { "tester123": [ "x", "1001", "1001", "", "/home/tester123", "/bin/bash" ] } }, "changed": false } TASK [Download the created configuration file] ********************************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:45 Thursday 21 July 2022 20:39:54 +0000 (0:00:00.364) 0:00:11.934 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkdTU0FQSUF1dGhlbnRpY2F0aW9uIG5vCkhvc3QgZXhhbXBsZQogIEhvc3RuYW1lIGV4YW1wbGUuY29tCiAgVXNlciBzb21lYm9keQo=", "encoding": "base64", "source": "/home/tester123/.ssh/config" } TASK [Stat the .ssh dir] ******************************************************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:50 Thursday 21 July 2022 20:39:54 +0000 (0:00:00.486) 0:00:12.420 ********* [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-8.qcow2] => { "changed": false, "stat": { "atime": 1658435991.376017, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "ctime": 1658435992.496017, "dev": 64513, "device_type": 0, "executable": true, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 4195559, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mimetype": "inode/directory", "mode": "0700", "mtime": 1658435992.496017, "nlink": 2, "path": "/home/tester123/.ssh", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 20, "uid": 1001, "version": "2305529282", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": true } } TASK [Verify the ~/.ssh has sensible permissions] ****************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:58 Thursday 21 July 2022 20:39:54 +0000 (0:00:00.388) 0:00:12.809 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Make sure the file is readable by user] ********************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:66 Thursday 21 July 2022 20:39:54 +0000 (0:00:00.062) 0:00:12.871 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "stat": { "atime": 1658435993.358017, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435992.5000172, "dev": 64513, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 9012200, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435992.110017, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "3283320588", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Stat the configuration file] ********************************************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:73 Thursday 21 July 2022 20:39:55 +0000 (0:00:00.407) 0:00:13.278 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "stat": { "atime": 1658435993.358017, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "33e5d453ffc19413f8e74630b334c90d4e22a1dd", "ctime": 1658435992.5000172, "dev": 64513, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "tester123", "inode": 9012200, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1658435992.110017, "nlink": 1, "path": "/home/tester123/.ssh/config", "pw_name": "tester123", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 98, "uid": 1001, "version": "3283320588", "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/tmppdxivynv/tests/ssh/tests_user_config.yml:78 Thursday 21 July 2022 20:39:55 +0000 (0:00:00.386) 0:00:13.664 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Verify the file has sensible permissions] ******************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:89 Thursday 21 July 2022 20:39:55 +0000 (0:00:00.077) 0:00:13.742 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Test the effective configuration using ssh] ****************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:97 Thursday 21 July 2022 20:39:55 +0000 (0:00:00.067) 0:00:13.809 ********* changed: [/cache/centos-8.qcow2] => { "changed": true, "cmd": [ "ssh", "-vvv", "-G", "example" ], "delta": "0:00:00.006970", "end": "2022-07-21 20:39:55.171051", "rc": 0, "start": "2022-07-21 20:39:55.164081" } STDOUT: user somebody hostname example.com port 22 addkeystoagent false addressfamily any batchmode no canonicalizefallbacklocal yes canonicalizehostname false challengeresponseauthentication yes checkhostip yes compression no controlmaster false enablesshkeysign no clearallforwardings no exitonforwardfailure no fingerprinthash SHA256 forwardagent no forwardx11 no forwardx11trusted yes gatewayports no gssapiauthentication no gssapikeyexchange no gssapidelegatecredentials no gssapitrustdns no gssapirenewalforcesrekey no gssapikexalgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1- hashknownhosts no hostbasedauthentication no identitiesonly no kbdinteractiveauthentication yes nohostauthenticationforlocalhost no passwordauthentication yes permitlocalcommand no proxyusefdpass no pubkeyauthentication yes requesttty auto streamlocalbindunlink no stricthostkeychecking ask tcpkeepalive yes tunnel false verifyhostkeydns false visualhostkey no updatehostkeys false canonicalizemaxdots 1 connectionattempts 1 forwardx11timeout 1200 numberofpasswordprompts 3 serveralivecountmax 3 serveraliveinterval 0 ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa hostbasedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 casignaturealgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-256,rsa-sha2-512,ssh-rsa loglevel DEBUG3 macs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 pubkeyacceptedkeytypes ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,ssh-rsa,ssh-rsa-cert-v01@openssh.com xauthlocation /usr/bin/xauth identityfile ~/.ssh/id_rsa identityfile ~/.ssh/id_dsa identityfile ~/.ssh/id_ecdsa identityfile ~/.ssh/id_ed25519 identityfile ~/.ssh/id_xmss canonicaldomains globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2 sendenv LANG sendenv LC_CTYPE sendenv LC_NUMERIC sendenv LC_TIME sendenv LC_COLLATE sendenv LC_MONETARY sendenv LC_MESSAGES sendenv LC_PAPER sendenv LC_NAME sendenv LC_ADDRESS sendenv LC_TELEPHONE sendenv LC_MEASUREMENT sendenv LC_IDENTIFICATION sendenv LC_ALL sendenv LANGUAGE sendenv XMODIFIERS connecttimeout none tunneldevice any:any controlpersist no escapechar ~ ipqos af21 cs1 rekeylimit 0 0 streamlocalbindmask 0177 syslogfacility USER STDERR: OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 debug1: Reading configuration data /home/tester123/.ssh/config debug1: /home/tester123/.ssh/config line 5: Applying options for example debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] debug1: configuration requests final Match pass debug1: re-parsing configuration debug1: Reading configuration data /home/tester123/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/00-ansible.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/00-ansible.conf debug3: /etc/ssh/ssh_config line 4: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host example.com originally example debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] TASK [Make sure the effective configuration is expected] *********************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:106 Thursday 21 July 2022 20:39:56 +0000 (0:00:00.427) 0:00:14.237 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Download the global configuration files too] ***************************** task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:114 Thursday 21 July 2022 20:39:56 +0000 (0:00:00.072) 0:00:14.310 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCkluY2x1ZGUgL2V0Yy9zc2gvc3NoX2NvbmZpZy5kLyouY29uZgo=", "encoding": "base64", "source": "/etc/ssh/ssh_config" } TASK [Verify the options are NOT in the global configuration file] ************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:119 Thursday 21 July 2022 20:39:56 +0000 (0:00:00.385) 0:00:14.695 ********* ok: [/cache/centos-8.qcow2] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:129 Thursday 21 July 2022 20:39:56 +0000 (0:00:00.077) 0:00:14.772 ********* included: /tmp/tmppdxivynv/tests/ssh/tasks/restore.yml for /cache/centos-8.qcow2 TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/tmppdxivynv/tests/ssh/tasks/restore.yml:2 Thursday 21 July 2022 20:39:56 +0000 (0:00:00.049) 0:00:14.822 ********* ok: [/cache/centos-8.qcow2] => (item=/etc/ssh/ssh_config.d/00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.5036tz0l//etc/ssh/ssh_config.d/00-ansible.conf; then\n cp /tmp/ansible.5036tz0l//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.006129", "end": "2022-07-21 20:39:56.150142", "item": "/etc/ssh/ssh_config.d/00-ansible.conf", "rc": 0, "start": "2022-07-21 20:39:56.144013" } ok: [/cache/centos-8.qcow2] => (item=/etc/ssh/ssh_config) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.5036tz0l//etc/ssh/ssh_config; then\n cp /tmp/ansible.5036tz0l//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.005906", "end": "2022-07-21 20:39:56.484725", "item": "/etc/ssh/ssh_config", "rc": 0, "start": "2022-07-21 20:39:56.478819" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/tmppdxivynv/tests/ssh/tasks/restore.yml:15 Thursday 21 July 2022 20:39:57 +0000 (0:00:00.723) 0:00:15.546 ********* ok: [/cache/centos-8.qcow2] => { "changed": false, "path": "/tmp/ansible.5036tz0l", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-8.qcow2 : ok=31 changed=6 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 21 July 2022 20:39:57 +0000 (0:00:00.372) 0:00:15.918 ********* =============================================================================== Make sure openssh is installed before creating backup ------------------- 2.21s /tmp/tmppdxivynv/tests/ssh/tasks/setup.yml:7 ---------------------------------- fedora.linux_system_roles.ssh : Ensure required packages are installed --- 1.87s /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 fedora.linux_system_roles.ssh : Generate the configuration file --------- 1.12s /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:28 Gathering Facts --------------------------------------------------------- 1.02s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:2 ---------------------------- Create a test group (with the same name as user) ------------------------ 0.79s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:14 --------------------------- Create a test user ------------------------------------------------------ 0.78s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:18 --------------------------- Enable HA repos --------------------------------------------------------- 0.78s /cache/centos-8_setup.yml:5 --------------------------------------------------- Backup files ------------------------------------------------------------ 0.74s /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml:13 -------------------------------- Restore backed up files and remove what was not present ----------------- 0.72s /tmp/tmppdxivynv/tests/ssh/tasks/restore.yml:2 -------------------------------- fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.52s /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.52s /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:10 fedora.linux_system_roles.ssh : Ensure ansible_facts used by role ------- 0.51s /tmp/tmpppg9msr1/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Download the created configuration file --------------------------------- 0.49s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:45 --------------------------- Create a temporary directory for backup files --------------------------- 0.48s /tmp/tmppdxivynv/tests/ssh/tasks/backup.yml:5 --------------------------------- Test the effective configuration using ssh ------------------------------ 0.43s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:97 --------------------------- Make sure the file is readable by user ---------------------------------- 0.41s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:66 --------------------------- Stat the .ssh dir ------------------------------------------------------- 0.39s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:50 --------------------------- Stat the configuration file --------------------------------------------- 0.39s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:73 --------------------------- Download the global configuration files too ----------------------------- 0.39s /tmp/tmppdxivynv/tests/ssh/tests_user_config.yml:114 -------------------------- Remove temporary directory for backup files ----------------------------- 0.37s /tmp/tmppdxivynv/tests/ssh/tasks/restore.yml:15 -------------------------------