# 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:36:16 +0000 (0:00:00.039) 0:00:00.039 ******* ok: [sut] TASK [linux-system-roles.certificate : Set version specific variables] ********* Thursday 18 August 2022 22:36:18 +0000 (0:00:01.191) 0:00:01.230 ******* 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:36:18 +0000 (0:00:00.095) 0:00:01.326 ******* ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** Thursday 18 August 2022 22:36:18 +0000 (0:00:00.471) 0:00:01.798 ******* 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:36:18 +0000 (0:00:00.105) 0:00:01.904 ******* 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:36:22 +0000 (0:00:03.994) 0:00:05.899 ******* 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:36:26 +0000 (0:00:04.085) 0:00:09.984 ******* 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:36:27 +0000 (0:00:00.461) 0:00:10.446 ******* 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:36:27 +0000 (0:00:00.319) 0:00:10.766 ******* 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": "dbus.service network.target sysinit.target system.slice basic.target syslog.target dbus.socket systemd-journald.socket", "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:36:29 +0000 (0:00:01.449) 0:00:12.215 ******* changed: [sut] => (item={'name': 'mycert_subject', 'dns': 'www.example.com', 'common_name': 'Some other common name', 'country': 'US', 'state': 'NC', 'locality': 'Raleigh', 'organization': 'Red Hat', 'organizational_unit': 'Linux', 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "common_name": "Some other common name", "country": "US", "dns": "www.example.com", "locality": "Raleigh", "name": "mycert_subject", "organization": "Red Hat", "organizational_unit": "Linux", "state": "NC" } } MSG: Certificate requested (new). PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:36:31 +0000 (0:00:01.910) 0:00:14.126 ******* ok: [sut] TASK [Verify each certificate] ************************************************* Thursday 18 August 2022 22:36:31 +0000 (0:00:00.713) 0:00:14.839 ******* 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_subject.crt', 'key_path': '/etc/pki/tls/private/mycert_subject.key', 'subject': [{'name': 'countryName', 'oid': '2.5.4.6', 'value': 'US'}, {'name': 'stateOrProvinceName', 'oid': '2.5.4.8', 'value': 'NC'}, {'name': 'localityName', 'oid': '2.5.4.7', 'value': 'Raleigh'}, {'name': 'organizationName', 'oid': '2.5.4.10', 'value': 'Red Hat'}, {'name': 'organizationalUnitName', 'oid': '2.5.4.11', 'value': 'Linux'}, {'name': 'commonName', 'oid': '2.5.4.3', 'value': 'Some other common name'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'www.example.com'}]}) TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:36:31 +0000 (0:00:00.058) 0:00:14.898 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:36:31 +0000 (0:00:00.043) 0:00:14.942 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:36:33 +0000 (0:00:01.712) 0:00:16.654 ******* 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:36:38 +0000 (0:00:05.089) 0:00:21.744 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:36:40 +0000 (0:00:01.694) 0:00:23.438 ******* 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:36:44 +0000 (0:00:04.103) 0:00:27.542 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660862189.8596535, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "288bcc0cda59eac6db803cecb121a98d20306106", "ctime": 1660862189.8566535, "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": 1660862189.8566535, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_subject.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1411, "uid": 0, "version": "1980272042", "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:36:44 +0000 (0:00:00.407) 0:00:27.950 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:36:44 +0000 (0:00:00.057) 0:00:28.007 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:36:45 +0000 (0:00:00.107) 0:00:28.115 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:36:45 +0000 (0:00:00.099) 0:00:28.214 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660862189.7996526, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "58bf4ba588c2cd23b6ec409a6fb9601f2019929e", "ctime": 1660862189.8566535, "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": 1660862189.8566535, "nlink": 1, "path": "/etc/pki/tls/private/mycert_subject.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "1604383456", "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:36:45 +0000 (0:00:00.290) 0:00:28.505 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:36:45 +0000 (0:00:00.049) 0:00:28.555 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:36:45 +0000 (0:00:00.104) 0:00:28.660 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_subject.crt" ], "delta": "0:00:00.323936", "end": "2022-08-18 22:36:46.274618", "rc": 0, "start": "2022-08-18 22:36:45.950682" } STDOUT: { "subject": [ { "name": "countryName", "oid": "2.5.4.6", "value": "US" }, { "name": "stateOrProvinceName", "oid": "2.5.4.8", "value": "NC" }, { "name": "localityName", "oid": "2.5.4.7", "value": "Raleigh" }, { "name": "organizationName", "oid": "2.5.4.10", "value": "Red Hat" }, { "name": "organizationalUnitName", "oid": "2.5.4.11", "value": "Linux" }, { "name": "commonName", "oid": "2.5.4.3", "value": "Some other common name" } ], "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": "95:E6:7C:17:B2:99:B7:50:EA:48:EA:A9:64:45:22:4A:23:8F:B5:CF", "critical": false }, "authorityKeyIdentifier": { "value": "42:6D:C9:95:A3:CA:19:4E:11:AF:7F:9B:A8:56:BD:7A:E7:C6:E1:62", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "66:A1:DF:BD:DA:5B:29:6A:8F:DA:61:5C:44:93:19:65:EF:0A:4A:8C:EA:F7:B5:C3:CD:2B:CF:D2:FB:70:80:57:27:2C:E2:91:F7:F9:06:34:C5:A3:F1:0D:03:C9:7C:34:97:A8:F1:FD:A4:27:13:98:73:A2:65:7B:22:51:C2:89:E1:E4:8D:6C:9B:CC:77:E8:FD:3E:0F:0A:99:9D:88:CE:BC:AF:71:95:D8:47:37:47:46:E8:9D:05:BF:8D:94:CE:BE:F1:4E:E0:57:EA:9A:EC:1C:0C:84:75:EC:43:D2:C1:B5:92:CD:AD:98:5C:5C:93:0C:C2:89:50:54:73:4C:99:CC:59:7A:90:FA:B4:0F:DC:D2:9D:41:53:27:DE:AC:17:14:E1:77:BA:2E:FD:52:C1:F8:6C:C2:9A:8D:90:D0:3C:2F:CA:F9:E3:03:E8:50:6B:1F:21:54:4A:A8:9B:B7:56:DC:69:BE:E4:D0:E3:15:06:83:FE:A4:9E:7C:A5:67:0B:0D:E5:CF:C6:21:E7:0F:33:FF:98:E3:0E:A2:EB:F7:A5:1D:1A:47:2F:F6:EE:42:EC:A6:CE:23:EB:F3:4D:53:89:B2:0B:69:9F:CA:53:6F:CB:32:6C:BC:9C:52:EC:02:10:2B:44:06:36:C1:83:A7:78:52:4A:9B:FF:39:BE:8B:A8" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:36:29", "not_valid_before": "2022-08-18 22:36:29" } } 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:36:46 +0000 (0:00:00.728) 0:00:29.389 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "42:6D:C9:95:A3:CA:19:4E:11:AF:7F:9B:A8:56:BD:7A:E7:C6:E1:62" }, "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": "95:E6:7C:17:B2:99:B7:50:EA:48:EA:A9:64:45:22:4A:23:8F:B5:CF" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "66:A1:DF:BD:DA:5B:29:6A:8F:DA:61:5C:44:93:19:65:EF:0A:4A:8C:EA:F7:B5:C3:CD:2B:CF:D2:FB:70:80:57:27:2C:E2:91:F7:F9:06:34:C5:A3:F1:0D:03:C9:7C:34:97:A8:F1:FD:A4:27:13:98:73:A2:65:7B:22:51:C2:89:E1:E4:8D:6C:9B:CC:77:E8:FD:3E:0F:0A:99:9D:88:CE:BC:AF:71:95:D8:47:37:47:46:E8:9D:05:BF:8D:94:CE:BE:F1:4E:E0:57:EA:9A:EC:1C:0C:84:75:EC:43:D2:C1:B5:92:CD:AD:98:5C:5C:93:0C:C2:89:50:54:73:4C:99:CC:59:7A:90:FA:B4:0F:DC:D2:9D:41:53:27:DE:AC:17:14:E1:77:BA:2E:FD:52:C1:F8:6C:C2:9A:8D:90:D0:3C:2F:CA:F9:E3:03:E8:50:6B:1F:21:54:4A:A8:9B:B7:56:DC:69:BE:E4:D0:E3:15:06:83:FE:A4:9E:7C:A5:67:0B:0D:E5:CF:C6:21:E7:0F:33:FF:98:E3:0E:A2:EB:F7:A5:1D:1A:47:2F:F6:EE:42:EC:A6:CE:23:EB:F3:4D:53:89:B2:0B:69:9F:CA:53:6F:CB:32:6C:BC:9C:52:EC:02:10:2B:44:06:36:C1:83:A7:78:52:4A:9B:FF:39:BE:8B:A8" }, "subject": [ { "name": "countryName", "oid": "2.5.4.6", "value": "US" }, { "name": "stateOrProvinceName", "oid": "2.5.4.8", "value": "NC" }, { "name": "localityName", "oid": "2.5.4.7", "value": "Raleigh" }, { "name": "organizationName", "oid": "2.5.4.10", "value": "Red Hat" }, { "name": "organizationalUnitName", "oid": "2.5.4.11", "value": "Linux" }, { "name": "commonName", "oid": "2.5.4.3", "value": "Some other common name" } ], "validity": { "not_valid_after": "2023-08-18 22:36:29", "not_valid_before": "2022-08-18 22:36:29" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:36:46 +0000 (0:00:00.094) 0:00:29.483 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:36:46 +0000 (0:00:00.069) 0:00:29.552 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:36:46 +0000 (0:00:00.078) 0:00:29.631 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:36:46 +0000 (0:00:00.100) 0:00:29.731 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:36:46 +0000 (0:00:00.102) 0:00:29.834 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:36:46 +0000 (0:00:00.097) 0:00:29.932 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_subject.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.061931", "end": "2022-08-18 22:36:47.161012", "rc": 0, "start": "2022-08-18 22:36:47.099081" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:36:47 +0000 (0:00:00.340) 0:00:30.272 ******* ok: [sut] => { "changed": false } MSG: All assertions passed PLAY RECAP ********************************************************************* sut : ok=32 changed=8 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 18 August 2022 22:36:47 +0000 (0:00:00.080) 0:00:30.353 ******* =============================================================================== Install the package, force upgrade -------------------------------------- 5.09s Install certreader ------------------------------------------------------ 4.10s linux-system-roles.certificate : Ensure provider packages are installed --- 4.09s linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 3.99s linux-system-roles.certificate : Ensure certificate requests ------------ 1.91s Ensure python3 is installed --------------------------------------------- 1.71s Ensure Python's cryptography is installed ------------------------------- 1.69s linux-system-roles.certificate : Ensure provider service is running ----- 1.45s Gathering Facts --------------------------------------------------------- 1.19s Parse certificate ------------------------------------------------------- 0.73s Gathering Facts --------------------------------------------------------- 0.71s linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.47s linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.46s Retrieve certificate file stats ----------------------------------------- 0.41s Retrieve auto-renew flag ------------------------------------------------ 0.34s linux-system-roles.certificate : Ensure post-scripts hooks directory exists --- 0.32s Retrieve key file stats ------------------------------------------------- 0.29s Verify certificate file owner and group --------------------------------- 0.11s linux-system-roles.certificate : Set platform/version specific variables --- 0.11s Verify key file owner and group ----------------------------------------- 0.10s ---^---^---^---^---^--- # 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. ---^---^---^---^---^---