# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [Issue certificate with dns, ip and email in SAN] ************************* TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:01:07 +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:01:09 +0000 (0:00:01.101) 0:00:01.121 ******* 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:01:09 +0000 (0:00:00.038) 0:00:01.159 ******* ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** Thursday 18 August 2022 22:01:09 +0000 (0:00:00.440) 0:00:01.600 ******* 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:01:09 +0000 (0:00:00.060) 0:00:01.661 ******* 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:01:13 +0000 (0:00:04.205) 0:00:05.866 ******* 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:01:18 +0000 (0:00:04.207) 0:00:10.074 ******* 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:01:18 +0000 (0:00:00.455) 0:00:10.529 ******* 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:01:18 +0000 (0:00:00.295) 0:00:10.824 ******* 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 systemd-journald.socket system.slice basic.target dbus.socket sysinit.target network.target dbus.service", "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": "sysinit.target dbus.socket system.slice", "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:01:20 +0000 (0:00:01.456) 0:00:12.281 ******* changed: [sut] => (item={'name': 'mycert_dns_ip_email', 'common_name': 'My Certificate with SAN', 'dns': ['sub1.example.com', 'www.example.com', 'sub2.example.com', 'sub3.example.com'], 'ip': ['192.0.2.12', '198.51.100.65', '2001:db8::2:1'], 'email': ['sysadmin@example.com', 'support@example.com'], 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "common_name": "My Certificate with SAN", "dns": [ "sub1.example.com", "www.example.com", "sub2.example.com", "sub3.example.com" ], "email": [ "sysadmin@example.com", "support@example.com" ], "ip": [ "192.0.2.12", "198.51.100.65", "2001:db8::2:1" ], "name": "mycert_dns_ip_email" } } MSG: Certificate requested (new). PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:01:21 +0000 (0:00:01.105) 0:00:13.386 ******* ok: [sut] TASK [Verify each certificate] ************************************************* Thursday 18 August 2022 22:01:22 +0000 (0:00:00.727) 0:00:14.114 ******* 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_dns_ip_email.crt', 'key_path': '/etc/pki/tls/private/mycert_dns_ip_email.key', 'subject': [{'name': 'commonName', 'oid': '2.5.4.3', 'value': 'My Certificate with SAN'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'sub1.example.com'}, {'name': 'DNS', 'value': 'www.example.com'}, {'name': 'DNS', 'value': 'sub2.example.com'}, {'name': 'DNS', 'value': 'sub3.example.com'}, {'name': 'email', 'value': 'sysadmin@example.com'}, {'name': 'email', 'value': 'support@example.com'}, {'name': 'IP Address', 'value': '192.0.2.12'}, {'name': 'IP Address', 'value': '198.51.100.65'}, {'name': 'IP Address', 'value': '2001:db8::2:1'}]}) TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:01:22 +0000 (0:00:00.054) 0:00:14.168 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:01:22 +0000 (0:00:00.038) 0:00:14.207 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:01:23 +0000 (0:00:01.722) 0:00:15.929 ******* 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:01:29 +0000 (0:00:05.125) 0:00:21.055 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:01:30 +0000 (0:00:01.722) 0:00:22.777 ******* 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:01:35 +0000 (0:00:04.291) 0:00:27.069 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660860081.2054987, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "7ee6a56d607b4bdeacd569c48db8ad91804e7067", "ctime": 1660860081.2024987, "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": 1660860081.2024987, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_dns_ip_email.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1484, "uid": 0, "version": "3089887970", "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:01:35 +0000 (0:00:00.428) 0:00:27.498 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:01:35 +0000 (0:00:00.082) 0:00:27.580 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:01:35 +0000 (0:00:00.070) 0:00:27.651 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:01:35 +0000 (0:00:00.066) 0:00:27.718 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660860081.1434977, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "9245fbe0dd9e5e97f186bf852489118fdda8678d", "ctime": 1660860081.2024987, "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": 1660860081.2024987, "nlink": 1, "path": "/etc/pki/tls/private/mycert_dns_ip_email.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "2196566902", "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:01:35 +0000 (0:00:00.263) 0:00:27.981 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:01:36 +0000 (0:00:00.077) 0:00:28.058 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:01:36 +0000 (0:00:00.072) 0:00:28.131 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_dns_ip_email.crt" ], "delta": "0:00:00.334781", "end": "2022-08-18 22:01:36.829372", "rc": 0, "start": "2022-08-18 22:01:36.494591" } STDOUT: { "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "My Certificate with SAN" } ], "extensions": { "keyUsage": { "value": [ "digital_signature", "key_encipherment" ], "critical": false }, "subjectAltName": { "value": [ { "name": "DNS", "value": "sub1.example.com" }, { "name": "DNS", "value": "www.example.com" }, { "name": "DNS", "value": "sub2.example.com" }, { "name": "DNS", "value": "sub3.example.com" }, { "name": "email", "value": "sysadmin@example.com" }, { "name": "email", "value": "support@example.com" }, { "name": "IP Address", "value": "192.0.2.12" }, { "name": "IP Address", "value": "198.51.100.65" }, { "name": "IP Address", "value": "2001:db8::2:1" } ], "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": "8A:26:DD:7D:E7:C9:4D:9E:5A:6B:BE:8F:8E:95:6D:F4:08:D3:DB:9C", "critical": false }, "authorityKeyIdentifier": { "value": "43:51:51:F0:37:B3:14:1A:EF:2A:8D:B3:F2:3D:2E:67:CB:2D:4C:DA", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "6A:34:71:C7:A8:ED:F4:45:BF:91:94:11:9D:FF:E5:7F:28:2D:77:10:04:7E:CF:B1:74:A5:9B:E1:61:98:D0:8E:83:2B:F1:0F:F1:F5:EE:70:C0:DA:BA:BE:74:CB:7F:0C:43:66:56:58:A2:84:3F:46:99:4E:AF:E4:21:FB:2A:02:48:3F:C6:7D:E4:B0:B0:8E:7A:0B:DD:2E:B2:BB:76:9F:EA:A6:31:FB:D2:73:3B:63:78:C7:0E:99:DE:08:F9:35:6E:A3:3C:F4:92:5D:3A:B5:12:72:07:21:E0:71:88:CC:83:98:25:47:98:B9:E9:76:51:C5:93:15:E6:15:24:58:D5:00:73:89:9E:4C:CF:17:FB:C5:57:98:0D:45:6E:05:3F:B4:5D:D6:01:15:D3:AC:B9:FB:5F:99:8D:3F:A7:B4:43:6D:17:28:4B:F1:5F:C0:4B:BF:46:37:33:6B:B8:26:C0:0F:F1:AD:46:5C:74:67:53:EB:5E:96:00:6E:4A:FA:76:05:B6:EC:F6:93:7A:11:9F:5E:78:3D:DD:7A:80:6F:93:D4:CC:72:02:C9:2F:22:12:2B:BD:BA:CA:B9:ED:3D:17:B2:2B:94:9A:17:7E:C7:F4:50:77:66:41:C2:D9:06:A6:4A:B2:9A:87:43:2B:97:AE:D8:64:E3:32:9D:75:87" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:01:20", "not_valid_before": "2022-08-18 22:01:21" } } 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:01:36 +0000 (0:00:00.754) 0:00:28.885 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "43:51:51:F0:37:B3:14:1A:EF:2A:8D:B3:F2:3D:2E:67:CB:2D:4C:DA" }, "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": "sub1.example.com" }, { "name": "DNS", "value": "www.example.com" }, { "name": "DNS", "value": "sub2.example.com" }, { "name": "DNS", "value": "sub3.example.com" }, { "name": "email", "value": "sysadmin@example.com" }, { "name": "email", "value": "support@example.com" }, { "name": "IP Address", "value": "192.0.2.12" }, { "name": "IP Address", "value": "198.51.100.65" }, { "name": "IP Address", "value": "2001:db8::2:1" } ] }, "subjectKeyIdentifier": { "critical": false, "value": "8A:26:DD:7D:E7:C9:4D:9E:5A:6B:BE:8F:8E:95:6D:F4:08:D3:DB:9C" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "6A:34:71:C7:A8:ED:F4:45:BF:91:94:11:9D:FF:E5:7F:28:2D:77:10:04:7E:CF:B1:74:A5:9B:E1:61:98:D0:8E:83:2B:F1:0F:F1:F5:EE:70:C0:DA:BA:BE:74:CB:7F:0C:43:66:56:58:A2:84:3F:46:99:4E:AF:E4:21:FB:2A:02:48:3F:C6:7D:E4:B0:B0:8E:7A:0B:DD:2E:B2:BB:76:9F:EA:A6:31:FB:D2:73:3B:63:78:C7:0E:99:DE:08:F9:35:6E:A3:3C:F4:92:5D:3A:B5:12:72:07:21:E0:71:88:CC:83:98:25:47:98:B9:E9:76:51:C5:93:15:E6:15:24:58:D5:00:73:89:9E:4C:CF:17:FB:C5:57:98:0D:45:6E:05:3F:B4:5D:D6:01:15:D3:AC:B9:FB:5F:99:8D:3F:A7:B4:43:6D:17:28:4B:F1:5F:C0:4B:BF:46:37:33:6B:B8:26:C0:0F:F1:AD:46:5C:74:67:53:EB:5E:96:00:6E:4A:FA:76:05:B6:EC:F6:93:7A:11:9F:5E:78:3D:DD:7A:80:6F:93:D4:CC:72:02:C9:2F:22:12:2B:BD:BA:CA:B9:ED:3D:17:B2:2B:94:9A:17:7E:C7:F4:50:77:66:41:C2:D9:06:A6:4A:B2:9A:87:43:2B:97:AE:D8:64:E3:32:9D:75:87" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "My Certificate with SAN" } ], "validity": { "not_valid_after": "2023-08-18 22:01:20", "not_valid_before": "2022-08-18 22:01:21" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:01:36 +0000 (0:00:00.101) 0:00:28.986 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:01:37 +0000 (0:00:00.095) 0:00:29.082 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:01:37 +0000 (0:00:00.049) 0:00:29.132 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:01:37 +0000 (0:00:00.067) 0:00:29.199 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:01:37 +0000 (0:00:00.103) 0:00:29.303 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:01:37 +0000 (0:00:00.103) 0:00:29.407 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_dns_ip_email.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.065344", "end": "2022-08-18 22:01:37.704472", "rc": 0, "start": "2022-08-18 22:01:37.639128" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:01:37 +0000 (0:00:00.359) 0:00:29.766 ******* 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:01:37 +0000 (0:00:00.117) 0:00:29.883 ******* =============================================================================== Install the package, force upgrade -------------------------------------- 5.13s Install certreader ------------------------------------------------------ 4.29s linux-system-roles.certificate : Ensure provider packages are installed --- 4.21s linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 4.21s Ensure python3 is installed --------------------------------------------- 1.72s Ensure Python's cryptography is installed ------------------------------- 1.72s linux-system-roles.certificate : Ensure provider service is running ----- 1.46s linux-system-roles.certificate : Ensure certificate requests ------------ 1.11s Gathering Facts --------------------------------------------------------- 1.10s Parse certificate ------------------------------------------------------- 0.75s Gathering Facts --------------------------------------------------------- 0.73s linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.46s linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.44s Retrieve certificate file stats ----------------------------------------- 0.43s Retrieve auto-renew flag ------------------------------------------------ 0.36s linux-system-roles.certificate : Ensure post-scripts hooks directory exists --- 0.30s Retrieve key file stats ------------------------------------------------- 0.26s Verify certificate auto-renew flag -------------------------------------- 0.12s Verify certificate Extended Key Usage ----------------------------------- 0.10s Verify certificate Key Usage -------------------------------------------- 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. ---^---^---^---^---^---