Closed fbermel closed 3 years ago
Vagrant tests lgtm:
Initial run:
TASK [../../ansible-prometheus-kafka-adapter : Configure kafka container as systemd services] ***
included: /home/fbermel/git/ansible-prometheus-kafka-adapter/tasks/configure_systemd.yml for centos8 => (item={'name': 'metrics', 'listen_port': 8080, 'log_level': 'info', 'gin_mode': 'release', 'kafka_broker_list': 'kafka01:9093,kafka02:9093,kafka03:9093', 'kafka_topic': 'prometheus.metrics'})
included: /home/fbermel/git/ansible-prometheus-kafka-adapter/tasks/configure_systemd.yml for centos8 => (item={'name': 'othermetrics', 'listen_port': 8081, 'log_level': 'debug', 'gin_mode': 'debug', 'kafka_broker_list': 'kafka04:9093,kafka05:9093,kafka06:9093', 'kafka_topic': 'prometheus.othermetrics'})
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit file] *********
changed: [centos8] => {"changed": true, "checksum": "95780e7be16c6a3ff251009e6987fb728fb90867", "dest": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service", "gid": 0, "group": "root", "md5sum": "ac8b81f69a9812cab2f01ef40367ebdc", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 1158, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1630414374.8196983-307991-237287930498797/source", "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Create systemd config dir] ******
changed: [centos8] => {"changed": true, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/", "secontext": "unconfined_u:object_r:systemd_unit_file_t:s0", "size": 6, "state": "directory", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit environment file] ***
changed: [centos8] => {"changed": true, "checksum": "2901663a4257c6856254f3eeb897abf5fff8e0ff", "dest": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/local.conf", "gid": 0, "group": "root", "md5sum": "60408839d3fbd3808e5d366364e0981c", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 568, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1630414376.2589557-308018-277992703466522/source", "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : restart prometheus-kafka-adapter] ***
changed: [centos8] => {"changed": true, "enabled": true, "name": "prometheus-kafka-adapter-metrics", "state": "started", "status": {"ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "systemd-journald.socket docker.service network-online.target sysinit.target system.slice basic.target", "AllowIsolate": "no", "AllowedCPUs": "", "AllowedMemoryNodes": "", "AmbientCapabilities": "", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "CPUAccounting": "no", "CPUAffinity": "", "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", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "prometheus-kafka-adapter Docker Container", "DevicePolicy": "auto", "DropInPaths": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/local.conf", "DynamicUser": "no", "EffectiveCPUs": "", "EffectiveMemoryNodes": "", "Environment": "KAFKA_BROKER_LIST=kafka01:9093,kafka02:9093,kafka03:9093 KAFKA_TOPIC=prometheus.metrics KAFKA_BATCH_NUM_MESSAGES=10000 SERIALIZATION_FORMAT=json PORT=8080 LOG_LEVEL=info GIN_MODE=release KAFKA_SSL_CLIENT_CERT_FILE=/etc/prometheus-kafka-adapter/mycert.crt.pem KAFKA_SSL_CLIENT_KEY_FILE=/etc/prometheus-kafka-adapter/mykey.key.pem KAFKA_SSL_CA_CERT_FILE=/etc/prometheus-kafka-adapter/myca.crt.pem", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/bin/docker ; argv[]=/usr/bin/docker run --name metrics -p 8080:8080 -e KAFKA_BROKER_LIST=${KAFKA_BROKER_LIST} -e KAFKA_TOPIC=${KAFKA_TOPIC} -e KAFKA_BATCH_NUM_MESSAGES=${KAFKA_BATCH_NUM_MESSAGES} -e SERIALIZATION_FORMAT=${SERIALIZATION_FORMAT} -e PORT=${PORT} -e LOG_LEVEL=${LOG_LEVEL} -e KAFKA_SSL_CLIENT_CERT_FILE=${KAFKA_SSL_CLIENT_CERT_FILE} -e KAFKA_SSL_CLIENT_KEY_FILE=${KAFKA_SSL_CLIENT_KEY_FILE} -e KAFKA_SSL_CLIENT_KEY_PASS=${KAFKA_SSL_CLIENT_KEY_PASS} -e KAFKA_SSL_CA_CERT_FILE=${KAFKA_SSL_CA_CERT_FILE} -e GIN_MODE=${GIN_MODE} -v /etc/prometheus-kafka-adapter:/etc/prometheus-kafka-adapter:ro registry.hub.docker.com/telefonica/prometheus-kafka-adapter:1.6.0 ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStartPre": "{ path=/usr/bin/docker ; argv[]=/usr/bin/docker pull registry.hub.docker.com/telefonica/prometheus-kafka-adapter:1.6.0 ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "[not set]", "IPAccounting": "no", "IPEgressBytes": "18446744073709551615", "IPEgressPackets": "18446744073709551615", "IPIngressBytes": "18446744073709551615", "IPIngressPackets": "18446744073709551615", "Id": "prometheus-kafka-adapter-metrics.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": "262144", "LimitNOFILESoft": "1024", "LimitNPROC": "1715", "LimitNPROCSoft": "1715", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "1715", "LimitSIGPENDINGSoft": "1715", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "MemoryAccounting": "yes", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "MountFlags": "", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAMask": "", "NUMAPolicy": "n/a", "Names": "prometheus-kafka-adapter-metrics.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "Perpetual": "no", "PrivateDevices": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "system.slice sysinit.target docker.service", "Restart": "no", "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", "StandardInputData": "", "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": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "[not set]", "TasksMax": "2744", "TimeoutStartUSec": "infinity", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "UtmpMode": "init", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit file] *********
changed: [centos8] => {"changed": true, "checksum": "d91ba6081ac67bf073daf7661e81c8800e7a5561", "dest": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service", "gid": 0, "group": "root", "md5sum": "32e79951ecda51c862492fc355a696fe", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 1173, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1630414379.6505659-308043-204477437659166/source", "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Create systemd config dir] ******
changed: [centos8] => {"changed": true, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/", "secontext": "unconfined_u:object_r:systemd_unit_file_t:s0", "size": 6, "state": "directory", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit environment file] ***
changed: [centos8] => {"changed": true, "checksum": "f27c0c95add455c6079b6a3d7799c9839d6f46e6", "dest": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/local.conf", "gid": 0, "group": "root", "md5sum": "dfe84841e18f3e251964941634c126b0", "mode": "0644", "owner": "root", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 572, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1630414381.3522027-308069-221344410484618/source", "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : restart prometheus-kafka-adapter] ***
changed: [centos8] => {"changed": true, "enabled": true, "name": "prometheus-kafka-adapter-othermetrics", "state": "started", "status": {"ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "docker.service systemd-journald.socket system.slice basic.target network-online.target sysinit.target", "AllowIsolate": "no", "AllowedCPUs": "", "AllowedMemoryNodes": "", "AmbientCapabilities": "", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "CPUAccounting": "no", "CPUAffinity": "", "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", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "prometheus-kafka-adapter Docker Container", "DevicePolicy": "auto", "DropInPaths": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/local.conf", "DynamicUser": "no", "EffectiveCPUs": "", "EffectiveMemoryNodes": "", "Environment": "KAFKA_BROKER_LIST=kafka04:9093,kafka05:9093,kafka06:9093 KAFKA_TOPIC=prometheus.othermetrics KAFKA_BATCH_NUM_MESSAGES=10000 SERIALIZATION_FORMAT=json PORT=8080 LOG_LEVEL=debug GIN_MODE=debug KAFKA_SSL_CLIENT_CERT_FILE=/etc/prometheus-kafka-adapter/mycert.crt.pem KAFKA_SSL_CLIENT_KEY_FILE=/etc/prometheus-kafka-adapter/mykey.key.pem KAFKA_SSL_CA_CERT_FILE=/etc/prometheus-kafka-adapter/myca.crt.pem", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/bin/docker ; argv[]=/usr/bin/docker run --name othermetrics -p 8081:8080 -e KAFKA_BROKER_LIST=${KAFKA_BROKER_LIST} -e KAFKA_TOPIC=${KAFKA_TOPIC} -e KAFKA_BATCH_NUM_MESSAGES=${KAFKA_BATCH_NUM_MESSAGES} -e SERIALIZATION_FORMAT=${SERIALIZATION_FORMAT} -e PORT=${PORT} -e LOG_LEVEL=${LOG_LEVEL} -e KAFKA_SSL_CLIENT_CERT_FILE=${KAFKA_SSL_CLIENT_CERT_FILE} -e KAFKA_SSL_CLIENT_KEY_FILE=${KAFKA_SSL_CLIENT_KEY_FILE} -e KAFKA_SSL_CLIENT_KEY_PASS=${KAFKA_SSL_CLIENT_KEY_PASS} -e KAFKA_SSL_CA_CERT_FILE=${KAFKA_SSL_CA_CERT_FILE} -e GIN_MODE=${GIN_MODE} -v /etc/prometheus-kafka-adapter:/etc/prometheus-kafka-adapter:ro registry.hub.docker.com/telefonica/prometheus-kafka-adapter:1.6.0 ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStartPre": "{ path=/usr/bin/docker ; argv[]=/usr/bin/docker pull registry.hub.docker.com/telefonica/prometheus-kafka-adapter:1.6.0 ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "[not set]", "IPAccounting": "no", "IPEgressBytes": "18446744073709551615", "IPEgressPackets": "18446744073709551615", "IPIngressBytes": "18446744073709551615", "IPIngressPackets": "18446744073709551615", "Id": "prometheus-kafka-adapter-othermetrics.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": "262144", "LimitNOFILESoft": "1024", "LimitNPROC": "1715", "LimitNPROCSoft": "1715", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "1715", "LimitSIGPENDINGSoft": "1715", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "MemoryAccounting": "yes", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "MountFlags": "", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAMask": "", "NUMAPolicy": "n/a", "Names": "prometheus-kafka-adapter-othermetrics.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "Perpetual": "no", "PrivateDevices": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "docker.service system.slice sysinit.target", "Restart": "no", "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", "StandardInputData": "", "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": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "[not set]", "TasksMax": "2744", "TimeoutStartUSec": "infinity", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "UtmpMode": "init", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}}
TASK [../../ansible-prometheus-kafka-adapter : Create general config dir] ******
changed: [centos8] => {"changed": true, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/prometheus-kafka-adapter", "secontext": "system_u:object_r:etc_t:s0", "size": 6, "state": "directory", "uid": 0}
PLAY RECAP *********************************************************************
centos8 : ok=30 changed=23 unreachable=0 failed=0 skipped=7 rescued=0 ignored=0
Second run:
TASK [../../ansible-prometheus-kafka-adapter : Configure kafka container as systemd services] ***
included: /home/fbermel/git/ansible-prometheus-kafka-adapter/tasks/configure_systemd.yml for centos8 => (item={'name': 'metrics', 'listen_port': 8080, 'log_level': 'info', 'gin_mode': 'release', 'kafka_broker_list': 'kafka01:9093,kafka02:9093,kafka03:9093', 'kafka_topic': 'prometheus.metrics'})
included: /home/fbermel/git/ansible-prometheus-kafka-adapter/tasks/configure_systemd.yml for centos8 => (item={'name': 'othermetrics', 'listen_port': 8081, 'log_level': 'debug', 'gin_mode': 'debug', 'kafka_broker_list': 'kafka04:9093,kafka05:9093,kafka06:9093', 'kafka_topic': 'prometheus.othermetrics'})
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit file] *********
ok: [centos8] => {"changed": false, "checksum": "95780e7be16c6a3ff251009e6987fb728fb90867", "dest": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 1158, "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Create systemd config dir] ******
ok: [centos8] => {"changed": false, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/", "secontext": "unconfined_u:object_r:systemd_unit_file_t:s0", "size": 24, "state": "directory", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit environment file] ***
ok: [centos8] => {"changed": false, "checksum": "2901663a4257c6856254f3eeb897abf5fff8e0ff", "dest": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/local.conf", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-metrics.service.d/local.conf", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 568, "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : restart prometheus-kafka-adapter] ***
skipping: [centos8] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit file] *********
ok: [centos8] => {"changed": false, "checksum": "d91ba6081ac67bf073daf7661e81c8800e7a5561", "dest": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 1173, "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Create systemd config dir] ******
ok: [centos8] => {"changed": false, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/", "secontext": "unconfined_u:object_r:systemd_unit_file_t:s0", "size": 24, "state": "directory", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : Copy systemd unit environment file] ***
ok: [centos8] => {"changed": false, "checksum": "f27c0c95add455c6079b6a3d7799c9839d6f46e6", "dest": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/local.conf", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/systemd/system/prometheus-kafka-adapter-othermetrics.service.d/local.conf", "secontext": "system_u:object_r:systemd_unit_file_t:s0", "size": 572, "state": "file", "uid": 0}
TASK [../../ansible-prometheus-kafka-adapter : restart prometheus-kafka-adapter] ***
skipping: [centos8] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [../../ansible-prometheus-kafka-adapter : Create general config dir] ******
ok: [centos8] => {"changed": false, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/prometheus-kafka-adapter", "secontext": "system_u:object_r:etc_t:s0", "size": 6, "state": "directory", "uid": 0}
PLAY RECAP *********************************************************************
centos8 : ok=26 changed=1 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
This removes unnecessary tasks from the block inside configure_systemd.yml. The change also makes it so that the systemd daemon is only reloaded and the systemd unit only restarted when there have been actual changes to the configuration.