# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [Ensure UID and GID exists] *********************************************** TASK [Gathering Facts] ********************************************************* ok: [sut] TASK [Ensure user exists] ****************************************************** changed: [sut] => { "changed": true, "comment": "", "create_home": true, "group": 1040, "home": "/home/user1", "name": "user1", "shell": "/bin/bash", "state": "present", "system": false, "uid": 1040 } TASK [Ensure group "somegroup" exists] ***************************************** changed: [sut] => { "changed": true, "gid": 1041, "name": "somegroup", "state": "present", "system": false } PLAY [Issue certificate setting user/group] ************************************ 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": "network.target systemd-journald.socket dbus.service dbus.socket system.slice syslog.target basic.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": "system.slice dbus.socket 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": "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_fs_attrs', 'dns': 'www.example.com', 'owner': 'ftp', 'group': 'ftp', 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "group": "ftp", "name": "mycert_fs_attrs", "owner": "ftp" } } MSG: Certificate requested (new). File attributes updated. changed: [sut] => (item={'name': 'certid', 'dns': 'www.example.com', 'owner': 1040, 'group': 1041, 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "group": 1041, "name": "certid", "owner": 1040 } } MSG: Certificate requested (new). File attributes updated. 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": 1649785395.1551623, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "d13d61b88d5e3179ebee0a294192d1d3871cad9b", "ctime": 1649785395.2031631, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 50, "gr_name": "ftp", "inode": 566198, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0640", "mtime": 1649785395.1521623, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_fs_attrs.crt", "pw_name": "ftp", "readable": true, "rgrp": true, "roth": false, "rusr": true, "size": 1310, "uid": 14, "version": "1142632390", "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": 1649785395.0901613, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "75e5f6bdccb59b066f5b90d84041be28f19faa2a", "ctime": 1649785395.2041633, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 50, "gr_name": "ftp", "inode": 566152, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0640", "mtime": 1649785395.1521623, "nlink": 1, "path": "/etc/pki/tls/private/mycert_fs_attrs.key", "pw_name": "ftp", "readable": true, "rgrp": true, "roth": false, "rusr": true, "size": 1704, "uid": 14, "version": "784233441", "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_fs_attrs.crt" ], "delta": "0:00:00.316237", "end": "2022-04-12 17:43:29.009880", "rc": 0, "start": "2022-04-12 17:43:28.693643" } 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": "BC:BE:F9:F2:F2:8E:FD:19:47:4F:98:D4:03:68:CA:66:AE:9D:26:4D", "critical": false }, "authorityKeyIdentifier": { "value": "DA:2A:FE:B7:79:F2:4C:2C:0D:6B:5C:56:42:31:5D:0C:B7:7B:7D:FD", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "D5:BF:5B:ED:7C:A6:D7:5B:33:F6:F4:F8:99:7B:CA:00:78:5B:D2:DA:E7:5F:2B:96:07:02:9B:2F:44:50:78:E5:8F:95:6C:78:FC:CD:55:5E:27:F7:11:93:7D:73:82:AA:21:80:8A:69:1F:F0:36:AD:0E:A5:53:0C:A2:49:87:F5:F0:13:20:E8:5E:9A:6D:FE:A1:2E:7D:E3:A4:45:94:3D:37:96:98:A7:A4:13:21:BB:67:BB:DE:A0:FD:1E:95:BF:EC:F6:14:FA:36:00:D2:07:08:0D:7E:9B:B0:C2:19:C5:E3:42:A0:25:C8:7F:81:CE:81:71:B3:69:E8:2B:1E:7E:70:76:AD:34:34:0B:B3:5C:D7:D6:13:59:2E:A4:98:9C:B4:87:D9:D9:37:04:53:D1:1A:78:0E:6F:82:BC:3C:1E:FA:E9:6F:7B:ED:9D:EC:40:7A:AD:AB:BF:31:42:53:23:E9:45:ED:A3:F6:7A:A0:A5:A5:04:C7:0D:84:75:A6:34:E8:F5:37:20:6E:21:DA:6A:C4:19:3C:31:D8:6F:74:92:94:30:6E:2A:33:B5:C2:A9:CE:41:FB:9D:CF:6E:26:48:19:7D:4F:B8:BE:DC:0D:9E:E7:BF:A8:90:02:EA:35:E5:65:C3:EB:1C:43:99:7B:FE:39:F8:61:65:87:7A:BC:A9" }, "key_size": 2048, "validity": { "not_valid_after": "2023-04-12 17:43:14", "not_valid_before": "2022-04-12 17:43:15" } } TASK [Load certificate YAML to cert_issued variable] *************************** ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "DA:2A:FE:B7:79:F2:4C:2C:0D:6B:5C:56:42:31:5D:0C:B7:7B:7D:FD" }, "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": "BC:BE:F9:F2:F2:8E:FD:19:47:4F:98:D4:03:68:CA:66:AE:9D:26:4D" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "D5:BF:5B:ED:7C:A6:D7:5B:33:F6:F4:F8:99:7B:CA:00:78:5B:D2:DA:E7:5F:2B:96:07:02:9B:2F:44:50:78:E5:8F:95:6C:78:FC:CD:55:5E:27:F7:11:93:7D:73:82:AA:21:80:8A:69:1F:F0:36:AD:0E:A5:53:0C:A2:49:87:F5:F0:13:20:E8:5E:9A:6D:FE:A1:2E:7D:E3:A4:45:94:3D:37:96:98:A7:A4:13:21:BB:67:BB:DE:A0:FD:1E:95:BF:EC:F6:14:FA:36:00:D2:07:08:0D:7E:9B:B0:C2:19:C5:E3:42:A0:25:C8:7F:81:CE:81:71:B3:69:E8:2B:1E:7E:70:76:AD:34:34:0B:B3:5C:D7:D6:13:59:2E:A4:98:9C:B4:87:D9:D9:37:04:53:D1:1A:78:0E:6F:82:BC:3C:1E:FA:E9:6F:7B:ED:9D:EC:40:7A:AD:AB:BF:31:42:53:23:E9:45:ED:A3:F6:7A:A0:A5:A5:04:C7:0D:84:75:A6:34:E8:F5:37:20:6E:21:DA:6A:C4:19:3C:31:D8:6F:74:92:94:30:6E:2A:33:B5:C2:A9:CE:41:FB:9D:CF:6E:26:48:19:7D:4F:B8:BE:DC:0D:9E:E7:BF:A8:90:02:EA:35:E5:65:C3:EB:1C:43:99:7B:FE:39:F8:61:65:87:7A:BC:A9" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-04-12 17:43:14", "not_valid_before": "2022-04-12 17:43:15" } } }, "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_fs_attrs.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.065024", "end": "2022-04-12 17:43:29.646394", "rc": 0, "start": "2022-04-12 17:43:29.581370" } STDOUT: yes 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": 1649785395.861174, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "178716594dfc59a2d035e48cf113fcdd8378a162", "ctime": 1649785395.9661758, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 1041, "gr_name": "somegroup", "inode": 566200, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0640", "mtime": 1649785395.858174, "nlink": 1, "path": "/etc/pki/tls/certs/certid.crt", "pw_name": "user1", "readable": true, "rgrp": true, "roth": false, "rusr": true, "size": 1310, "uid": 1040, "version": "2287789920", "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": 1649785395.8021731, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "9778955e142d97b2944b20fd62893c1aff942962", "ctime": 1649785395.9671757, "dev": 51713, "device_type": 0, "executable": false, "exists": true, "gid": 1041, "gr_name": "somegroup", "inode": 566199, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0640", "mtime": 1649785395.858174, "nlink": 1, "path": "/etc/pki/tls/private/certid.key", "pw_name": "user1", "readable": true, "rgrp": true, "roth": false, "rusr": true, "size": 1704, "uid": 1040, "version": "3345442376", "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/certid.crt" ], "delta": "0:00:00.315292", "end": "2022-04-12 17:43:34.574667", "rc": 0, "start": "2022-04-12 17:43:34.259375" } 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": "0F:9E:96:F2:64:EE:B9:F6:1F:AA:1C:4B:5A:2E:11:59:41:AA:44:06", "critical": false }, "authorityKeyIdentifier": { "value": "DA:2A:FE:B7:79:F2:4C:2C:0D:6B:5C:56:42:31:5D:0C:B7:7B:7D:FD", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "A1:57:74:1E:50:66:EB:DE:3D:F0:B9:35:98:FD:BA:C4:E6:2D:BC:BA:02:DD:AE:B9:2F:95:6A:7A:AA:21:1A:A5:D2:B1:89:D0:AE:EE:3E:39:F4:51:00:61:60:0E:AD:77:26:83:A2:1C:90:88:72:F4:81:48:04:3B:AB:A9:07:9C:8D:A9:91:98:02:9E:DA:C6:C6:88:34:9E:CD:8D:5B:B2:DF:BC:2B:6E:77:B7:75:42:EA:90:47:6C:69:CE:20:3D:D4:88:1E:BD:64:E3:0A:07:3B:04:60:04:56:5A:57:E6:62:74:49:35:E9:96:30:32:C1:B6:65:69:2C:C0:22:2C:97:F5:31:F7:21:98:5C:21:34:0C:72:7F:14:D2:BC:D7:CC:7B:4C:3B:DF:7A:B3:3D:28:8F:06:39:45:0D:3E:7F:A5:41:03:38:9C:BD:36:D7:DE:00:BB:5E:46:2D:73:C3:38:85:B1:0D:3E:C4:42:AE:15:03:6F:79:03:11:A1:B7:9F:9C:C9:3C:29:1A:58:88:92:BD:A4:69:2B:6A:02:53:F6:A7:5D:E9:A5:6F:E7:9B:48:DC:7E:7E:5E:36:6A:94:CB:54:AC:89:82:03:E3:D6:7F:39:83:18:80:10:4B:D6:21:C4:83:65:B8:C7:95:83:D0:6A:1A:22:65:84:9A:68" }, "key_size": 2048, "validity": { "not_valid_after": "2023-04-12 17:43:14", "not_valid_before": "2022-04-12 17:43:15" } } TASK [Load certificate YAML to cert_issued variable] *************************** ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "DA:2A:FE:B7:79:F2:4C:2C:0D:6B:5C:56:42:31:5D:0C:B7:7B:7D:FD" }, "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": "0F:9E:96:F2:64:EE:B9:F6:1F:AA:1C:4B:5A:2E:11:59:41:AA:44:06" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "A1:57:74:1E:50:66:EB:DE:3D:F0:B9:35:98:FD:BA:C4:E6:2D:BC:BA:02:DD:AE:B9:2F:95:6A:7A:AA:21:1A:A5:D2:B1:89:D0:AE:EE:3E:39:F4:51:00:61:60:0E:AD:77:26:83:A2:1C:90:88:72:F4:81:48:04:3B:AB:A9:07:9C:8D:A9:91:98:02:9E:DA:C6:C6:88:34:9E:CD:8D:5B:B2:DF:BC:2B:6E:77:B7:75:42:EA:90:47:6C:69:CE:20:3D:D4:88:1E:BD:64:E3:0A:07:3B:04:60:04:56:5A:57:E6:62:74:49:35:E9:96:30:32:C1:B6:65:69:2C:C0:22:2C:97:F5:31:F7:21:98:5C:21:34:0C:72:7F:14:D2:BC:D7:CC:7B:4C:3B:DF:7A:B3:3D:28:8F:06:39:45:0D:3E:7F:A5:41:03:38:9C:BD:36:D7:DE:00:BB:5E:46:2D:73:C3:38:85:B1:0D:3E:C4:42:AE:15:03:6F:79:03:11:A1:B7:9F:9C:C9:3C:29:1A:58:88:92:BD:A4:69:2B:6A:02:53:F6:A7:5D:E9:A5:6F:E7:9B:48:DC:7E:7E:5E:36:6A:94:CB:54:AC:89:82:03:E3:D6:7F:39:83:18:80:10:4B:D6:21:C4:83:65:B8:C7:95:83:D0:6A:1A:22:65:84:9A:68" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-04-12 17:43:14", "not_valid_before": "2022-04-12 17:43:15" } } }, "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/certid.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.065116", "end": "2022-04-12 17:43:35.185452", "rc": 0, "start": "2022-04-12 17:43:35.120336" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** ok: [sut] => { "changed": false } MSG: All assertions passed PLAY RECAP ********************************************************************* sut : ok=55 changed=10 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- ---^---^---^---^---^---