# 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:25:54 +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:25:55 +0000 (0:00:01.023) 0:00:01.044 ******* included: /WORKDIR/dist-git-certificate-use_distro_python_cryptography-AzisEh/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:25:55 +0000 (0:00:00.037) 0:00:01.081 ******* ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** Thursday 18 August 2022 22:25:55 +0000 (0:00:00.448) 0:00:01.530 ******* skipping: [sut] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=Fedora.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } skipping: [sut] => (item=Fedora_35.yml) => { "ansible_loop_var": "item", "changed": false, "item": "Fedora_35.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.certificate : Ensure certificate role dependencies are installed] *** Thursday 18 August 2022 22:25:55 +0000 (0:00:00.058) 0:00:01.589 ******* changed: [sut] => { "changed": true, "rc": 0, "results": [ "Installed: python3-pyasn1-0.4.8-7.fc35.noarch" ] } TASK [linux-system-roles.certificate : Ensure provider packages are installed] *** Thursday 18 August 2022 22:25:59 +0000 (0:00:04.027) 0:00:05.617 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "rc": 0, "results": [ "Installed: certmonger-0.79.15-2.fc35.x86_64", "Installed: dbus-tools-1:1.12.22-1.fc35.x86_64" ] } TASK [linux-system-roles.certificate : Ensure pre-scripts hooks directory exists] *** Thursday 18 August 2022 22:26:04 +0000 (0:00:04.631) 0:00:10.248 ******* 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": 4096, "state": "directory", "uid": 0 } TASK [linux-system-roles.certificate : Ensure post-scripts hooks directory exists] *** Thursday 18 August 2022 22:26:04 +0000 (0:00:00.467) 0:00:10.716 ******* 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": 4096, "state": "directory", "uid": 0 } TASK [linux-system-roles.certificate : Ensure provider service is running] ***** Thursday 18 August 2022 22:26:05 +0000 (0:00:00.303) 0:00:11.020 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "enabled": true, "name": "certmonger", "state": "started", "status": { "ActiveEnterTimestamp": "n/a", "ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestamp": "n/a", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "system.slice systemd-journald.socket basic.target syslog.target network.target sysinit.target dbus-broker.service dbus.socket", "AllowIsolate": "no", "AssertResult": "no", "AssertTimestamp": "n/a", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "BusName": "org.fedorahosted.certmonger", "CPUAccounting": "yes", "CPUAffinityFromNUMA": "no", "CPUQuotaPerSecUSec": "infinity", "CPUQuotaPeriodUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "[not set]", "CPUUsageNSec": "[not set]", "CPUWeight": "[not set]", "CacheDirectoryMode": "0755", "CanFreeze": "yes", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf cap_checkpoint_restore", "CleanResult": "success", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestamp": "n/a", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target", "ControlPID": "0", "CoredumpFilter": "0x33", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "Certificate monitoring and PKI enrollment", "DevicePolicy": "auto", "DynamicUser": "no", "EnvironmentFiles": "/etc/sysconfig/certmonger (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestamp": "n/a", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestamp": "n/a", "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 }", "ExecStartEx": "{ path=/usr/sbin/certmonger ; argv[]=/usr/sbin/certmonger -S -p /run/certmonger.pid -n $OPTS ; flags= ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FinalKillSignal": "9", "FragmentPath": "/usr/lib/systemd/system/certmonger.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOReadBytes": "18446744073709551615", "IOReadOperations": "18446744073709551615", "IOSchedulingClass": "2", "IOSchedulingPriority": "4", "IOWeight": "[not set]", "IOWriteBytes": "18446744073709551615", "IOWriteOperations": "18446744073709551615", "IPAccounting": "no", "IPEgressBytes": "[no data]", "IPEgressPackets": "[no data]", "IPIngressBytes": "[no data]", "IPIngressPackets": "[no data]", "Id": "certmonger.service", "IgnoreOnIsolate": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestamp": "n/a", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "n/a", "InactiveExitTimestampMonotonic": "0", "JobRunningTimeoutUSec": "infinity", "JobTimeoutAction": "none", "JobTimeoutUSec": "infinity", "KeyringMode": "private", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "infinity", "LimitASSoft": "infinity", "LimitCORE": "infinity", "LimitCORESoft": "infinity", "LimitCPU": "infinity", "LimitCPUSoft": "infinity", "LimitDATA": "infinity", "LimitDATASoft": "infinity", "LimitFSIZE": "infinity", "LimitFSIZESoft": "infinity", "LimitLOCKS": "infinity", "LimitLOCKSSoft": "infinity", "LimitMEMLOCK": "8388608", "LimitMEMLOCKSoft": "8388608", "LimitMSGQUEUE": "819200", "LimitMSGQUEUESoft": "819200", "LimitNICE": "0", "LimitNICESoft": "0", "LimitNOFILE": "524288", "LimitNOFILESoft": "1024", "LimitNPROC": "14799", "LimitNPROCSoft": "14799", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "14799", "LimitSIGPENDINGSoft": "14799", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "ManagedOOMMemoryPressure": "auto", "ManagedOOMMemoryPressureLimit": "0", "ManagedOOMPreference": "none", "ManagedOOMSwap": "auto", "MemoryAccounting": "yes", "MemoryAvailable": "infinity", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAPolicy": "n/a", "Names": "certmonger.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMPolicy": "stop", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "OnSuccessJobMode": "fail", "PIDFile": "/run/certmonger.pid", "PartOf": "dbus-broker.service", "Perpetual": "no", "PrivateDevices": "no", "PrivateIPC": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProcSubset": "all", "ProtectClock": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectHostname": "no", "ProtectKernelLogs": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectProc": "default", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "ReloadResult": "success", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "sysinit.target dbus.socket system.slice", "Restart": "no", "RestartKillSignal": "15", "RestartUSec": "100ms", "RestrictNamespaces": "no", "RestrictRealtime": "no", "RestrictSUIDSGID": "no", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "RuntimeDirectoryPreserve": "no", "RuntimeMaxUSec": "infinity", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitIntervalUSec": "10s", "StartupBlockIOWeight": "[not set]", "StartupCPUShares": "[not set]", "StartupCPUWeight": "[not set]", "StartupIOWeight": "[not set]", "StateChangeTimestamp": "n/a", "StateChangeTimestampMonotonic": "0", "StateDirectoryMode": "0755", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SuccessAction": "none", "SyslogFacility": "3", "SyslogLevel": "6", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "2147483646", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "[not set]", "TasksMax": "4439", "TimeoutAbortUSec": "1min 30s", "TimeoutCleanUSec": "infinity", "TimeoutStartFailureMode": "terminate", "TimeoutStartUSec": "1min 30s", "TimeoutStopFailureMode": "terminate", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "UtmpMode": "init", "WatchdogSignal": "6", "WatchdogTimestamp": "n/a", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "infinity" } } TASK [linux-system-roles.certificate : Ensure certificate requests] ************ Thursday 18 August 2022 22:26:06 +0000 (0:00:01.179) 0:00:12.199 ******* changed: [sut] => (item={'name': 'mycert_key_usage_and_extended_key_usage', 'dns': 'www.example.com', 'key_usage': ['digitalSignature', 'nonRepudiation', 'keyEncipherment'], 'extended_key_usage': ['id-kp-clientAuth', 'id-kp-serverAuth', 'id-kp-ipsecTunnel', '1.3.6.1.5.2.3.5'], 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "extended_key_usage": [ "id-kp-clientAuth", "id-kp-serverAuth", "id-kp-ipsecTunnel", "1.3.6.1.5.2.3.5" ], "key_usage": [ "digitalSignature", "nonRepudiation", "keyEncipherment" ], "name": "mycert_key_usage_and_extended_key_usage" } } MSG: Certificate requested (new). PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:26:08 +0000 (0:00:01.618) 0:00:13.818 ******* ok: [sut] TASK [Verify each certificate] ************************************************* Thursday 18 August 2022 22:26:09 +0000 (0:00:00.966) 0:00:14.784 ******* included: /WORKDIR/dist-git-certificate-use_distro_python_cryptography-AzisEh/tests/tasks/assert_certificate_parameters.yml for sut => (item={'path': '/etc/pki/tls/certs/mycert_key_usage_and_extended_key_usage.crt', 'key_path': '/etc/pki/tls/private/mycert_key_usage_and_extended_key_usage.key', 'subject': [{'name': 'commonName', 'oid': '2.5.4.3', 'value': 'www.example.com'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'www.example.com'}], 'key_usage': ['digital_signature', 'content_commitment', 'key_encipherment'], 'extended_key_usage': [{'name': 'id-kp-clientAuth', 'oid': '1.3.6.1.5.5.7.3.2'}, {'name': 'id-kp-serverAuth', 'oid': '1.3.6.1.5.5.7.3.1'}, {'name': 'id-kp-ipsecTunnel', 'oid': '1.3.6.1.5.5.7.3.6'}, {'name': None, 'oid': '1.3.6.1.5.2.3.5'}]}) TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:26:09 +0000 (0:00:00.059) 0:00:14.843 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:26:09 +0000 (0:00:00.041) 0:00:14.885 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:26:12 +0000 (0:00:03.131) 0:00:18.016 ******* 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: Requirement already satisfied: pip in ./certificate-tests-venv/lib/python3.10/site-packages (21.2.3) Collecting pip Downloading pip-22.2.2-py3-none-any.whl (2.0 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 21.2.3 Uninstalling pip-21.2.3: Successfully uninstalled pip-21.2.3 Successfully installed pip-22.2.2 TASK [Ensure Python's cryptography is installed] ******************************* Thursday 18 August 2022 22:26:18 +0000 (0:00:06.449) 0:00:24.466 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:26:21 +0000 (0:00:02.708) 0:00:27.174 ******* 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) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 32.3 MB/s eta 0:00:00 Collecting pyasn1 Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 10.6 MB/s eta 0:00:00 Collecting pyyaml Downloading PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 682.2/682.2 kB 40.6 MB/s eta 0:00:00 Collecting cffi>=1.12 Downloading cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 kB 36.4 MB/s eta 0:00:00 Collecting pycparser Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 16.0 MB/s eta 0:00:00 Using legacy 'setup.py install' for certreader, since package 'wheel' is not installed. Installing collected packages: pyasn1, pyyaml, pycparser, cffi, 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:26:24 +0000 (0:00:03.229) 0:00:30.403 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861567.8814316, "attr_flags": "e", "attributes": [ "extents" ], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "225267ec3cd48385e51c570fc4a13cbabbdf83b2", "ctime": 1660861567.8754315, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 156833, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861567.8754315, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_key_usage_and_extended_key_usage.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1318, "uid": 0, "version": "986774847", "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:26:25 +0000 (0:00:00.441) 0:00:30.845 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:26:25 +0000 (0:00:00.049) 0:00:30.894 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:26:25 +0000 (0:00:00.074) 0:00:30.968 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:26:25 +0000 (0:00:00.098) 0:00:31.067 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861567.8074307, "attr_flags": "e", "attributes": [ "extents" ], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "ffe29afde208e7b42bffde4cfc3618cfc51f50f2", "ctime": 1660861567.8754315, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 156832, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1660861567.8754315, "nlink": 1, "path": "/etc/pki/tls/private/mycert_key_usage_and_extended_key_usage.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1708, "uid": 0, "version": "2171869505", "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:26:25 +0000 (0:00:00.306) 0:00:31.374 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:26:25 +0000 (0:00:00.049) 0:00:31.423 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:26:25 +0000 (0:00:00.109) 0:00:31.533 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_key_usage_and_extended_key_usage.crt" ], "delta": "0:00:00.277034", "end": "2022-08-18 22:26:26.476506", "rc": 0, "start": "2022-08-18 22:26:26.199472" } STDOUT: { "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "extensions": { "keyUsage": { "value": [ "digital_signature", "content_commitment", "key_encipherment" ], "critical": false }, "subjectAltName": { "value": [ { "name": "DNS", "value": "www.example.com" } ], "critical": false }, "extendedKeyUsage": { "value": [ { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" }, { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-ipsecTunnel", "oid": "1.3.6.1.5.5.7.3.6" }, { "name": null, "oid": "1.3.6.1.5.2.3.5" } ], "critical": false }, "basicConstraints": { "value": { "ca": false }, "critical": true }, "subjectKeyIdentifier": { "value": "A6:28:29:1D:07:3A:F2:F5:0E:0C:20:AC:CC:50:81:50:96:34:04:86", "critical": false }, "authorityKeyIdentifier": { "value": "46:57:BE:D7:A8:B4:9A:F9:EC:05:E9:1C:0C:4A:51:B4:02:D5:B0:D1", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "8F:55:90:BA:FD:86:AD:0E:8D:A0:CB:F7:03:2C:ED:C7:35:7D:99:50:CB:40:D5:8D:BA:33:37:50:24:28:F6:CD:C8:93:31:FA:F8:43:D0:D9:90:5C:2A:BC:61:E5:C8:34:29:61:C1:18:FA:60:49:EE:3A:39:2C:52:96:72:20:54:AB:6D:9D:99:B4:15:35:C3:7F:E3:6B:D2:FB:9B:C3:5C:9C:66:2F:A9:38:1C:94:55:74:13:20:EB:C9:50:AE:32:B4:4C:80:79:57:D3:CE:30:21:0C:0E:B6:E2:06:67:6B:1F:41:8A:AA:3D:9E:08:84:F8:0C:C5:99:85:C0:88:D9:DE:C8:3C:57:F8:D4:4D:F2:F6:54:17:C5:7C:06:12:9A:8B:81:95:1C:F4:2C:9A:A5:5A:58:5E:16:A4:0F:98:74:84:9E:09:3F:C4:2C:E1:FD:72:55:76:E3:EF:B2:CA:34:AE:F0:79:0C:72:F0:D1:55:35:94:D7:8E:95:07:2A:89:30:0F:5F:B1:F5:D0:05:44:F2:68:16:84:4A:C6:99:82:BF:BD:B2:FA:47:9C:7A:F0:2C:BF:72:C4:C4:E9:85:19:68:AA:E8:50:86:8D:8B:B5:13:3F:04:CE:63:83:91:6E:BE:91:2A:9E:B8:5F:39:E4:A2:92:1E:BE:59:76:41:4C" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:26:06", "not_valid_before": "2022-08-18 22:26:07" } } TASK [Load certificate YAML to cert_issued variable] *************************** Thursday 18 August 2022 22:26:26 +0000 (0:00:00.705) 0:00:32.239 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "46:57:BE:D7:A8:B4:9A:F9:EC:05:E9:1C:0C:4A:51:B4:02:D5:B0:D1" }, "basicConstraints": { "critical": true, "value": { "ca": false } }, "extendedKeyUsage": { "critical": false, "value": [ { "name": "id-kp-clientAuth", "oid": "1.3.6.1.5.5.7.3.2" }, { "name": "id-kp-serverAuth", "oid": "1.3.6.1.5.5.7.3.1" }, { "name": "id-kp-ipsecTunnel", "oid": "1.3.6.1.5.5.7.3.6" }, { "name": null, "oid": "1.3.6.1.5.2.3.5" } ] }, "keyUsage": { "critical": false, "value": [ "digital_signature", "content_commitment", "key_encipherment" ] }, "subjectAltName": { "critical": false, "value": [ { "name": "DNS", "value": "www.example.com" } ] }, "subjectKeyIdentifier": { "critical": false, "value": "A6:28:29:1D:07:3A:F2:F5:0E:0C:20:AC:CC:50:81:50:96:34:04:86" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "8F:55:90:BA:FD:86:AD:0E:8D:A0:CB:F7:03:2C:ED:C7:35:7D:99:50:CB:40:D5:8D:BA:33:37:50:24:28:F6:CD:C8:93:31:FA:F8:43:D0:D9:90:5C:2A:BC:61:E5:C8:34:29:61:C1:18:FA:60:49:EE:3A:39:2C:52:96:72:20:54:AB:6D:9D:99:B4:15:35:C3:7F:E3:6B:D2:FB:9B:C3:5C:9C:66:2F:A9:38:1C:94:55:74:13:20:EB:C9:50:AE:32:B4:4C:80:79:57:D3:CE:30:21:0C:0E:B6:E2:06:67:6B:1F:41:8A:AA:3D:9E:08:84:F8:0C:C5:99:85:C0:88:D9:DE:C8:3C:57:F8:D4:4D:F2:F6:54:17:C5:7C:06:12:9A:8B:81:95:1C:F4:2C:9A:A5:5A:58:5E:16:A4:0F:98:74:84:9E:09:3F:C4:2C:E1:FD:72:55:76:E3:EF:B2:CA:34:AE:F0:79:0C:72:F0:D1:55:35:94:D7:8E:95:07:2A:89:30:0F:5F:B1:F5:D0:05:44:F2:68:16:84:4A:C6:99:82:BF:BD:B2:FA:47:9C:7A:F0:2C:BF:72:C4:C4:E9:85:19:68:AA:E8:50:86:8D:8B:B5:13:3F:04:CE:63:83:91:6E:BE:91:2A:9E:B8:5F:39:E4:A2:92:1E:BE:59:76:41:4C" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-08-18 22:26:06", "not_valid_before": "2022-08-18 22:26:07" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:26:26 +0000 (0:00:00.095) 0:00:32.334 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:26:26 +0000 (0:00:00.071) 0:00:32.406 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:26:26 +0000 (0:00:00.048) 0:00:32.454 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:26:26 +0000 (0:00:00.067) 0:00:32.522 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:26:26 +0000 (0:00:00.100) 0:00:32.622 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:26:26 +0000 (0:00:00.100) 0:00:32.722 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_key_usage_and_extended_key_usage.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.053355", "end": "2022-08-18 22:26:27.307989", "rc": 0, "start": "2022-08-18 22:26:27.254634" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:26:27 +0000 (0:00:00.343) 0:00:33.066 ******* 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:26:27 +0000 (0:00:00.112) 0:00:33.178 ******* =============================================================================== Install the package, force upgrade -------------------------------------- 6.45s linux-system-roles.certificate : Ensure provider packages are installed --- 4.63s linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 4.03s Install certreader ------------------------------------------------------ 3.23s Ensure python3 is installed --------------------------------------------- 3.13s Ensure Python's cryptography is installed ------------------------------- 2.71s linux-system-roles.certificate : Ensure certificate requests ------------ 1.62s linux-system-roles.certificate : Ensure provider service is running ----- 1.18s Gathering Facts --------------------------------------------------------- 1.02s Gathering Facts --------------------------------------------------------- 0.97s Parse certificate ------------------------------------------------------- 0.71s linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.47s linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.45s Retrieve certificate file stats ----------------------------------------- 0.44s Retrieve auto-renew flag ------------------------------------------------ 0.34s Retrieve key file stats ------------------------------------------------- 0.31s linux-system-roles.certificate : Ensure post-scripts hooks directory exists --- 0.30s Verify certificate auto-renew flag -------------------------------------- 0.11s Verify key file owner and group ----------------------------------------- 0.11s Verify certificate Extended 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. ---^---^---^---^---^---