# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [Issue simple self-signed certificate] ************************************ TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:19:04 +0000 (0:00:00.020) 0:00:00.020 ******* ok: [sut] TASK [linux-system-roles.certificate : Set version specific variables] ********* Thursday 18 August 2022 22:19:05 +0000 (0:00:01.289) 0:00:01.310 ******* included: /WORKDIR/dist-git-certificate-use_distro_python_cryptography-ir2vbc/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml for sut TASK [linux-system-roles.certificate : Ensure ansible_facts used by role] ****** Thursday 18 August 2022 22:19:05 +0000 (0:00:00.039) 0:00:01.349 ******* ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** Thursday 18 August 2022 22:19:06 +0000 (0:00:00.450) 0:00:01.800 ******* skipping: [sut] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=RedHat_8.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=RedHat_8.7.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.7.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.certificate : Ensure certificate role dependencies are installed] *** Thursday 18 August 2022 22:19:06 +0000 (0:00:00.060) 0:00:01.860 ******* changed: [sut] => { "changed": true, "rc": 0, "results": [ "Installed: python3-pyasn1-0.3.7-6.el8.noarch" ] } TASK [linux-system-roles.certificate : Ensure provider packages are installed] *** Thursday 18 August 2022 22:19:09 +0000 (0:00:03.620) 0:00:05.480 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "rc": 0, "results": [ "Installed: xmlrpc-c-1.51.0-8.el8.x86_64", "Installed: xmlrpc-c-client-1.51.0-8.el8.x86_64", "Installed: certmonger-0.79.13-5.el8.x86_64" ] } TASK [linux-system-roles.certificate : Ensure pre-scripts hooks directory exists] *** Thursday 18 August 2022 22:19:14 +0000 (0:00:04.142) 0:00:09.623 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/etc/certmonger//pre-scripts", "secontext": "unconfined_u:object_r:etc_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [linux-system-roles.certificate : Ensure post-scripts hooks directory exists] *** Thursday 18 August 2022 22:19:14 +0000 (0:00:00.454) 0:00:10.077 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/etc/certmonger//post-scripts", "secontext": "unconfined_u:object_r:etc_t:s0", "size": 6, "state": "directory", "uid": 0 } TASK [linux-system-roles.certificate : Ensure provider service is running] ***** Thursday 18 August 2022 22:19:14 +0000 (0:00:00.294) 0:00:10.372 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "enabled": true, "name": "certmonger", "state": "started", "status": { "ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "syslog.target network.target systemd-journald.socket dbus.service dbus.socket system.slice sysinit.target basic.target", "AllowIsolate": "no", "AllowedCPUs": "", "AllowedMemoryNodes": "", "AmbientCapabilities": "", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "BusName": "org.fedorahosted.certmonger", "CPUAccounting": "no", "CPUAffinity": "", "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", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "Certificate monitoring and PKI enrollment", "DevicePolicy": "auto", "DynamicUser": "no", "EffectiveCPUs": "", "EffectiveMemoryNodes": "", "EnvironmentFiles": "/etc/sysconfig/certmonger (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/certmonger ; argv[]=/usr/sbin/certmonger -S -p /run/certmonger.pid -n $OPTS ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/usr/lib/systemd/system/certmonger.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": "certmonger.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": "0", "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": "14143", "LimitNPROCSoft": "14143", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "14143", "LimitSIGPENDINGSoft": "14143", "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": "certmonger.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PIDFile": "/run/certmonger.pid", "PartOf": "dbus.service", "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": "dbus.socket 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": "22628", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "UtmpMode": "init", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0" } } TASK [linux-system-roles.certificate : Ensure certificate requests] ************ Thursday 18 August 2022 22:19:16 +0000 (0:00:01.211) 0:00:11.583 ******* changed: [sut] => (item={'name': 'mycert_no_auto_renew', 'dns': 'www.example.com', 'ca': 'self-sign', 'auto_renew': False}) => { "ansible_loop_var": "item", "changed": true, "item": { "auto_renew": false, "ca": "self-sign", "dns": "www.example.com", "name": "mycert_no_auto_renew" } } MSG: Certificate requested (new). changed: [sut] => (item={'name': 'defaultcert', 'dns': 'www.example.com', 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "name": "defaultcert" } } MSG: Certificate requested (new). PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:19:17 +0000 (0:00:01.569) 0:00:13.152 ******* ok: [sut] TASK [Verify each certificate] ************************************************* Thursday 18 August 2022 22:19:18 +0000 (0:00:00.755) 0:00:13.907 ******* included: /WORKDIR/dist-git-certificate-use_distro_python_cryptography-ir2vbc/tests/tasks/assert_certificate_parameters.yml for sut => (item={'path': '/etc/pki/tls/certs/mycert_no_auto_renew.crt', 'key_path': '/etc/pki/tls/private/mycert_no_auto_renew.key', 'subject': [{'name': 'commonName', 'oid': '2.5.4.3', 'value': 'www.example.com'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'www.example.com'}], 'auto_renew': False}) included: /WORKDIR/dist-git-certificate-use_distro_python_cryptography-ir2vbc/tests/tasks/assert_certificate_parameters.yml for sut => (item={'path': '/etc/pki/tls/certs/defaultcert.crt', 'key_path': '/etc/pki/tls/private/defaultcert.key', 'subject': [{'name': 'commonName', 'oid': '2.5.4.3', 'value': 'www.example.com'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'www.example.com'}], 'auto_renew': True}) TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:19:18 +0000 (0:00:00.071) 0:00:13.978 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:19:18 +0000 (0:00:00.075) 0:00:14.054 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:19:20 +0000 (0:00:01.776) 0:00:15.830 ******* changed: [sut] => { "changed": true, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "-U", "pip" ], "name": [ "pip" ], "requirements": null, "state": "latest", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Collecting pip Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB) Installing collected packages: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Successfully uninstalled pip-9.0.3 Successfully installed pip-21.3.1 STDERR: You are using pip version 21.3.1, however version 22.2.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. TASK [Ensure Python's cryptography is installed] ******************************* Thursday 18 August 2022 22:19:25 +0000 (0:00:05.236) 0:00:21.067 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:19:27 +0000 (0:00:01.759) 0:00:22.826 ******* changed: [sut] => { "changed": true, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "certreader>=0.1.1" ], "name": [ "certreader>=0.1.1" ], "requirements": null, "state": "present", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Collecting certreader>=0.1.1 Downloading certreader-0.1.1.tar.gz (4.4 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting cryptography Downloading cryptography-37.0.4-cp36-abi3-manylinux_2_24_x86_64.whl (4.1 MB) Collecting pyasn1 Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) Collecting pyyaml Downloading PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (603 kB) Collecting cffi>=1.12 Downloading cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (402 kB) Collecting pycparser Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB) Using legacy 'setup.py install' for certreader, since package 'wheel' is not installed. Installing collected packages: pycparser, cffi, pyyaml, pyasn1, cryptography, certreader Running setup.py install for certreader: started Running setup.py install for certreader: finished with status 'done' Successfully installed certreader-0.1.1 cffi-1.15.1 cryptography-37.0.4 pyasn1-0.4.8 pycparser-2.21 pyyaml-6.0 TASK [Retrieve certificate file stats] ***************************************** Thursday 18 August 2022 22:19:31 +0000 (0:00:04.358) 0:00:27.184 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861156.7384326, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "a391081059d4ecd0d7691f91e067015330f42c2d", "ctime": 1660861156.7354326, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 8389975, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861156.7354326, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_no_auto_renew.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "4101729034", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** Thursday 18 August 2022 22:19:32 +0000 (0:00:00.423) 0:00:27.608 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:19:32 +0000 (0:00:00.048) 0:00:27.656 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:19:32 +0000 (0:00:00.095) 0:00:27.751 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:19:32 +0000 (0:00:00.093) 0:00:27.845 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861156.6744308, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "0b493f661f564228fda4ba8530926d6d271beaf1", "ctime": 1660861156.7354326, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 16799760, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861156.7354326, "nlink": 1, "path": "/etc/pki/tls/private/mycert_no_auto_renew.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "3554655227", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** Thursday 18 August 2022 22:19:32 +0000 (0:00:00.346) 0:00:28.192 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:19:32 +0000 (0:00:00.075) 0:00:28.267 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:19:32 +0000 (0:00:00.097) 0:00:28.365 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_no_auto_renew.crt" ], "delta": "0:00:00.345431", "end": "2022-08-18 22:19:33.558345", "rc": 0, "start": "2022-08-18 22:19:33.212914" } STDOUT: { "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "extensions": { "keyUsage": { "value": [ "digital_signature", "key_encipherment" ], "critical": false }, "subjectAltName": { "value": [ { "name": "DNS", "value": "www.example.com" } ], "critical": false }, "extendedKeyUsage": { "value": [ { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" } ], "critical": false }, "basicConstraints": { "value": { "ca": false }, "critical": true }, "subjectKeyIdentifier": { "value": "18:57:5E:CE:C1:EE:EE:31:B3:0A:D7:5D:F7:C5:CA:21:2E:6F:33:4C", "critical": false }, "authorityKeyIdentifier": { "value": "81:33:8D:EC:01:32:5F:3E:DC:8D:28:A7:4B:3A:02:95:65:EC:D6:3B", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "99:A9:39:40:8E:44:A1:AA:81:0E:41:64:0B:38:28:29:A6:44:F0:1A:52:7A:CC:95:BC:48:AA:53:D4:06:89:9B:26:57:24:A5:2E:59:7C:7C:78:CB:D0:63:1F:75:95:7F:7D:13:1F:CA:72:0E:86:CE:D9:3D:08:35:C9:58:DB:41:99:D9:50:76:23:F5:BC:18:D4:0A:0E:B7:2F:8E:CB:8B:97:A4:16:71:74:D0:B9:64:18:8B:EC:D1:B5:58:ED:3E:0A:26:19:AD:55:C3:39:72:01:6F:74:D9:BF:6F:A0:41:5E:2A:BB:DC:6A:C6:71:06:42:7F:67:90:10:3A:9E:0E:87:62:A0:04:F1:46:51:06:3E:BE:49:F8:2B:F7:2B:BB:0B:3E:E5:C8:E4:FD:65:36:B1:2C:DD:B9:C9:43:47:5C:CD:C7:75:AD:C8:FC:C1:8E:97:8E:FD:74:5C:9C:DA:C5:67:5E:20:36:71:95:76:D1:4E:A3:B4:46:9B:FF:F3:CF:6D:91:18:34:27:18:92:CE:1B:71:A6:FB:18:70:8F:25:63:D1:4D:9F:15:08:6B:4D:70:0D:00:75:5F:7B:BA:8B:2C:8B:11:EE:F7:7F:5B:74:99:9C:AA:52:AF:6A:B3:5D:DB:39:23:12:33:63:DD:7E:8E:C5:A8:D6:7E:B5:51:D8" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:19:16", "not_valid_before": "2022-08-18 22:19:16" } } STDERR: /tmp/certificate-tests-venv/lib64/python3.6/site-packages/certreader/parse.py:1: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release. from cryptography import x509 TASK [Load certificate YAML to cert_issued variable] *************************** Thursday 18 August 2022 22:19:33 +0000 (0:00:00.751) 0:00:29.117 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "81:33:8D:EC:01:32:5F:3E:DC:8D:28:A7:4B:3A:02:95:65:EC:D6:3B" }, "basicConstraints": { "critical": true, "value": { "ca": false } }, "extendedKeyUsage": { "critical": false, "value": [ { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" } ] }, "keyUsage": { "critical": false, "value": [ "digital_signature", "key_encipherment" ] }, "subjectAltName": { "critical": false, "value": [ { "name": "DNS", "value": "www.example.com" } ] }, "subjectKeyIdentifier": { "critical": false, "value": "18:57:5E:CE:C1:EE:EE:31:B3:0A:D7:5D:F7:C5:CA:21:2E:6F:33:4C" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "99:A9:39:40:8E:44:A1:AA:81:0E:41:64:0B:38:28:29:A6:44:F0:1A:52:7A:CC:95:BC:48:AA:53:D4:06:89:9B:26:57:24:A5:2E:59:7C:7C:78:CB:D0:63:1F:75:95:7F:7D:13:1F:CA:72:0E:86:CE:D9:3D:08:35:C9:58:DB:41:99:D9:50:76:23:F5:BC:18:D4:0A:0E:B7:2F:8E:CB:8B:97:A4:16:71:74:D0:B9:64:18:8B:EC:D1:B5:58:ED:3E:0A:26:19:AD:55:C3:39:72:01:6F:74:D9:BF:6F:A0:41:5E:2A:BB:DC:6A:C6:71:06:42:7F:67:90:10:3A:9E:0E:87:62:A0:04:F1:46:51:06:3E:BE:49:F8:2B:F7:2B:BB:0B:3E:E5:C8:E4:FD:65:36:B1:2C:DD:B9:C9:43:47:5C:CD:C7:75:AD:C8:FC:C1:8E:97:8E:FD:74:5C:9C:DA:C5:67:5E:20:36:71:95:76:D1:4E:A3:B4:46:9B:FF:F3:CF:6D:91:18:34:27:18:92:CE:1B:71:A6:FB:18:70:8F:25:63:D1:4D:9F:15:08:6B:4D:70:0D:00:75:5F:7B:BA:8B:2C:8B:11:EE:F7:7F:5B:74:99:9C:AA:52:AF:6A:B3:5D:DB:39:23:12:33:63:DD:7E:8E:C5:A8:D6:7E:B5:51:D8" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-08-18 22:19:16", "not_valid_before": "2022-08-18 22:19:16" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:19:33 +0000 (0:00:00.094) 0:00:29.211 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:19:33 +0000 (0:00:00.095) 0:00:29.306 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:19:33 +0000 (0:00:00.078) 0:00:29.384 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:19:33 +0000 (0:00:00.065) 0:00:29.449 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:19:34 +0000 (0:00:00.091) 0:00:29.541 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:19:34 +0000 (0:00:00.094) 0:00:29.636 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_no_auto_renew.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.069429", "end": "2022-08-18 22:19:34.439717", "rc": 0, "start": "2022-08-18 22:19:34.370288" } STDOUT: no TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:19:34 +0000 (0:00:00.360) 0:00:29.997 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:19:34 +0000 (0:00:00.097) 0:00:30.094 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:19:34 +0000 (0:00:00.075) 0:00:30.169 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:19:36 +0000 (0:00:01.783) 0:00:31.953 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "-U", "pip" ], "name": [ "pip" ], "requirements": null, "state": "latest", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Requirement already satisfied: pip in ./certificate-tests-venv/lib/python3.6/site-packages (21.3.1) TASK [Ensure Python's cryptography is installed] ******************************* Thursday 18 August 2022 22:19:37 +0000 (0:00:01.152) 0:00:33.106 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:19:39 +0000 (0:00:01.757) 0:00:34.864 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "certreader>=0.1.1" ], "name": [ "certreader>=0.1.1" ], "requirements": null, "state": "present", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Requirement already satisfied: certreader>=0.1.1 in ./certificate-tests-venv/lib/python3.6/site-packages (0.1.1) Requirement already satisfied: cryptography in ./certificate-tests-venv/lib/python3.6/site-packages (from certreader>=0.1.1) (37.0.4) Requirement already satisfied: pyasn1 in ./certificate-tests-venv/lib/python3.6/site-packages (from certreader>=0.1.1) (0.4.8) Requirement already satisfied: pyyaml in ./certificate-tests-venv/lib/python3.6/site-packages (from certreader>=0.1.1) (6.0) Requirement already satisfied: cffi>=1.12 in ./certificate-tests-venv/lib/python3.6/site-packages (from cryptography->certreader>=0.1.1) (1.15.1) Requirement already satisfied: pycparser in ./certificate-tests-venv/lib/python3.6/site-packages (from cffi>=1.12->cryptography->certreader>=0.1.1) (2.21) TASK [Retrieve certificate file stats] ***************************************** Thursday 18 August 2022 22:19:40 +0000 (0:00:00.959) 0:00:35.823 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861157.4304514, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "58273783837c7f027bbce0ada76ae3f44d0c74a6", "ctime": 1660861157.4274514, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 8389976, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861157.4274514, "nlink": 1, "path": "/etc/pki/tls/certs/defaultcert.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "1729606899", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** Thursday 18 August 2022 22:19:40 +0000 (0:00:00.269) 0:00:36.092 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:19:40 +0000 (0:00:00.049) 0:00:36.142 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:19:40 +0000 (0:00:00.070) 0:00:36.213 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:19:40 +0000 (0:00:00.066) 0:00:36.279 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861157.3704498, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "a02d598179d74c33ffe670ff91b852e29d83f05c", "ctime": 1660861157.4274514, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 16799762, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861157.4274514, "nlink": 1, "path": "/etc/pki/tls/private/defaultcert.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1708, "uid": 0, "version": "17056115", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.269) 0:00:36.548 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.048) 0:00:36.597 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:19:41 +0000 (0:00:00.073) 0:00:36.671 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/defaultcert.crt" ], "delta": "0:00:00.338178", "end": "2022-08-18 22:19:41.703958", "rc": 0, "start": "2022-08-18 22:19:41.365780" } STDOUT: { "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "extensions": { "keyUsage": { "value": [ "digital_signature", "key_encipherment" ], "critical": false }, "subjectAltName": { "value": [ { "name": "DNS", "value": "www.example.com" } ], "critical": false }, "extendedKeyUsage": { "value": [ { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" } ], "critical": false }, "basicConstraints": { "value": { "ca": false }, "critical": true }, "subjectKeyIdentifier": { "value": "4E:9C:9D:E7:3F:E8:28:08:44:65:DA:43:75:43:58:BB:26:11:96:F1", "critical": false }, "authorityKeyIdentifier": { "value": "81:33:8D:EC:01:32:5F:3E:DC:8D:28:A7:4B:3A:02:95:65:EC:D6:3B", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "06:85:90:9D:EC:49:AA:26:3B:97:79:A2:F5:77:C1:90:DE:A6:45:BB:50:EC:D8:0A:0A:62:AE:B4:89:52:81:FB:E9:96:F8:4F:6A:05:EE:32:77:8C:A2:89:20:40:19:69:29:0E:29:C2:0C:78:93:B7:E0:CC:77:D0:78:46:93:19:1F:A1:05:F5:AE:69:67:7E:93:1F:05:FA:60:53:6E:B9:4C:5E:E9:12:C0:41:CA:4D:89:15:8E:8C:D2:1A:CB:2B:AE:82:BE:E4:F8:08:FC:E7:57:C3:A8:2E:79:DA:B9:0F:37:06:06:53:36:96:2C:BB:82:49:28:A0:86:A2:62:01:30:CD:E9:20:AC:78:B7:1F:41:F6:DA:CF:81:DB:10:1F:A4:42:7E:04:7E:93:A4:DF:F0:0A:6D:AA:52:D0:B0:6B:9F:51:45:8E:6C:FC:21:9D:83:B7:41:3C:F1:53:D1:C8:9B:4B:99:26:4A:0D:E1:BC:31:C9:54:8C:9D:E0:F3:AB:D7:71:7F:48:57:BB:F9:B2:C7:B8:F9:9C:11:29:CA:41:EA:20:CD:E5:8B:7D:A4:80:81:2B:12:01:DA:65:A9:B3:1D:E0:E1:91:F1:45:11:0C:FB:5A:E0:AA:03:3C:C0:77:27:F1:14:2D:14:49:6E:24:FF:69:5D:C0:5D:05:14:FF" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:19:16", "not_valid_before": "2022-08-18 22:19:17" } } STDERR: /tmp/certificate-tests-venv/lib64/python3.6/site-packages/certreader/parse.py:1: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release. from cryptography import x509 TASK [Load certificate YAML to cert_issued variable] *************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.591) 0:00:37.263 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "81:33:8D:EC:01:32:5F:3E:DC:8D:28:A7:4B:3A:02:95:65:EC:D6:3B" }, "basicConstraints": { "critical": true, "value": { "ca": false } }, "extendedKeyUsage": { "critical": false, "value": [ { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" } ] }, "keyUsage": { "critical": false, "value": [ "digital_signature", "key_encipherment" ] }, "subjectAltName": { "critical": false, "value": [ { "name": "DNS", "value": "www.example.com" } ] }, "subjectKeyIdentifier": { "critical": false, "value": "4E:9C:9D:E7:3F:E8:28:08:44:65:DA:43:75:43:58:BB:26:11:96:F1" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "06:85:90:9D:EC:49:AA:26:3B:97:79:A2:F5:77:C1:90:DE:A6:45:BB:50:EC:D8:0A:0A:62:AE:B4:89:52:81:FB:E9:96:F8:4F:6A:05:EE:32:77:8C:A2:89:20:40:19:69:29:0E:29:C2:0C:78:93:B7:E0:CC:77:D0:78:46:93:19:1F:A1:05:F5:AE:69:67:7E:93:1F:05:FA:60:53:6E:B9:4C:5E:E9:12:C0:41:CA:4D:89:15:8E:8C:D2:1A:CB:2B:AE:82:BE:E4:F8:08:FC:E7:57:C3:A8:2E:79:DA:B9:0F:37:06:06:53:36:96:2C:BB:82:49:28:A0:86:A2:62:01:30:CD:E9:20:AC:78:B7:1F:41:F6:DA:CF:81:DB:10:1F:A4:42:7E:04:7E:93:A4:DF:F0:0A:6D:AA:52:D0:B0:6B:9F:51:45:8E:6C:FC:21:9D:83:B7:41:3C:F1:53:D1:C8:9B:4B:99:26:4A:0D:E1:BC:31:C9:54:8C:9D:E0:F3:AB:D7:71:7F:48:57:BB:F9:B2:C7:B8:F9:9C:11:29:CA:41:EA:20:CD:E5:8B:7D:A4:80:81:2B:12:01:DA:65:A9:B3:1D:E0:E1:91:F1:45:11:0C:FB:5A:E0:AA:03:3C:C0:77:27:F1:14:2D:14:49:6E:24:FF:69:5D:C0:5D:05:14:FF" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-08-18 22:19:16", "not_valid_before": "2022-08-18 22:19:17" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.071) 0:00:37.334 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.069) 0:00:37.404 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:19:41 +0000 (0:00:00.049) 0:00:37.453 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:19:41 +0000 (0:00:00.067) 0:00:37.520 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:19:42 +0000 (0:00:00.070) 0:00:37.591 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:19:42 +0000 (0:00:00.068) 0:00:37.659 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/defaultcert.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.069038", "end": "2022-08-18 22:19:42.424713", "rc": 0, "start": "2022-08-18 22:19:42.355675" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:19:42 +0000 (0:00:00.323) 0:00:37.982 ******* ok: [sut] => { "changed": false } MSG: All assertions passed PLAY RECAP ********************************************************************* sut : ok=54 changed=8 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 18 August 2022 22:19:42 +0000 (0:00:00.079) 0:00:38.062 ******* =============================================================================== Install the package, force upgrade -------------------------------------- 5.24s Install certreader ------------------------------------------------------ 4.36s linux-system-roles.certificate : Ensure provider packages are installed --- 4.14s linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 3.62s Ensure python3 is installed --------------------------------------------- 1.78s Ensure python3 is installed --------------------------------------------- 1.78s Ensure Python's cryptography is installed ------------------------------- 1.76s Ensure Python's cryptography is installed ------------------------------- 1.76s linux-system-roles.certificate : Ensure certificate requests ------------ 1.57s Gathering Facts --------------------------------------------------------- 1.29s linux-system-roles.certificate : Ensure provider service is running ----- 1.21s Install the package, force upgrade -------------------------------------- 1.15s Install certreader ------------------------------------------------------ 0.96s Gathering Facts --------------------------------------------------------- 0.76s Parse certificate ------------------------------------------------------- 0.75s Parse certificate ------------------------------------------------------- 0.59s linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.45s linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.45s Retrieve certificate file stats ----------------------------------------- 0.42s Retrieve auto-renew flag ------------------------------------------------ 0.36s ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- [DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callbacks_enabled instead. This feature will be removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ---^---^---^---^---^---