# STDOUT: ---v---v---v---v---v--- ansible-playbook 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = ['/home/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/ansible-2.9/lib/python3.9/site-packages/ansible executable location = /opt/ansible-2.9/bin/ansible-playbook python version = 3.9.18 (main, Sep 7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] Using /etc/ansible/ansible.cfg as config file Skipping callback 'actionable', as we already have a stdout callback. Skipping callback 'counter_enabled', as we already have a stdout callback. Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'full_skip', as we already have a stdout callback. Skipping callback 'json', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'null', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. Skipping callback 'selective', as we already have a stdout callback. Skipping callback 'skippy', as we already have a stdout callback. Skipping callback 'stderr', as we already have a stdout callback. Skipping callback 'unixy', as we already have a stdout callback. Skipping callback 'yaml', as we already have a stdout callback. PLAYBOOK: tests_role_applied.yml *********************************************** 1 plays in /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml PLAY [Basic test for Sudo] ***************************************************** TASK [Gathering Facts] ********************************************************* task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:2 Tuesday 21 May 2024 09:20:09 +0000 (0:00:00.012) 0:00:00.012 *********** ok: [sut] META: ran handlers TASK [Run the role] ************************************************************ task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:7 Tuesday 21 May 2024 09:20:10 +0000 (0:00:00.797) 0:00:00.809 *********** TASK [linux-system-roles.sudo : Ensure sudo is installed] ********************** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:2 Tuesday 21 May 2024 09:20:10 +0000 (0:00:00.017) 0:00:00.826 *********** ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [linux-system-roles.sudo : Set include directories variable] ************** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:7 Tuesday 21 May 2024 09:20:13 +0000 (0:00:02.678) 0:00:03.505 *********** ok: [sut] => { "ansible_facts": { "sudo_include_dirs": [ "/etc/sudoers.d" ] }, "changed": false } TASK [linux-system-roles.sudo : Set sudoer file paths variable] **************** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:13 Tuesday 21 May 2024 09:20:13 +0000 (0:00:00.019) 0:00:03.525 *********** ok: [sut] => { "ansible_facts": { "sudo_file_paths": [ "/etc/sudoers" ] }, "changed": false } TASK [linux-system-roles.sudo : Ensure include directories are created] ******** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:19 Tuesday 21 May 2024 09:20:13 +0000 (0:00:00.020) 0:00:03.546 *********** ok: [sut] => (item=/etc/sudoers.d) => { "ansible_loop_var": "item", "changed": false, "gid": 0, "group": "root", "item": "/etc/sudoers.d", "mode": "0750", "owner": "root", "path": "/etc/sudoers.d", "secontext": "system_u:object_r:etc_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [linux-system-roles.sudo : Ensure sudoers include files are configured] *** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:29 Tuesday 21 May 2024 09:20:13 +0000 (0:00:00.282) 0:00:03.828 *********** skipping: [sut] => (item=/etc/sudoers) => { "ansible_loop_var": "item", "changed": false, "item": { "defaults": [ "!visiblepw", "always_set_home", "match_group_by_gid", "always_query_group_plugin", "env_reset", { "secure_path": [ "/sbin", "/bin", "/usr/sbin", "/usr/bin" ] }, { "env_keep": [ "COLORS", "DISPLAY", "HOSTNAME", "HISTSIZE", "KDEDIR", "LS_COLORS", "MAIL", "PS1", "PS2", "QTDIR", "USERNAME", "LANG", "LC_ADDRESS", "LC_CTYPE", "LC_COLLATE", "LC_IDENTIFICATION", "LC_MEASUREMENT", "LC_MESSAGES", "LC_MONETARY", "LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME", "LC_ALL", "LANGUAGE", "LINGUAS", "_XKB_CHARSET", "XAUTHORITY" ] } ], "include_directories": [ "/etc/sudoers.d" ], "path": "/etc/sudoers", "user_specifications": [ { "commands": [ "ALL" ], "hosts": [ "ALL" ], "operators": [ "ALL" ], "users": [ "root" ] }, { "commands": [ "ALL" ], "hosts": [ "ALL" ], "operators": [ "ALL" ], "users": [ "%wheel" ] } ] }, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.sudo : Ensure /etc/sudoers is configured] ************* task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:42 Tuesday 21 May 2024 09:20:13 +0000 (0:00:00.021) 0:00:03.850 *********** ok: [sut] => (item=/etc/sudoers) => { "ansible_loop_var": "item", "changed": false, "checksum": "fc5c161eed42bf4d12f49c476bfc46e8e56097d2", "dest": "/etc/sudoers", "gid": 0, "group": "root", "item": { "defaults": [ "!visiblepw", "always_set_home", "match_group_by_gid", "always_query_group_plugin", "env_reset", { "secure_path": [ "/sbin", "/bin", "/usr/sbin", "/usr/bin" ] }, { "env_keep": [ "COLORS", "DISPLAY", "HOSTNAME", "HISTSIZE", "KDEDIR", "LS_COLORS", "MAIL", "PS1", "PS2", "QTDIR", "USERNAME", "LANG", "LC_ADDRESS", "LC_CTYPE", "LC_COLLATE", "LC_IDENTIFICATION", "LC_MEASUREMENT", "LC_MESSAGES", "LC_MONETARY", "LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME", "LC_ALL", "LANGUAGE", "LINGUAS", "_XKB_CHARSET", "XAUTHORITY" ] } ], "include_directories": [ "/etc/sudoers.d" ], "path": "/etc/sudoers", "user_specifications": [ { "commands": [ "ALL" ], "hosts": [ "ALL" ], "operators": [ "ALL" ], "users": [ "root" ] }, { "commands": [ "ALL" ], "hosts": [ "ALL" ], "operators": [ "ALL" ], "users": [ "%wheel" ] } ] }, "mode": "0440", "owner": "root", "path": "/etc/sudoers", "secontext": "system_u:object_r:etc_t:s0", "size": 813, "state": "file", "uid": 0 } TASK [linux-system-roles.sudo : Search for sudoers files in included directories] *** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:62 Tuesday 21 May 2024 09:20:14 +0000 (0:00:00.556) 0:00:04.406 *********** ok: [sut] => { "changed": false, "examined": 0, "files": [], "matched": 0 } TASK [linux-system-roles.sudo : Set unauthorized included sudoers files variable] *** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:70 Tuesday 21 May 2024 09:20:14 +0000 (0:00:00.261) 0:00:04.668 *********** ok: [sut] => { "ansible_facts": { "sudo_unauthorized_files": [] }, "changed": false } TASK [linux-system-roles.sudo : Remove unauthorized included sudoers files] **** task path: /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:76 Tuesday 21 May 2024 09:20:14 +0000 (0:00:00.021) 0:00:04.690 *********** TASK [Create temp test directory] ********************************************** task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:14 Tuesday 21 May 2024 09:20:14 +0000 (0:00:00.017) 0:00:04.707 *********** changed: [sut] => { "changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/var/tmp/sudo_qrasbdqf", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [Backup sudoers] ********************************************************** task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:21 Tuesday 21 May 2024 09:20:14 +0000 (0:00:00.244) 0:00:04.951 *********** changed: [sut] => { "changed": true, "checksum": "fc5c161eed42bf4d12f49c476bfc46e8e56097d2", "dest": "/var/tmp/sudo_qrasbdqf/sudoers", "gid": 0, "group": "root", "md5sum": "10930d4d72a2804fdbc804a21a30f856", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:etc_t:s0", "size": 813, "src": "/etc/sudoers", "state": "file", "uid": 0 } TASK [Backup sudoers.d] ******************************************************** task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:30 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.352) 0:00:05.304 *********** changed: [sut] => { "changed": true, "checksum": null, "dest": "/var/tmp/sudo_qrasbdqf/sudoers.d", "gid": 0, "group": "root", "md5sum": null, "mode": "0644", "owner": "root", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 23, "src": "/etc/sudoers.d", "state": "directory", "uid": 0 } TASK [Check sudoers] *********************************************************** task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:39 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.276) 0:00:05.580 *********** included: /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml for sut TASK [Get stat of files/tests_role_applied.ok] ********************************* task path: /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml:3 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.021) 0:00:05.602 *********** ok: [sut -> localhost] => { "changed": false, "stat": { "atime": 1716282357.040659, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "59865a2d50f870e99cabad1aa9832881ebe54d4e70f16b9688e677f647d680d8", "ctime": 1716282357.040659, "dev": 66305, "device_type": 0, "executable": false, "exists": true, "gid": 1001, "gr_name": "jenkins", "inode": 406847655, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/x-c", "mode": "0644", "mtime": 1716282357.040659, "nlink": 1, "path": "files/tests_role_applied.ok", "pw_name": "jenkins", "readable": true, "rgrp": true, "roth": true, "rusr": true, "size": 813, "uid": 1000090000, "version": null, "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Get stat of /etc/sudoers] ************************************************ task path: /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml:10 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.107) 0:00:05.709 *********** ok: [sut] => { "changed": false, "stat": { "atime": 1716283214.0906942, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "59865a2d50f870e99cabad1aa9832881ebe54d4e70f16b9688e677f647d680d8", "ctime": 1716283204.5450215, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 8388929, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/x-c", "mode": "0440", "mtime": 1716283204.3340287, "nlink": 1, "path": "/etc/sudoers", "pw_name": "root", "readable": true, "rgrp": true, "roth": false, "rusr": true, "size": 813, "uid": 0, "version": "480585616", "wgrp": false, "woth": false, "writeable": true, "wusr": false, "xgrp": false, "xoth": false, "xusr": false } } TASK [Assert that files are identical] ***************************************** task path: /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml:16 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.189) 0:00:05.898 *********** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Restore sudoers] ********************************************************* task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:45 Tuesday 21 May 2024 09:20:15 +0000 (0:00:00.010) 0:00:05.909 *********** changed: [sut] => { "changed": true, "checksum": "fc5c161eed42bf4d12f49c476bfc46e8e56097d2", "dest": "/etc/sudoers", "gid": 0, "group": "root", "md5sum": "10930d4d72a2804fdbc804a21a30f856", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:etc_t:s0", "size": 813, "src": "/var/tmp/sudo_qrasbdqf/sudoers", "state": "file", "uid": 0 } TASK [Restore sudoers.d] ******************************************************* task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:54 Tuesday 21 May 2024 09:20:16 +0000 (0:00:00.266) 0:00:06.176 *********** changed: [sut] => { "changed": true, "checksum": null, "dest": "/etc/sudoers.d/sudoers.d", "gid": 0, "group": "root", "md5sum": null, "mode": "0644", "owner": "root", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 23, "src": "/var/tmp/sudo_qrasbdqf/sudoers.d", "state": "directory", "uid": 0 } TASK [Clean up temp directory] ************************************************* task path: /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:63 Tuesday 21 May 2024 09:20:16 +0000 (0:00:00.266) 0:00:06.442 *********** changed: [sut] => { "changed": true, "path": "/var/tmp/sudo_qrasbdqf", "state": "absent" } META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* sut : ok=18 changed=6 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0 Tuesday 21 May 2024 09:20:16 +0000 (0:00:00.184) 0:00:06.627 *********** =============================================================================== linux-system-roles.sudo : Ensure sudo is installed ---------------------- 2.68s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:2 Gathering Facts --------------------------------------------------------- 0.80s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:2 ---------------------- linux-system-roles.sudo : Ensure /etc/sudoers is configured ------------- 0.56s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:42 Backup sudoers ---------------------------------------------------------- 0.35s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:21 --------------------- linux-system-roles.sudo : Ensure include directories are created -------- 0.28s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:19 Backup sudoers.d -------------------------------------------------------- 0.28s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:30 --------------------- Restore sudoers --------------------------------------------------------- 0.27s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:45 --------------------- Restore sudoers.d ------------------------------------------------------- 0.27s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:54 --------------------- linux-system-roles.sudo : Search for sudoers files in included directories --- 0.26s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:62 Create temp test directory ---------------------------------------------- 0.24s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:14 --------------------- Get stat of /etc/sudoers ------------------------------------------------ 0.19s /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml:10 ----------- Clean up temp directory ------------------------------------------------- 0.18s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:63 --------------------- Get stat of files/tests_role_applied.ok --------------------------------- 0.11s /WORKDIR/git-codeo2unz7nz/tests/tasks/assert_files_identical.yml:3 ------------ linux-system-roles.sudo : Set unauthorized included sudoers files variable --- 0.02s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:70 linux-system-roles.sudo : Ensure sudoers include files are configured --- 0.02s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:29 Check sudoers ----------------------------------------------------------- 0.02s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:39 --------------------- linux-system-roles.sudo : Set sudoer file paths variable ---------------- 0.02s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:13 linux-system-roles.sudo : Set include directories variable -------------- 0.02s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:7 linux-system-roles.sudo : Remove unauthorized included sudoers files ---- 0.02s /WORKDIR/git-codeo2unz7nz/tests/roles/linux-system-roles.sudo/tasks/main.yml:76 Run the role ------------------------------------------------------------ 0.02s /WORKDIR/git-codeo2unz7nz/tests/tests_role_applied.yml:7 ---------------------- ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- ---^---^---^---^---^---