# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [test simple kernel settings] ********************************************* TASK [Gathering Facts] ********************************************************* ok: [sut] TASK [set platform independent vars used by this test] ************************* ok: [sut] => { "ansible_facts": { "__kernel_settings_profile_file": "# File managed by Ansible - DO NOT EDIT\n[main]\nsummary = kernel settings\n[sysctl]\nfs.epoll.max_user_watches = 785592\nfs.file-max = 379724\n[vm]\ntransparent_hugepages = madvise\n[sysfs]\n/sys/kernel/debug/x86/ibrs_enabled = 0\n/sys/kernel/debug/x86/pti_enabled = 0\n/sys/kernel/debug/x86/retp_enabled = 0\n{% if __kernel_settings_blcmdline_value | d() %}\n[bootloader]\ncmdline = {{ __kernel_settings_blcmdline_value }}\n{% endif %}\n", "kernel_settings_sysctl": [ { "name": "fs.epoll.max_user_watches", "value": 785592 }, { "name": "fs.file-max", "value": 379724 }, { "name": "no.such.param", "state": "absent" } ], "kernel_settings_sysfs": [ { "name": "/sys/kernel/debug/x86/pti_enabled", "value": 0 }, { "name": "/sys/kernel/debug/x86/retp_enabled", "value": 0 }, { "name": "/sys/kernel/debug/x86/ibrs_enabled", "value": 0 }, { "name": "/sys/not/found", "state": "absent" } ], "kernel_settings_systemd_cpu_affinity": { "state": "absent" }, "kernel_settings_transparent_hugepages": "madvise", "kernel_settings_transparent_hugepages_defrag": { "state": "absent" } }, "ansible_included_var_files": [ "/WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/vars/vars_simple_settings.yml" ], "changed": false } TASK [disable bootloader cmdline testing on Fedora] **************************** ok: [sut] => { "ansible_facts": { "__kernel_settings_blcmdline_value": null, "__kernel_settings_check_reboot": false, "kernel_settings_bootloader_cmdline": null }, "changed": false } TASK [apply the settings - call the role] ************************************** TASK [linux-system-roles.kernel_settings : Set version specific variables] ***** ok: [sut] => { "ansible_facts": { "__kernel_settings_packages": [ "tuned" ], "__kernel_settings_services": [ "tuned" ] }, "ansible_included_var_files": [ "/WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/roles/linux-system-roles.kernel_settings/vars/default.yml" ], "changed": false } TASK [linux-system-roles.kernel_settings : Ensure required packages are installed] *** changed: [sut] => { "changed": true, "rc": 0, "results": [ "Installed: kernel-tools-5.15.4-200.fc35.x86_64", "Installed: kernel-tools-libs-5.15.4-200.fc35.x86_64", "Installed: python3-perf-5.15.4-200.fc35.x86_64", "Installed: hdparm-9.62-2.fc35.x86_64", "Installed: tuned-2.17.0-1.fc35.noarch", "Installed: dmidecode-1:3.3-2.fc35.x86_64", "Installed: numactl-libs-2.0.14-4.fc35.x86_64", "Installed: ethtool-2:5.16-1.fc35.x86_64", "Installed: pciutils-libs-3.7.0-4.fc35.x86_64", "Installed: python3-linux-procfs-0.6.3-3.fc35.noarch", "Installed: python3-pyudev-0.22.0-6.fc35.noarch", "Installed: virt-what-1.21-2.fc35.x86_64" ] } TASK [linux-system-roles.kernel_settings : Ensure required services are enabled and started] *** changed: [sut] => (item=tuned) => { "ansible_loop_var": "item", "changed": true, "enabled": true, "item": "tuned", "name": "tuned", "state": "started", "status": { "ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "dbus-broker.service systemd-sysctl.service systemd-journald.socket basic.target dbus.socket sysinit.target network.target system.slice", "AllowIsolate": "no", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "BusName": "com.redhat.tuned", "CPUAccounting": "yes", "CPUAffinityFromNUMA": "no", "CPUQuotaPerSecUSec": "infinity", "CPUQuotaPeriodUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "[not set]", "CPUUsageNSec": "[not set]", "CPUWeight": "[not set]", "CacheDirectoryMode": "0755", "CanFreeze": "yes", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf cap_checkpoint_restore", "CleanResult": "success", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target cpupower.service", "ControlPID": "0", "CoredumpFilter": "0x33", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "Dynamic System Tuning Daemon", "DevicePolicy": "auto", "Documentation": "\"man:tuned(8)\" \"man:tuned.conf(5)\" \"man:tuned-adm(8)\"", "DynamicUser": "no", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/tuned ; argv[]=/usr/sbin/tuned -l -P ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStartEx": "{ path=/usr/sbin/tuned ; argv[]=/usr/sbin/tuned -l -P ; flags= ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FinalKillSignal": "9", "FragmentPath": "/usr/lib/systemd/system/tuned.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOReadBytes": "18446744073709551615", "IOReadOperations": "18446744073709551615", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "[not set]", "IOWriteBytes": "18446744073709551615", "IOWriteOperations": "18446744073709551615", "IPAccounting": "no", "IPEgressBytes": "[no data]", "IPEgressPackets": "[no data]", "IPIngressBytes": "[no data]", "IPIngressPackets": "[no data]", "Id": "tuned.service", "IgnoreOnIsolate": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobRunningTimeoutUSec": "infinity", "JobTimeoutAction": "none", "JobTimeoutUSec": "infinity", "KeyringMode": "private", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "infinity", "LimitASSoft": "infinity", "LimitCORE": "infinity", "LimitCORESoft": "infinity", "LimitCPU": "infinity", "LimitCPUSoft": "infinity", "LimitDATA": "infinity", "LimitDATASoft": "infinity", "LimitFSIZE": "infinity", "LimitFSIZESoft": "infinity", "LimitLOCKS": "infinity", "LimitLOCKSSoft": "infinity", "LimitMEMLOCK": "65536", "LimitMEMLOCKSoft": "65536", "LimitMSGQUEUE": "819200", "LimitMSGQUEUESoft": "819200", "LimitNICE": "0", "LimitNICESoft": "0", "LimitNOFILE": "524288", "LimitNOFILESoft": "1024", "LimitNPROC": "31650", "LimitNPROCSoft": "31650", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "31650", "LimitSIGPENDINGSoft": "31650", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "ManagedOOMMemoryPressure": "auto", "ManagedOOMMemoryPressureLimit": "0", "ManagedOOMPreference": "none", "ManagedOOMSwap": "auto", "MemoryAccounting": "yes", "MemoryAvailable": "infinity", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAPolicy": "n/a", "Names": "tuned.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMPolicy": "stop", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "OnSuccessJobMode": "fail", "PIDFile": "/run/tuned/tuned.pid", "Perpetual": "no", "PrivateDevices": "no", "PrivateIPC": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProcSubset": "all", "ProtectClock": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectHostname": "no", "ProtectKernelLogs": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectProc": "default", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "ReloadResult": "success", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "polkit.service sysinit.target dbus.socket dbus-broker.service system.slice", "Restart": "no", "RestartKillSignal": "15", "RestartUSec": "100ms", "RestrictNamespaces": "no", "RestrictRealtime": "no", "RestrictSUIDSGID": "no", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "RuntimeDirectoryPreserve": "no", "RuntimeMaxUSec": "infinity", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitIntervalUSec": "10s", "StartupBlockIOWeight": "[not set]", "StartupCPUShares": "[not set]", "StartupCPUWeight": "[not set]", "StartupIOWeight": "[not set]", "StateChangeTimestampMonotonic": "0", "StateDirectoryMode": "0755", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SuccessAction": "none", "SyslogFacility": "3", "SyslogLevel": "6", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "2147483646", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "[not set]", "TasksMax": "9495", "TimeoutAbortUSec": "1min 30s", "TimeoutCleanUSec": "infinity", "TimeoutStartFailureMode": "terminate", "TimeoutStartUSec": "1min 30s", "TimeoutStopFailureMode": "terminate", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "UtmpMode": "init", "WatchdogSignal": "6", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "infinity" } } TASK [linux-system-roles.kernel_settings : Ensure kernel settings profile directory exists] *** changed: [sut] => { "changed": true, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/tuned/kernel_settings", "secontext": "unconfined_u:object_r:tuned_etc_t:s0", "size": 4096, "state": "directory", "uid": 0 } TASK [linux-system-roles.kernel_settings : Generate a configuration for kernel settings] *** changed: [sut] => { "changed": true, "checksum": "e25dff1f7ee464fabbde746e6cf2ca10ab5675fe", "dest": "/etc/tuned/kernel_settings/tuned.conf", "gid": 0, "group": "root", "md5sum": "a56753e9d08d42b7070c4a4c60411099", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:tuned_etc_t:s0", "size": 53, "src": "/root/.ansible/tmp/ansible-tmp-1643298790.8146842-4123-22838380865921/source", "state": "file", "uid": 0 } TASK [linux-system-roles.kernel_settings : Get current config] ***************** ok: [sut] => { "changed": false, "content": "IwojIEFuc2libGUgbWFuYWdlZAojClttYWluXQpzdW1tYXJ5PWtlcm5lbCBzZXR0aW5ncwo=", "encoding": "base64", "source": "/etc/tuned/kernel_settings/tuned.conf" } TASK [linux-system-roles.kernel_settings : Apply kernel settings] ************** changed: [sut] => { "active_profile": "virtual-guest kernel_settings", "changed": true, "message": "", "new_profile": { "sysctl": { "fs.epoll.max_user_watches": "785592", "fs.file-max": "379724" }, "sysfs": { "/sys/kernel/debug/x86/ibrs_enabled": "0", "/sys/kernel/debug/x86/pti_enabled": "0", "/sys/kernel/debug/x86/retp_enabled": "0" }, "vm": { "transparent_hugepages": "madvise" } }, "reboot_required": false } MSG: Kernel settings were updated. TASK [linux-system-roles.kernel_settings : tuned apply settings] *************** changed: [sut] => { "changed": true, "cmd": [ "tuned-adm", "profile", "virtual-guest kernel_settings" ], "delta": "0:00:01.456303", "end": "2022-01-27 15:53:15.134960", "rc": 0, "start": "2022-01-27 15:53:13.678657" } TASK [linux-system-roles.kernel_settings : verify settings] ******************** included: /WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/roles/linux-system-roles.kernel_settings/tasks/verify_settings.yml for sut TASK [linux-system-roles.kernel_settings : check that settings are applied correctly] *** ok: [sut] => { "changed": false, "cmd": [ "tuned-adm", "verify", "-i" ], "delta": "0:00:00.216243", "end": "2022-01-27 15:53:15.742359", "rc": 0, "start": "2022-01-27 15:53:15.526116" } STDOUT: Verfication succeeded, current system settings match the preset profile. See TuneD log file ('/var/log/tuned/tuned.log') for details. TASK [linux-system-roles.kernel_settings : get last verify results from log] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.kernel_settings : report errors that are not bootloader errors] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.kernel_settings : notify user that reboot is needed to apply changes] *** skipping: [sut] => {} TASK [linux-system-roles.kernel_settings : set the flag that reboot is needed to apply changes] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [verify that settings were applied correctly] ***************************** included: /WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/tasks/assert_kernel_settings.yml for sut TASK [Set version specific variables] ****************************************** ok: [sut] => { "ansible_facts": { "__kernel_settings_test_python_cmd": "python", "__kernel_settings_test_python_pkgs": [ "python", "python-configobj" ] }, "ansible_included_var_files": [ "/WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/vars/tests_default.yml" ], "changed": false } TASK [reset settings success flag] ********************************************* ok: [sut] => { "ansible_facts": { "__kernel_settings_success": true }, "changed": false } TASK [check tuned-adm verify] ************************************************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [check for verify errors] ************************************************* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [check /proc/cmdline] ***************************************************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [set error flag based on verify] ****************************************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [include_tasks] *********************************************************** included: /WORKDIR/dist-git-kernel_settings-fix_ansible_managed-GuxrXP/tests/tasks/assert_kernel_settings_conf_files.yml for sut TASK [create temporary file for expected config] ******************************* changed: [sut] => { "changed": true, "gid": 0, "group": "root", "mode": "0600", "owner": "root", "path": "/tmp/ansible.9rpjtwzs.kernel_settings", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 0, "state": "file", "uid": 0 } TASK [put expected contents into temporary file] ******************************* changed: [sut] => { "changed": true, "checksum": "169e46a0442e2493edda7ef1d37dfc572d06525c", "dest": "/tmp/ansible.9rpjtwzs.kernel_settings", "gid": 0, "group": "root", "md5sum": "b82bbe3a22d81e7a442595a59b2d0944", "mode": "0600", "owner": "root", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 299, "src": "/root/.ansible/tmp/ansible-tmp-1643298796.8274791-4174-94640032924002/source", "state": "file", "uid": 0 } TASK [ensure python command exists for tests below] **************************** ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [diff expected vs actual content] ***************************************** ok: [sut] => { "changed": false, "cmd": "python -c 'import sys\nfrom configobj import ConfigObj\nc1 = ConfigObj(sys.argv[1])\nc2 = ConfigObj(sys.argv[2])\nsys.exit(not c1 == c2)' /tmp/ansible.9rpjtwzs.kernel_settings /etc/tuned/kernel_settings/tuned.conf\n", "delta": "0:00:00.062252", "end": "2022-01-27 15:53:22.189528", "rc": 0, "start": "2022-01-27 15:53:22.127276" } TASK [verify expected content] ************************************************* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [show diff - may not reflect actual ConfigObj differences] **************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [get active_profile file] ************************************************* ok: [sut] => { "changed": false, "content": "dmlydHVhbC1ndWVzdCBrZXJuZWxfc2V0dGluZ3MK", "encoding": "base64", "source": "/etc/tuned/active_profile" } TASK [check that active_profile ends with kernel_settings] ********************* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [get profile_mode file] *************************************************** ok: [sut] => { "changed": false, "content": "bWFudWFsCg==", "encoding": "base64", "source": "/etc/tuned/profile_mode" } TASK [check that profile_mode is manual] *************************************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [get the bootloader specific config file] ********************************* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [verify bootloader settings value] **************************************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [check if kernel_settings_reboot_required is set if needed] *************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [assert success] ********************************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [reboot the machine - see if settings persist after reboot] *************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [verify that settings were applied correctly after reboot] **************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [show contents of tuned.conf] ********************************************* ok: [sut] => { "changed": false, "cmd": [ "cat", "/etc/tuned/kernel_settings/tuned.conf" ], "delta": "0:00:00.004814", "end": "2022-01-27 15:53:23.625745", "rc": 0, "start": "2022-01-27 15:53:23.620931" } STDOUT: # # Ansible managed # [main] summary = kernel settings [sysctl] fs.epoll.max_user_watches = 785592 fs.file-max = 379724 [sysfs] /sys/kernel/debug/x86/pti_enabled = 0 /sys/kernel/debug/x86/retp_enabled = 0 /sys/kernel/debug/x86/ibrs_enabled = 0 [vm] transparent_hugepages = madvise RUNNING HANDLER [linux-system-roles.kernel_settings : reboot the managed host to apply kernel_settings changes] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } RUNNING HANDLER [linux-system-roles.kernel_settings : clear the kernel_settings_reboot_required flag] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } PLAY RECAP ********************************************************************* sut : ok=25 changed=8 unreachable=0 failed=0 skipped=19 rescued=0 ignored=0 ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- ---^---^---^---^---^---