ansible-playbook [core 2.16.11] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.12/site-packages/ansible ansible collection location = /tmp/collections-cPx executable location = /usr/local/bin/ansible-playbook python version = 3.12.1 (main, Feb 21 2024, 14:18:26) [GCC 8.5.0 20210514 (Red Hat 8.5.0-21)] (/usr/bin/python3.12) jinja version = 3.1.4 libyaml = True No config file found; using defaults running playbook inside collection fedora.linux_system_roles redirecting (type: callback) ansible.builtin.debug to ansible.posix.debug redirecting (type: callback) ansible.builtin.debug to ansible.posix.debug redirecting (type: callback) ansible.builtin.profile_tasks to ansible.posix.profile_tasks 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_custom_drop_in.yml ********************************************* 1 plays in /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml PLAY [Test we can write any other configuration file as a drop-in] ************* TASK [Gathering Facts] ********************************************************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:2 Saturday 28 September 2024 17:18:06 -0400 (0:00:00.011) 0:00:00.011 **** ok: [managed-node1] TASK [Skip if the system does not support drop in directory] ******************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:10 Saturday 28 September 2024 17:18:07 -0400 (0:00:01.172) 0:00:01.183 **** META: end_host conditional evaluated to False, continuing execution for managed-node1 skipping: [managed-node1] => { "skip_reason": "end_host conditional evaluated to False, continuing execution for managed-node1" } MSG: end_host conditional evaluated to false, continuing execution for managed-node1 TASK [Backup configuration files] ********************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:15 Saturday 28 September 2024 17:18:07 -0400 (0:00:00.039) 0:00:01.223 **** included: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml for managed-node1 TASK [Setup] ******************************************************************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml:2 Saturday 28 September 2024 17:18:07 -0400 (0:00:00.016) 0:00:01.239 **** included: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml for managed-node1 TASK [Ensure facts used by test] *********************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:2 Saturday 28 September 2024 17:18:07 -0400 (0:00:00.018) 0:00:01.257 **** skipping: [managed-node1] => { "changed": false, "false_condition": "'os_family' not in ansible_facts", "skip_reason": "Conditional result was False" } TASK [Check if system is ostree] *********************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:10 Saturday 28 September 2024 17:18:07 -0400 (0:00:00.011) 0:00:01.268 **** ok: [managed-node1] => { "changed": false, "stat": { "exists": false } } TASK [Set flag to indicate system is ostree] *********************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:15 Saturday 28 September 2024 17:18:08 -0400 (0:00:00.457) 0:00:01.726 **** ok: [managed-node1] => { "ansible_facts": { "__ssh_is_ostree": false }, "changed": false } TASK [Make sure openssh is installed before creating backup] ******************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:19 Saturday 28 September 2024 17:18:08 -0400 (0:00:00.043) 0:00:01.770 **** ok: [managed-node1] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do lsrpackages: openssh-clients TASK [Define common variables] ************************************************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:31 Saturday 28 September 2024 17:18:11 -0400 (0:00:03.018) 0:00:04.789 **** ok: [managed-node1] => { "ansible_facts": { "main_ssh_config": "/etc/ssh/ssh_config", "main_ssh_config_name": "ssh_config", "main_ssh_config_path": "/etc/ssh/" }, "changed": false } TASK [Define specific variables] *********************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:37 Saturday 28 September 2024 17:18:11 -0400 (0:00:00.012) 0:00:04.801 **** ok: [managed-node1] => { "ansible_facts": { "main_ssh_config": "/etc/ssh/ssh_config.d/00-ansible.conf", "main_ssh_config_name": "00-ansible.conf", "main_ssh_config_path": "/etc/ssh/ssh_config.d/" }, "changed": false } TASK [Create a temporary directory for backup files] *************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml:5 Saturday 28 September 2024 17:18:11 -0400 (0:00:00.017) 0:00:04.818 **** ok: [managed-node1] => { "changed": false, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.9n36dip0", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup files] ************************************************************ task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml:13 Saturday 28 September 2024 17:18:11 -0400 (0:00:00.404) 0:00:05.222 **** ok: [managed-node1] => (item=/tmp/ssh_config.d_00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ssh_config.d_00-ansible.conf; then\n mkdir -p /tmp/ansible.9n36dip0/$(dirname /tmp/ssh_config.d_00-ansible.conf);\n cp -a /tmp/ssh_config.d_00-ansible.conf /tmp/ansible.9n36dip0/$(dirname /tmp/ssh_config.d_00-ansible.conf)\nfi\n", "delta": "0:00:00.003192", "end": "2024-09-28 17:18:12.360234", "item": "/tmp/ssh_config.d_00-ansible.conf", "rc": 0, "start": "2024-09-28 17:18:12.357042" } TASK [Run role] **************************************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:18 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.453) 0:00:05.676 **** TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:2 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.029) 0:00:05.705 **** included: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml for managed-node1 TASK [fedora.linux_system_roles.ssh : Ensure ansible_facts used by role] ******* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:2 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.019) 0:00:05.725 **** skipping: [managed-node1] => { "changed": false, "false_condition": "__ssh_required_facts | difference(ansible_facts.keys() | list) | length > 0", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Check if system is ostree] *************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:10 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.019) 0:00:05.745 **** skipping: [managed-node1] => { "changed": false, "false_condition": "not __ssh_is_ostree is defined", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Set flag to indicate system is ostree] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:15 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.024) 0:00:05.769 **** skipping: [managed-node1] => { "changed": false, "false_condition": "not __ssh_is_ostree is defined", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Check if transactional-update exists in /sbin] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:22 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.023) 0:00:05.793 **** ok: [managed-node1] => { "changed": false, "stat": { "exists": false } } TASK [fedora.linux_system_roles.ssh : Set flag if transactional-update exists] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:27 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.329) 0:00:06.122 **** ok: [managed-node1] => { "ansible_facts": { "__ssh_is_transactional": false }, "changed": false } TASK [fedora.linux_system_roles.ssh : Set platform/version specific variables] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:31 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.021) 0:00:06.143 **** skipping: [managed-node1] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "false_condition": "__vars_file is file", "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [managed-node1] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "false_condition": "__vars_file is file", "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [managed-node1] => (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/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/vars/CentOS_8.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_8.yml" } ok: [managed-node1] => (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/collections-cPx/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/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Saturday 28 September 2024 17:18:12 -0400 (0:00:00.036) 0:00:06.180 **** ok: [managed-node1] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do lsrpackages: openssh openssh-clients TASK [fedora.linux_system_roles.ssh : Notify user that reboot is needed to apply changes] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 Saturday 28 September 2024 17:18:15 -0400 (0:00:02.730) 0:00:08.910 **** skipping: [managed-node1] => { "false_condition": "__ssh_is_transactional | d(false)" } TASK [fedora.linux_system_roles.ssh : Reboot transactional update systems] ***** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:22 Saturday 28 September 2024 17:18:15 -0400 (0:00:00.032) 0:00:08.943 **** skipping: [managed-node1] => { "changed": false, "false_condition": "__ssh_is_transactional | d(false)", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Fail if reboot is needed and not set] **** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:27 Saturday 28 September 2024 17:18:15 -0400 (0:00:00.051) 0:00:08.994 **** skipping: [managed-node1] => { "changed": false, "false_condition": "__ssh_is_transactional | d(false)", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Gather information about the user for user configuration] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:35 Saturday 28 September 2024 17:18:15 -0400 (0:00:00.031) 0:00:09.026 **** skipping: [managed-node1] => { "changed": false, "false_condition": "ssh_user is not none", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions] *** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:42 Saturday 28 September 2024 17:18:15 -0400 (0:00:00.059) 0:00:09.085 **** skipping: [managed-node1] => { "changed": false, "false_condition": "ssh_user is not none", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.ssh : Generate the configuration file] ********* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:53 Saturday 28 September 2024 17:18:15 -0400 (0:00:00.045) 0:00:09.131 **** changed: [managed-node1] => { "changed": true, "checksum": "fd10e361130dbd3cf0286a2cc3bd7f14ae1d8b43", "dest": "/tmp/ssh_config.d_00-ansible.conf", "gid": 0, "group": "root", "md5sum": "794672c8a072307a0e09ee8ae798b34c", "mode": "0644", "owner": "root", "secontext": "unconfined_u:object_r:admin_home_t:s0", "size": 81, "src": "/root/.ansible/tmp/ansible-tmp-1727558295.9276547-9685-44912034525426/source", "state": "file", "uid": 0 } TASK [Download the custom configuration file drop-in] ************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:29 Saturday 28 September 2024 17:18:16 -0400 (0:00:01.029) 0:00:10.161 **** ok: [managed-node1] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojCiMgc3lzdGVtX3JvbGU6c3NoCgpDb21wcmVzc2lvbiB5ZXMKR1NTQVBJQXV0aGVudGljYXRpb24gbm8K", "encoding": "base64", "source": "/tmp/ssh_config.d_00-ansible.conf" } TASK [Verify the options are in the file] ************************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:34 Saturday 28 September 2024 17:18:17 -0400 (0:00:00.431) 0:00:10.593 **** ok: [managed-node1] => { "changed": false } MSG: All assertions passed TASK [Restore configuration files] ********************************************* task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:43 Saturday 28 September 2024 17:18:17 -0400 (0:00:00.023) 0:00:10.616 **** included: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/restore.yml for managed-node1 TASK [Restore backed up files and remove what was not present] ***************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/restore.yml:2 Saturday 28 September 2024 17:18:17 -0400 (0:00:00.016) 0:00:10.633 **** ok: [managed-node1] => (item=/tmp/ssh_config.d_00-ansible.conf) => { "ansible_loop_var": "item", "changed": false, "cmd": "if test -f /tmp/ansible.9n36dip0//tmp/ssh_config.d_00-ansible.conf; then\n cp -a /tmp/ansible.9n36dip0//tmp/ssh_config.d_00-ansible.conf $(dirname /tmp/ssh_config.d_00-ansible.conf)\nelif test -f /tmp/ssh_config.d_00-ansible.conf; then\n rm /tmp/ssh_config.d_00-ansible.conf\nfi\n", "delta": "0:00:00.003994", "end": "2024-09-28 17:18:17.702446", "item": "/tmp/ssh_config.d_00-ansible.conf", "rc": 0, "start": "2024-09-28 17:18:17.698452" } TASK [Remove temporary directory for backup files] ***************************** task path: /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/restore.yml:15 Saturday 28 September 2024 17:18:17 -0400 (0:00:00.400) 0:00:11.034 **** ok: [managed-node1] => { "changed": false, "path": "/tmp/ansible.9n36dip0", "state": "absent" } PLAY RECAP ********************************************************************* managed-node1 : ok=21 changed=1 unreachable=0 failed=0 skipped=9 rescued=0 ignored=0 Saturday 28 September 2024 17:18:18 -0400 (0:00:00.520) 0:00:11.554 **** =============================================================================== Make sure openssh is installed before creating backup ------------------- 3.02s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:19 fedora.linux_system_roles.ssh : Ensure required packages are installed --- 2.73s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5 Gathering Facts --------------------------------------------------------- 1.17s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:2 fedora.linux_system_roles.ssh : Generate the configuration file --------- 1.03s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:53 Remove temporary directory for backup files ----------------------------- 0.52s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/restore.yml:15 Check if system is ostree ----------------------------------------------- 0.46s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:10 Backup files ------------------------------------------------------------ 0.45s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml:13 Download the custom configuration file drop-in -------------------------- 0.43s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:29 Create a temporary directory for backup files --------------------------- 0.40s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/backup.yml:5 Restore backed up files and remove what was not present ----------------- 0.40s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/restore.yml:2 fedora.linux_system_roles.ssh : Check if transactional-update exists in /sbin --- 0.33s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:22 fedora.linux_system_roles.ssh : Gather information about the user for user configuration --- 0.06s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:35 fedora.linux_system_roles.ssh : Reboot transactional update systems ----- 0.05s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:22 fedora.linux_system_roles.ssh : Make sure the ~/.ssh/ directory exists and has expected permissions --- 0.05s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:42 Set flag to indicate system is ostree ----------------------------------- 0.04s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tasks/setup.yml:15 Skip if the system does not support drop in directory ------------------- 0.04s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:10 fedora.linux_system_roles.ssh : Set platform/version specific variables --- 0.04s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/set_vars.yml:31 fedora.linux_system_roles.ssh : Notify user that reboot is needed to apply changes --- 0.03s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:17 fedora.linux_system_roles.ssh : Fail if reboot is needed and not set ---- 0.03s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:27 Run role ---------------------------------------------------------------- 0.03s /tmp/collections-cPx/ansible_collections/fedora/linux_system_roles/tests/ssh/tests_custom_drop_in.yml:18