# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [Issue simple self-signed certificate] ************************************ TASK [Gathering Facts] ********************************************************* ok: [sut] TASK [linux-system-roles.certificate : Set version specific variables] ********* included: /WORKDIR/dist-git-certificate-setup-snapshot-no-gather-facts-kugxkU/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml for sut TASK [linux-system-roles.certificate : Ensure ansible_facts used by role] ****** ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** 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.5.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat_8.5.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.certificate : Ensure certificate role dependencies are installed] *** 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] *** changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "rc": 0, "results": [ "Installed: certmonger-0.79.13-3.el8.x86_64", "Installed: xmlrpc-c-1.51.0-5.el8.x86_64", "Installed: xmlrpc-c-client-1.51.0-5.el8.x86_64" ] } TASK [linux-system-roles.certificate : Ensure pre-scripts hooks directory exists] *** 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] *** 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] ***** 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.socket systemd-journald.socket network.target system.slice dbus.service basic.target syslog.target sysinit.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": "14166", "LimitNPROCSoft": "14166", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "14166", "LimitSIGPENDINGSoft": "14166", "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": "22665", "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] ************ 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] ********************************************************* ok: [sut] TASK [Verify each certificate] ************************************************* included: /WORKDIR/dist-git-certificate-setup-snapshot-no-gather-facts-kugxkU/tests/tasks/assert_certificate_parameters.yml for sut included: /WORKDIR/dist-git-certificate-setup-snapshot-no-gather-facts-kugxkU/tests/tasks/assert_certificate_parameters.yml for sut TASK [Set virtualenv_path] ***************************************************** ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** 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.0.4 is available. You should consider upgrading via the 'pip install --upgrade pip' command. TASK [Install certreader] ****************************************************** changed: [sut] => { "changed": true, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "cryptography<35", "certreader>=0.1.1" ], "name": [ "cryptography<35", "certreader>=0.1.1" ], "requirements": null, "state": "present", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Collecting cryptography<35 Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_24_x86_64.whl (3.0 MB) 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 cffi>=1.12 Downloading cffi-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (405 kB) 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 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.0 cryptography-3.4.8 pyasn1-0.4.8 pycparser-2.21 pyyaml-6.0 TASK [Retrieve certificate file stats] ***************************************** ok: [sut] => { "changed": false, "stat": { "atime": 1649786196.870381, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "9c1279205bd2c92629c0b9c7d5af65813ade2778", "ctime": 1649786196.8673813, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 566193, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1649786196.8673813, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_no_auto_renew.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1310, "uid": 0, "version": "176182704", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* ok: [sut] => { "changed": false, "stat": { "atime": 1649786196.8083825, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "1feb7121f88713396edc356100ca77449d0519ac", "ctime": 1649786196.8673813, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 407546, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1649786196.8673813, "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": "2973725317", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_no_auto_renew.crt" ], "delta": "0:00:00.313214", "end": "2022-04-12 17:56:52.621845", "rc": 0, "start": "2022-04-12 17:56:52.308631" } 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": "9F:BC:60:62:99:E4:88:30:87:F7:65:6B:1F:FE:88:E5:A1:11:07:26", "critical": false }, "authorityKeyIdentifier": { "value": "F5:26:90:7C:D9:79:FE:F7:F8:DC:11:68:41:47:C7:E9:FE:8A:39:6E", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "86:A1:B8:31:08:A7:62:F5:D8:6E:ED:D2:F0:C2:9E:53:14:E4:27:CE:54:85:E0:32:14:36:B0:A6:B5:30:33:78:AA:B9:0C:75:63:29:4F:95:18:7E:99:57:6C:A9:4A:5F:E2:57:DB:87:0B:2B:AA:DB:62:41:52:04:E1:56:30:1D:C6:85:75:4F:FB:47:96:E4:CB:3E:F4:F6:E3:04:5E:D1:07:7C:DF:8F:11:C0:FC:B2:A2:82:03:91:54:EF:36:28:BF:75:E5:FA:93:51:CB:29:76:B8:B6:9E:39:9A:19:B1:23:86:EA:8E:AA:30:D9:CD:AE:53:C5:C7:3E:9B:CC:49:C3:EF:87:B3:82:E9:73:20:A8:87:A9:04:0D:72:03:AB:38:AE:B4:F2:3B:27:60:34:7A:EB:9D:CB:C1:A4:06:74:91:22:92:38:88:7D:22:70:F3:5B:56:BD:0B:3E:2D:58:BB:CE:5D:FF:1F:34:0C:AF:86:9E:5F:91:AC:39:D3:1A:43:4B:19:21:5D:35:DA:05:BF:BD:4D:6B:0F:BC:4A:3D:CB:14:25:E0:A5:31:0A:80:41:7D:D9:19:57:6E:8D:3B:0D:7C:1A:00:1E:87:33:BF:FE:5D:65:4A:3F:7A:A6:2E:78:89:2F:74:F9:49:F9:DF:68:50:F0:8E:29:1A:3E:C3" }, "key_size": 2048, "validity": { "not_valid_after": "2023-04-12 17:56:36", "not_valid_before": "2022-04-12 17:56:36" } } TASK [Load certificate YAML to cert_issued variable] *************************** ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "F5:26:90:7C:D9:79:FE:F7:F8:DC:11:68:41:47:C7:E9:FE:8A:39:6E" }, "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": "9F:BC:60:62:99:E4:88:30:87:F7:65:6B:1F:FE:88:E5:A1:11:07:26" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "86:A1:B8:31:08:A7:62:F5:D8:6E:ED:D2:F0:C2:9E:53:14:E4:27:CE:54:85:E0:32:14:36:B0:A6:B5:30:33:78:AA:B9:0C:75:63:29:4F:95:18:7E:99:57:6C:A9:4A:5F:E2:57:DB:87:0B:2B:AA:DB:62:41:52:04:E1:56:30:1D:C6:85:75:4F:FB:47:96:E4:CB:3E:F4:F6:E3:04:5E:D1:07:7C:DF:8F:11:C0:FC:B2:A2:82:03:91:54:EF:36:28:BF:75:E5:FA:93:51:CB:29:76:B8:B6:9E:39:9A:19:B1:23:86:EA:8E:AA:30:D9:CD:AE:53:C5:C7:3E:9B:CC:49:C3:EF:87:B3:82:E9:73:20:A8:87:A9:04:0D:72:03:AB:38:AE:B4:F2:3B:27:60:34:7A:EB:9D:CB:C1:A4:06:74:91:22:92:38:88:7D:22:70:F3:5B:56:BD:0B:3E:2D:58:BB:CE:5D:FF:1F:34:0C:AF:86:9E:5F:91:AC:39:D3:1A:43:4B:19:21:5D:35:DA:05:BF:BD:4D:6B:0F:BC:4A:3D:CB:14:25:E0:A5:31:0A:80:41:7D:D9:19:57:6E:8D:3B:0D:7C:1A:00:1E:87:33:BF:FE:5D:65:4A:3F:7A:A6:2E:78:89:2F:74:F9:49:F9:DF:68:50:F0:8E:29:1A:3E:C3" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-04-12 17:56:36", "not_valid_before": "2022-04-12 17:56:36" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ 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.063956", "end": "2022-04-12 17:56:53.237475", "rc": 0, "start": "2022-04-12 17:56:53.173519" } STDOUT: no TASK [Verify certificate auto-renew flag] ************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Set virtualenv_path] ***************************************************** ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** 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 [Install certreader] ****************************************************** ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip3", "install", "cryptography<35", "certreader>=0.1.1" ], "name": [ "cryptography<35", "certreader>=0.1.1" ], "requirements": null, "state": "present", "version": null, "virtualenv": "/tmp/certificate-tests-venv" } STDOUT: Requirement already satisfied: cryptography<35 in ./certificate-tests-venv/lib/python3.6/site-packages (3.4.8) Requirement already satisfied: certreader>=0.1.1 in ./certificate-tests-venv/lib/python3.6/site-packages (0.1.1) Requirement already satisfied: cffi>=1.12 in ./certificate-tests-venv/lib/python3.6/site-packages (from cryptography<35) (1.15.0) 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: pycparser in ./certificate-tests-venv/lib/python3.6/site-packages (from cffi>=1.12->cryptography<35) (2.21) TASK [Retrieve certificate file stats] ***************************************** ok: [sut] => { "changed": false, "stat": { "atime": 1649786198.4663503, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "297a2a976623d01438eff34834a3142abf5a0020", "ctime": 1649786198.4633503, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 566195, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1649786198.4633503, "nlink": 1, "path": "/etc/pki/tls/certs/defaultcert.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1310, "uid": 0, "version": "185378440", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* ok: [sut] => { "changed": false, "stat": { "atime": 1649786198.4093513, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "284e3305fcaeadf71772dc643f210acb42a20f74", "ctime": 1649786198.4633503, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 566194, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1649786198.4633503, "nlink": 1, "path": "/etc/pki/tls/private/defaultcert.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "3083843135", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/defaultcert.crt" ], "delta": "0:00:00.312202", "end": "2022-04-12 17:56:58.070289", "rc": 0, "start": "2022-04-12 17:56:57.758087" } 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": "56:9B:88:DD:43:16:2D:19:EE:CD:A3:78:96:32:C9:4D:DA:83:F9:4D", "critical": false }, "authorityKeyIdentifier": { "value": "F5:26:90:7C:D9:79:FE:F7:F8:DC:11:68:41:47:C7:E9:FE:8A:39:6E", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "54:A1:DF:EE:20:76:78:0B:5D:A5:F0:4B:30:5F:3B:81:66:0D:5B:6E:6B:F0:15:BD:2C:6F:0B:83:27:E5:29:36:E2:46:75:AE:0C:30:B2:98:26:7E:FA:AD:BA:93:78:54:A5:89:E9:48:36:F6:ED:DA:74:C0:02:94:39:23:58:70:7C:FA:7A:10:3C:BB:F5:B4:81:31:F5:8B:43:DE:55:2F:D5:E2:5A:FA:DE:D7:4B:5D:6A:1D:41:88:CD:6F:42:3C:EC:EE:4D:DB:DD:45:E4:0F:35:BA:C8:8F:23:88:03:8B:9E:8A:51:B0:15:45:CD:5E:24:92:21:2E:69:00:7A:DD:2F:20:17:1B:E8:0D:61:E3:4F:B2:E2:E2:40:F3:CD:FA:0A:8E:5F:B3:6F:D3:A9:E8:76:68:4B:5F:24:14:14:8E:61:B1:A8:BC:24:CA:35:F6:8F:24:C8:B4:14:3C:28:E7:F7:06:51:81:70:2F:49:C5:FF:34:4B:BA:A7:4D:77:E9:80:76:39:99:61:DF:65:16:53:F7:BB:50:7C:03:C5:90:35:92:8C:BE:C3:B5:69:E0:28:6C:CF:F1:40:88:40:0D:23:D0:80:EE:53:EA:32:CC:25:11:FF:8D:2E:52:8E:B2:27:99:DC:58:D9:28:45:4A:69:AA:D1:4B:37:FF:79:74" }, "key_size": 2048, "validity": { "not_valid_after": "2023-04-12 17:56:36", "not_valid_before": "2022-04-12 17:56:38" } } TASK [Load certificate YAML to cert_issued variable] *************************** ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "F5:26:90:7C:D9:79:FE:F7:F8:DC:11:68:41:47:C7:E9:FE:8A:39:6E" }, "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": "56:9B:88:DD:43:16:2D:19:EE:CD:A3:78:96:32:C9:4D:DA:83:F9:4D" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "54:A1:DF:EE:20:76:78:0B:5D:A5:F0:4B:30:5F:3B:81:66:0D:5B:6E:6B:F0:15:BD:2C:6F:0B:83:27:E5:29:36:E2:46:75:AE:0C:30:B2:98:26:7E:FA:AD:BA:93:78:54:A5:89:E9:48:36:F6:ED:DA:74:C0:02:94:39:23:58:70:7C:FA:7A:10:3C:BB:F5:B4:81:31:F5:8B:43:DE:55:2F:D5:E2:5A:FA:DE:D7:4B:5D:6A:1D:41:88:CD:6F:42:3C:EC:EE:4D:DB:DD:45:E4:0F:35:BA:C8:8F:23:88:03:8B:9E:8A:51:B0:15:45:CD:5E:24:92:21:2E:69:00:7A:DD:2F:20:17:1B:E8:0D:61:E3:4F:B2:E2:E2:40:F3:CD:FA:0A:8E:5F:B3:6F:D3:A9:E8:76:68:4B:5F:24:14:14:8E:61:B1:A8:BC:24:CA:35:F6:8F:24:C8:B4:14:3C:28:E7:F7:06:51:81:70:2F:49:C5:FF:34:4B:BA:A7:4D:77:E9:80:76:39:99:61:DF:65:16:53:F7:BB:50:7C:03:C5:90:35:92:8C:BE:C3:B5:69:E0:28:6C:CF:F1:40:88:40:0D:23:D0:80:EE:53:EA:32:CC:25:11:FF:8D:2E:52:8E:B2:27:99:DC:58:D9:28:45:4A:69:AA:D1:4B:37:FF:79:74" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-04-12 17:56:36", "not_valid_before": "2022-04-12 17:56:38" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ 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.064189", "end": "2022-04-12 17:56:58.679179", "rc": 0, "start": "2022-04-12 17:56:58.614990" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** ok: [sut] => { "changed": false } MSG: All assertions passed PLAY RECAP ********************************************************************* sut : ok=52 changed=8 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- ---^---^---^---^---^---