# 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:28:24 +0000 (0:00:00.021) 0:00:00.021 ******* ok: [sut] TASK [linux-system-roles.certificate : Set version specific variables] ********* Thursday 18 August 2022 22:28:25 +0000 (0:00:01.269) 0:00:01.291 ******* 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:28:25 +0000 (0:00:00.042) 0:00:01.334 ******* ok: [sut] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** Thursday 18 August 2022 22:28:25 +0000 (0:00:00.447) 0:00:01.781 ******* 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:28:26 +0000 (0:00:00.061) 0:00:01.843 ******* 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:28:29 +0000 (0:00:03.474) 0:00:05.317 ******* 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:28:33 +0000 (0:00:04.017) 0:00:09.335 ******* 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:28:34 +0000 (0:00:00.489) 0:00:09.824 ******* 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:28:34 +0000 (0:00:00.295) 0:00:10.120 ******* changed: [sut] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": true, "enabled": true, "name": "certmonger", "state": "started", "status": { "ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "dbus.service system.slice sysinit.target network.target syslog.target basic.target systemd-journald.socket dbus.socket", "AllowIsolate": "no", "AllowedCPUs": "", "AllowedMemoryNodes": "", "AmbientCapabilities": "", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "BusName": "org.fedorahosted.certmonger", "CPUAccounting": "no", "CPUAffinity": "", "CPUAffinityFromNUMA": "no", "CPUQuotaPerSecUSec": "infinity", "CPUQuotaPeriodUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "[not set]", "CPUUsageNSec": "[not set]", "CPUWeight": "[not set]", "CacheDirectoryMode": "0755", "CanFreeze": "yes", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "Certificate monitoring and PKI enrollment", "DevicePolicy": "auto", "DynamicUser": "no", "EffectiveCPUs": "", "EffectiveMemoryNodes": "", "EnvironmentFiles": "/etc/sysconfig/certmonger (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/certmonger ; argv[]=/usr/sbin/certmonger -S -p /run/certmonger.pid -n $OPTS ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/usr/lib/systemd/system/certmonger.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "[not set]", "IPAccounting": "no", "IPEgressBytes": "18446744073709551615", "IPEgressPackets": "18446744073709551615", "IPIngressBytes": "18446744073709551615", "IPIngressPackets": "18446744073709551615", "Id": "certmonger.service", "IgnoreOnIsolate": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobRunningTimeoutUSec": "infinity", "JobTimeoutAction": "none", "JobTimeoutUSec": "infinity", "KeyringMode": "private", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "infinity", "LimitASSoft": "infinity", "LimitCORE": "infinity", "LimitCORESoft": "0", "LimitCPU": "infinity", "LimitCPUSoft": "infinity", "LimitDATA": "infinity", "LimitDATASoft": "infinity", "LimitFSIZE": "infinity", "LimitFSIZESoft": "infinity", "LimitLOCKS": "infinity", "LimitLOCKSSoft": "infinity", "LimitMEMLOCK": "65536", "LimitMEMLOCKSoft": "65536", "LimitMSGQUEUE": "819200", "LimitMSGQUEUESoft": "819200", "LimitNICE": "0", "LimitNICESoft": "0", "LimitNOFILE": "262144", "LimitNOFILESoft": "1024", "LimitNPROC": "14143", "LimitNPROCSoft": "14143", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "14143", "LimitSIGPENDINGSoft": "14143", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "MemoryAccounting": "yes", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "MountFlags": "", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAMask": "", "NUMAPolicy": "n/a", "Names": "certmonger.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PIDFile": "/run/certmonger.pid", "PartOf": "dbus.service", "PermissionsStartOnly": "no", "Perpetual": "no", "PrivateDevices": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "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:28:35 +0000 (0:00:01.315) 0:00:11.436 ******* changed: [sut] => (item={'name': 'mycert_run_hooks', 'dns': 'www.example.com', 'ca': 'self-sign', 'run_before': 'touch /etc/pki/before_cert.tmp\n', 'run_after': 'touch /etc/pki/after_cert.tmp\n'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "name": "mycert_run_hooks", "run_after": "touch /etc/pki/after_cert.tmp\n", "run_before": "touch /etc/pki/before_cert.tmp\n" } } MSG: Certificate requested (new). Pre/Post run hooks updated. PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* Thursday 18 August 2022 22:28:37 +0000 (0:00:02.002) 0:00:13.438 ******* ok: [sut] TASK [Verify each certificate] ************************************************* Thursday 18 August 2022 22:28:38 +0000 (0:00:00.748) 0:00:14.187 ******* 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_run_hooks.crt', 'key_path': '/etc/pki/tls/private/mycert_run_hooks.key', 'subject': [{'name': 'commonName', 'oid': '2.5.4.3', 'value': 'www.example.com'}], 'subject_alt_name': [{'name': 'DNS', 'value': 'www.example.com'}]}) TASK [Set virtualenv_path] ***************************************************** Thursday 18 August 2022 22:28:38 +0000 (0:00:00.067) 0:00:14.254 ******* ok: [sut] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* Thursday 18 August 2022 22:28:38 +0000 (0:00:00.050) 0:00:14.305 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install the package, force upgrade] ************************************** Thursday 18 August 2022 22:28:40 +0000 (0:00:01.721) 0:00:16.027 ******* 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:28:45 +0000 (0:00:05.204) 0:00:21.231 ******* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [Install certreader] ****************************************************** Thursday 18 August 2022 22:28:47 +0000 (0:00:01.689) 0:00:22.920 ******* 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:28:51 +0000 (0:00:04.200) 0:00:27.121 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861716.4713998, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "03e3b76af086050245dbb8427228077c74746e59", "ctime": 1660861716.4683998, "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": 1660861716.4683998, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_run_hooks.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "143236459", "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:28:51 +0000 (0:00:00.455) 0:00:27.576 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* Thursday 18 August 2022 22:28:51 +0000 (0:00:00.049) 0:00:27.625 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** Thursday 18 August 2022 22:28:51 +0000 (0:00:00.087) 0:00:27.713 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* Thursday 18 August 2022 22:28:52 +0000 (0:00:00.098) 0:00:27.812 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861716.4024007, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "447e8365a106ef2bbdcb65add1e8cc6f73b9a0b6", "ctime": 1660861716.4683998, "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": 1660861716.4683998, "nlink": 1, "path": "/etc/pki/tls/private/mycert_run_hooks.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "2838583431", "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:28:52 +0000 (0:00:00.306) 0:00:28.119 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** Thursday 18 August 2022 22:28:52 +0000 (0:00:00.050) 0:00:28.169 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* Thursday 18 August 2022 22:28:52 +0000 (0:00:00.075) 0:00:28.244 ******* ok: [sut] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_run_hooks.crt" ], "delta": "0:00:00.333581", "end": "2022-08-18 22:28:53.179673", "rc": 0, "start": "2022-08-18 22:28:52.846092" } 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": "35:7D:D5:A1:92:31:BC:C6:EB:7C:CE:43:E9:37:04:6F:FB:55:4A:93", "critical": false }, "authorityKeyIdentifier": { "value": "41:54:80:54:BD:A8:A0:25:E4:12:A2:F7:19:17:8B:3A:F3:ED:1D:9C", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "48:D7:0F:67:1A:94:BE:59:BB:EA:4D:A4:E1:C0:B0:37:03:5B:36:53:7C:3D:51:17:64:C5:94:D4:FD:06:3D:A2:79:D3:21:D3:F8:52:F7:79:CC:D3:C8:ED:58:F1:AB:41:FF:15:41:9B:24:60:E1:DE:3C:06:9E:1B:49:AD:6D:82:A5:62:D0:E8:46:7F:49:9A:5C:53:DA:5C:17:CE:1E:A9:23:CA:B1:36:6E:55:50:FA:D2:5C:1E:5D:2D:12:1A:9F:FD:B6:B2:95:E0:3E:34:B5:AA:BF:9A:9C:C5:59:B2:76:59:1D:F7:84:CF:0E:59:D3:94:3A:B0:E7:0B:87:3F:F1:16:03:C8:6C:36:BB:5C:B5:59:61:B0:15:06:49:1D:C0:A9:F5:8E:E5:3D:42:D4:BB:8D:B9:5E:BB:4F:B3:0E:31:98:94:FE:C5:52:70:C0:88:80:B1:1F:62:46:44:14:16:09:FF:EA:06:36:DF:3D:48:50:4F:FB:87:BC:CE:57:4E:7C:19:DB:63:82:29:1B:0D:B7:7C:AD:3E:D5:CE:72:76:E0:F5:1C:41:B6:75:5F:79:E1:76:A2:7B:1D:AB:8E:52:AE:05:C5:44:3D:95:F4:1F:59:50:6A:83:5A:5D:64:7A:A0:AA:56:D0:E2:90:C0:0A:E3:C1:DC:41:26:F3:FF:57" }, "key_size": 2048, "validity": { "not_valid_after": "2023-08-18 22:28:35", "not_valid_before": "2022-08-18 22:28:36" } } 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:28:53 +0000 (0:00:00.757) 0:00:29.002 ******* ok: [sut] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "41:54:80:54:BD:A8:A0:25:E4:12:A2:F7:19:17:8B:3A:F3:ED:1D:9C" }, "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": "35:7D:D5:A1:92:31:BC:C6:EB:7C:CE:43:E9:37:04:6F:FB:55:4A:93" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "48:D7:0F:67:1A:94:BE:59:BB:EA:4D:A4:E1:C0:B0:37:03:5B:36:53:7C:3D:51:17:64:C5:94:D4:FD:06:3D:A2:79:D3:21:D3:F8:52:F7:79:CC:D3:C8:ED:58:F1:AB:41:FF:15:41:9B:24:60:E1:DE:3C:06:9E:1B:49:AD:6D:82:A5:62:D0:E8:46:7F:49:9A:5C:53:DA:5C:17:CE:1E:A9:23:CA:B1:36:6E:55:50:FA:D2:5C:1E:5D:2D:12:1A:9F:FD:B6:B2:95:E0:3E:34:B5:AA:BF:9A:9C:C5:59:B2:76:59:1D:F7:84:CF:0E:59:D3:94:3A:B0:E7:0B:87:3F:F1:16:03:C8:6C:36:BB:5C:B5:59:61:B0:15:06:49:1D:C0:A9:F5:8E:E5:3D:42:D4:BB:8D:B9:5E:BB:4F:B3:0E:31:98:94:FE:C5:52:70:C0:88:80:B1:1F:62:46:44:14:16:09:FF:EA:06:36:DF:3D:48:50:4F:FB:87:BC:CE:57:4E:7C:19:DB:63:82:29:1B:0D:B7:7C:AD:3E:D5:CE:72:76:E0:F5:1C:41:B6:75:5F:79:E1:76:A2:7B:1D:AB:8E:52:AE:05:C5:44:3D:95:F4:1F:59:50:6A:83:5A:5D:64:7A:A0:AA:56:D0:E2:90:C0:0A:E3:C1:DC:41:26:F3:FF:57" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-08-18 22:28:35", "not_valid_before": "2022-08-18 22:28:36" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** Thursday 18 August 2022 22:28:53 +0000 (0:00:00.109) 0:00:29.111 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** Thursday 18 August 2022 22:28:53 +0000 (0:00:00.130) 0:00:29.242 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* Thursday 18 August 2022 22:28:53 +0000 (0:00:00.054) 0:00:29.296 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** Thursday 18 August 2022 22:28:53 +0000 (0:00:00.068) 0:00:29.364 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** Thursday 18 August 2022 22:28:53 +0000 (0:00:00.100) 0:00:29.465 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ Thursday 18 August 2022 22:28:53 +0000 (0:00:00.136) 0:00:29.601 ******* ok: [sut] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_run_hooks.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.062691", "end": "2022-08-18 22:28:54.136614", "rc": 0, "start": "2022-08-18 22:28:54.073923" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** Thursday 18 August 2022 22:28:54 +0000 (0:00:00.364) 0:00:29.965 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Get certificate timestamp] *********************************************** Thursday 18 August 2022 22:28:54 +0000 (0:00:00.105) 0:00:30.071 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861716.4713998, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "03e3b76af086050245dbb8427228077c74746e59", "ctime": 1660861716.4683998, "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": 1660861716.4683998, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_run_hooks.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "143236459", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Get pre-run file timestamp] ********************************************** Thursday 18 August 2022 22:28:54 +0000 (0:00:00.304) 0:00:30.376 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861716.4643998, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "ctime": 1660861716.4643998, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 190, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "inode/x-empty", "mode": "0600", "mtime": 1660861716.4643998, "nlink": 1, "path": "/etc/pki/before_cert.tmp", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 0, "uid": 0, "version": "3684390640", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Get post-run file timestamp] ********************************************* Thursday 18 August 2022 22:28:54 +0000 (0:00:00.342) 0:00:30.719 ******* ok: [sut] => { "changed": false, "stat": { "atime": 1660861716.510399, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "binary", "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "ctime": 1660861716.510399, "dev": 51715, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 1483, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "inode/x-empty", "mode": "0600", "mtime": 1660861716.510399, "nlink": 1, "path": "/etc/pki/after_cert.tmp", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 0, "uid": 0, "version": "395001565", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Assert file created before cert] ***************************************** Thursday 18 August 2022 22:28:55 +0000 (0:00:00.310) 0:00:31.029 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Assert file created after cert] ****************************************** Thursday 18 August 2022 22:28:55 +0000 (0:00:00.095) 0:00:31.125 ******* ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Get the ansible_managed comment in pre/post-scripts] ********************* Thursday 18 August 2022 22:28:55 +0000 (0:00:00.089) 0:00:31.215 ******* changed: [sut] => { "changed": true, "cmd": [ "find", "/etc/certmonger/pre-scripts", "/etc/certmonger/post-scripts", "-type", "f", "-exec", "grep", "^# Ansible managed", "{}", ";" ], "delta": "0:00:00.006414", "end": "2022-08-18 22:28:55.653358", "rc": 0, "start": "2022-08-18 22:28:55.646944" } STDOUT: # Ansible managed # Ansible managed TASK [Verify the ansible_managed comment in pre/post-scripts] ****************** Thursday 18 August 2022 22:28:55 +0000 (0:00:00.252) 0:00:31.467 ******* ok: [sut] => { "changed": false } MSG: All assertions passed PLAY RECAP ********************************************************************* sut : ok=39 changed=9 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Thursday 18 August 2022 22:28:55 +0000 (0:00:00.081) 0:00:31.548 ******* =============================================================================== Install the package, force upgrade -------------------------------------- 5.20s Install certreader ------------------------------------------------------ 4.20s linux-system-roles.certificate : Ensure provider packages are installed --- 4.02s linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 3.47s linux-system-roles.certificate : Ensure certificate requests ------------ 2.00s Ensure python3 is installed --------------------------------------------- 1.72s Ensure Python's cryptography is installed ------------------------------- 1.69s linux-system-roles.certificate : Ensure provider service is running ----- 1.32s Gathering Facts --------------------------------------------------------- 1.27s Parse certificate ------------------------------------------------------- 0.76s Gathering Facts --------------------------------------------------------- 0.75s linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.49s Retrieve certificate file stats ----------------------------------------- 0.46s linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.45s Retrieve auto-renew flag ------------------------------------------------ 0.36s Get pre-run file timestamp ---------------------------------------------- 0.34s Get post-run file timestamp --------------------------------------------- 0.31s Retrieve key file stats ------------------------------------------------- 0.31s Get certificate timestamp ----------------------------------------------- 0.30s linux-system-roles.certificate : Ensure post-scripts hooks directory exists --- 0.30s ---^---^---^---^---^--- # 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. ---^---^---^---^---^---