ansible-playbook [core 2.12.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /tmp/tmpoau9jedf executable location = /usr/bin/ansible-playbook python version = 3.9.13 (main, May 18 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] jinja version = 2.11.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: tests_basic_self_signed.yml ****************************************** 2 plays in /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml PLAY [Issue simple self-signed certificate] ************************************ TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml:2 Wednesday 06 July 2022 05:34:57 +0000 (0:00:00.013) 0:00:00.013 ******** ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [linux-system-roles.certificate : Set version specific variables] ********* task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:2 Wednesday 06 July 2022 05:34:58 +0000 (0:00:01.059) 0:00:01.072 ******** included: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml for /cache/centos-7.qcow2c.snap TASK [linux-system-roles.certificate : Ensure ansible_facts used by role] ****** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml:2 Wednesday 06 July 2022 05:34:58 +0000 (0:00:00.025) 0:00:01.098 ******** ok: [/cache/centos-7.qcow2c.snap] TASK [linux-system-roles.certificate : Set platform/version specific variables] *** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml:8 Wednesday 06 July 2022 05:34:58 +0000 (0:00:00.428) 0:00:01.526 ******** skipping: [/cache/centos-7.qcow2c.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.yml) => { "ansible_facts": { "__certificate_default_directory": "/etc/pki/tls", "__certificate_packages": [ "python-pyasn1", "python-cryptography", "python-dbus" ] }, "ansible_included_var_files": [ "/tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/vars/CentOS_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.yml" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.9.yml", "skip_reason": "Conditional result was False" } TASK [linux-system-roles.certificate : Ensure certificate role dependencies are installed] *** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:5 Wednesday 06 July 2022 05:34:58 +0000 (0:00:00.051) 0:00:01.578 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "rc": 0, "results": [ "python2-pyasn1-0.1.9-7.el7.noarch providing python-pyasn1 is already installed", "python2-cryptography-1.7.2-2.el7.x86_64 providing python-cryptography is already installed", "dbus-python-1.1.1-9.el7.x86_64 providing python-dbus is already installed" ] } TASK [linux-system-roles.certificate : Ensure provider packages are installed] *** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:22 Wednesday 06 July 2022 05:35:00 +0000 (0:00:01.173) 0:00:02.751 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "rc": 0, "results": [ "certmonger-0.78.4-17.el7_9.x86_64 providing certmonger is already installed" ] } TASK [linux-system-roles.certificate : Ensure pre-scripts hooks directory exists] *** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:33 Wednesday 06 July 2022 05:35:00 +0000 (0:00:00.602) 0:00:03.354 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "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] *** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:59 Wednesday 06 July 2022 05:35:01 +0000 (0:00:00.488) 0:00:03.842 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "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] ***** task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:88 Wednesday 06 July 2022 05:35:01 +0000 (0:00:00.349) 0:00:04.192 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "enabled": true, "name": "certmonger", "state": "started", "status": { "ActiveEnterTimestamp": "Wed 2022-07-06 05:31:41 UTC", "ActiveEnterTimestampMonotonic": "172162297", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "systemd-journald.socket basic.target system.slice network.target syslog.target dbus.service", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Wed 2022-07-06 05:31:41 UTC", "AssertTimestampMonotonic": "172148815", "Before": "multi-user.target shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "BusName": "org.fedorahosted.certmonger", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "CollectMode": "inactive", "ConditionResult": "yes", "ConditionTimestamp": "Wed 2022-07-06 05:31:41 UTC", "ConditionTimestampMonotonic": "172148814", "Conflicts": "shutdown.target", "ControlGroup": "/system.slice/certmonger.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Certificate monitoring and PKI enrollment", "DevicePolicy": "auto", "EnvironmentFile": "/etc/sysconfig/certmonger (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "6078", "ExecMainStartTimestamp": "Wed 2022-07-06 05:31:41 UTC", "ExecMainStartTimestampMonotonic": "172149537", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/certmonger ; argv[]=/usr/sbin/certmonger -S -p /var/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", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "certmonger.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Wed 2022-07-06 05:31:41 UTC", "InactiveExitTimestampMonotonic": "172149585", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "65536", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "4096", "LimitNPROC": "14960", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "14960", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "6078", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "certmonger.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PIDFile": "/var/run/certmonger.pid", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target system.slice", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "WantedBy": "multi-user.target", "WatchdogTimestamp": "Wed 2022-07-06 05:31:41 UTC", "WatchdogTimestampMonotonic": "172162252", "WatchdogUSec": "0" } } TASK [linux-system-roles.certificate : Ensure certificate requests] ************ task path: /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:100 Wednesday 06 July 2022 05:35:02 +0000 (0:00:00.675) 0:00:04.867 ******** changed: [/cache/centos-7.qcow2c.snap] => (item={'name': 'mycert_basic_self_signed', 'dns': 'www.example.com', 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "name": "mycert_basic_self_signed" } } MSG: Certificate requested (new). META: role_complete for /cache/centos-7.qcow2c.snap META: ran handlers META: ran handlers PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* task path: /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml:13 Wednesday 06 July 2022 05:35:03 +0000 (0:00:00.976) 0:00:05.843 ******** ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [Verify each certificate] ************************************************* task path: /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml:27 Wednesday 06 July 2022 05:35:03 +0000 (0:00:00.716) 0:00:06.560 ******** included: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml for /cache/centos-7.qcow2c.snap => (item={'path': '/etc/pki/tls/certs/mycert_basic_self_signed.crt', 'key_path': '/etc/pki/tls/private/mycert_basic_self_signed.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] ***************************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:2 Wednesday 06 July 2022 05:35:03 +0000 (0:00:00.037) 0:00:06.597 ******** ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:6 Wednesday 06 July 2022 05:35:03 +0000 (0:00:00.028) 0:00:06.626 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "rc": 0, "results": [ "python3-3.6.8-18.el7.x86_64 providing python3 is already installed" ] } TASK [Install the package, force upgrade] ************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:11 Wednesday 06 July 2022 05:35:04 +0000 (0:00:00.588) 0:00:07.214 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip", "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] ****************************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:18 Wednesday 06 July 2022 05:35:05 +0000 (0:00:01.116) 0:00:08.330 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip", "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.1) 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] ***************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:26 Wednesday 06 July 2022 05:35:06 +0000 (0:00:00.796) 0:00:09.127 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1657085702.9713764, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "5549fc2b9b54f682caf0e99d67150eb651cb572a", "ctime": 1657085702.9673765, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 9668523, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1657085702.9673765, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_basic_self_signed.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "18446744073430069412", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:31 Wednesday 06 July 2022 05:35:06 +0000 (0:00:00.450) 0:00:09.578 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:37 Wednesday 06 July 2022 05:35:06 +0000 (0:00:00.034) 0:00:09.612 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:49 Wednesday 06 July 2022 05:35:06 +0000 (0:00:00.073) 0:00:09.685 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:55 Wednesday 06 July 2022 05:35:06 +0000 (0:00:00.045) 0:00:09.730 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1657085702.9183764, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "0cc3843420b54ec99c47a12cebc33dda241df367", "ctime": 1657085702.9673765, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 9668522, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1657085702.9673765, "nlink": 1, "path": "/etc/pki/tls/private/mycert_basic_self_signed.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1704, "uid": 0, "version": "1013576139", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:60 Wednesday 06 July 2022 05:35:07 +0000 (0:00:00.331) 0:00:10.062 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:66 Wednesday 06 July 2022 05:35:07 +0000 (0:00:00.033) 0:00:10.095 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:78 Wednesday 06 July 2022 05:35:07 +0000 (0:00:00.053) 0:00:10.149 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_basic_self_signed.crt" ], "delta": "0:00:00.261070", "end": "2022-07-06 05:35:08.053736", "rc": 0, "start": "2022-07-06 05:35:07.792666" } 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": "04:D3:33:36:41:11:87:4D:C1:1C:6E:04:29:A8:F8:46:73:21:4F:98", "critical": false }, "authorityKeyIdentifier": { "value": "02:AD:DA:38:F4:E2:5E:3D:60:C0:9D:C9:B6:8B:BA:75:33:70:48:A5", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "10:FC:39:6E:44:76:C1:B6:4D:CB:9D:56:B3:5E:2E:59:40:2C:D7:04:3A:63:15:4D:EF:C0:2F:17:74:30:E5:1B:E2:C9:38:14:BD:BB:FD:64:33:F8:1B:F6:F2:6A:7B:D6:05:62:90:0D:CA:1A:9F:C6:87:A8:2E:C4:1B:DC:4E:C8:FD:2C:38:68:2E:18:ED:81:77:44:AF:DD:55:63:C2:56:2B:DF:01:7E:C2:AE:79:1A:45:6F:D2:1B:03:D2:E9:11:66:6E:00:54:28:79:51:C2:F1:C0:AD:D5:B0:02:8E:72:BA:ED:6D:4E:20:EB:40:9E:46:75:9E:81:58:D5:D8:4C:D5:95:A8:8D:85:1A:4A:BD:34:C0:88:78:E3:6F:87:7D:97:3F:39:D4:9B:D1:5F:B8:E3:37:40:C9:AD:9A:D1:0D:A9:DA:E4:BF:C3:B3:66:FA:74:56:31:F3:92:9D:F4:9B:07:6B:0C:DD:5D:BE:1C:9B:49:43:61:05:E5:BE:89:36:F2:60:A9:BD:23:A3:45:AA:0F:90:B3:28:B2:2F:6F:16:3A:20:94:06:23:24:2A:EB:3C:4B:2B:D6:4B:C6:A0:8B:26:86:71:89:A5:1E:84:79:FD:3A:0D:6F:F5:DA:32:85:16:5F:EC:AC:5E:6D:0D:F6:19:C4:6E:C4:C1:7E:EB:B4" }, "key_size": 2048, "validity": { "not_valid_after": "2023-07-06 05:31:41", "not_valid_before": "2022-07-06 05:35:02" } } TASK [Load certificate YAML to cert_issued variable] *************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:83 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.712) 0:00:10.861 ******** ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "02:AD:DA:38:F4:E2:5E:3D:60:C0:9D:C9:B6:8B:BA:75:33:70:48:A5" }, "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": "04:D3:33:36:41:11:87:4D:C1:1C:6E:04:29:A8:F8:46:73:21:4F:98" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "10:FC:39:6E:44:76:C1:B6:4D:CB:9D:56:B3:5E:2E:59:40:2C:D7:04:3A:63:15:4D:EF:C0:2F:17:74:30:E5:1B:E2:C9:38:14:BD:BB:FD:64:33:F8:1B:F6:F2:6A:7B:D6:05:62:90:0D:CA:1A:9F:C6:87:A8:2E:C4:1B:DC:4E:C8:FD:2C:38:68:2E:18:ED:81:77:44:AF:DD:55:63:C2:56:2B:DF:01:7E:C2:AE:79:1A:45:6F:D2:1B:03:D2:E9:11:66:6E:00:54:28:79:51:C2:F1:C0:AD:D5:B0:02:8E:72:BA:ED:6D:4E:20:EB:40:9E:46:75:9E:81:58:D5:D8:4C:D5:95:A8:8D:85:1A:4A:BD:34:C0:88:78:E3:6F:87:7D:97:3F:39:D4:9B:D1:5F:B8:E3:37:40:C9:AD:9A:D1:0D:A9:DA:E4:BF:C3:B3:66:FA:74:56:31:F3:92:9D:F4:9B:07:6B:0C:DD:5D:BE:1C:9B:49:43:61:05:E5:BE:89:36:F2:60:A9:BD:23:A3:45:AA:0F:90:B3:28:B2:2F:6F:16:3A:20:94:06:23:24:2A:EB:3C:4B:2B:D6:4B:C6:A0:8B:26:86:71:89:A5:1E:84:79:FD:3A:0D:6F:F5:DA:32:85:16:5F:EC:AC:5E:6D:0D:F6:19:C4:6E:C4:C1:7E:EB:B4" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-07-06 05:31:41", "not_valid_before": "2022-07-06 05:35:02" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:87 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.076) 0:00:10.937 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:96 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.042) 0:00:10.980 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:105 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.029) 0:00:11.009 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:112 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.065) 0:00:11.075 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:125 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.068) 0:00:11.143 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:141 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.065) 0:00:11.209 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_basic_self_signed.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.055654", "end": "2022-07-06 05:35:08.771386", "rc": 0, "start": "2022-07-06 05:35:08.715732" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** task path: /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:150 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.371) 0:00:11.580 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-7.qcow2c.snap : ok=32 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Wednesday 06 July 2022 05:35:08 +0000 (0:00:00.081) 0:00:11.662 ******** =============================================================================== linux-system-roles.certificate : Ensure certificate role dependencies are installed --- 1.17s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:5 -- Install the package, force upgrade -------------------------------------- 1.12s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:11 ------------- Gathering Facts --------------------------------------------------------- 1.06s /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml:2 -------------------------- linux-system-roles.certificate : Ensure certificate requests ------------ 0.98s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:100 Install certreader ------------------------------------------------------ 0.80s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:18 ------------- Gathering Facts --------------------------------------------------------- 0.72s /tmp/tmpqiz1ijmo/tests/tests_basic_self_signed.yml:13 ------------------------- Parse certificate ------------------------------------------------------- 0.71s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:78 ------------- linux-system-roles.certificate : Ensure provider service is running ----- 0.68s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:88 - linux-system-roles.certificate : Ensure provider packages are installed --- 0.60s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:22 - Ensure python3 is installed --------------------------------------------- 0.59s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:6 -------------- linux-system-roles.certificate : Ensure pre-scripts hooks directory exists --- 0.49s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:33 - Retrieve certificate file stats ----------------------------------------- 0.45s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:26 ------------- linux-system-roles.certificate : Ensure ansible_facts used by role ------ 0.43s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/set_vars.yml:2 Retrieve auto-renew flag ------------------------------------------------ 0.37s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:141 ------------ linux-system-roles.certificate : Ensure post-scripts hooks directory exists --- 0.35s /tmp/tmpqiz1ijmo/tests/roles/linux-system-roles.certificate/tasks/main.yml:59 - Retrieve key file stats ------------------------------------------------- 0.33s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:55 ------------- Verify certificate auto-renew flag -------------------------------------- 0.08s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:150 ------------ Load certificate YAML to cert_issued variable --------------------------- 0.08s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:83 ------------- Verify certificate file owner and group --------------------------------- 0.07s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:37 ------------- Verify certificate Key Usage -------------------------------------------- 0.07s /tmp/tmpqiz1ijmo/tests/tasks/assert_certificate_parameters.yml:112 ------------ ansible-playbook [core 2.12.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /tmp/tmpoau9jedf executable location = /usr/bin/ansible-playbook python version = 3.9.13 (main, May 18 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] jinja version = 2.11.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: tests_basic_self_signed.yml ****************************************** 2 plays in /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml PLAY [Issue simple self-signed certificate] ************************************ TASK [Gathering Facts] ********************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml:2 Wednesday 06 July 2022 05:44:40 +0000 (0:00:00.014) 0:00:00.014 ******** ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [fedora.linux_system_roles.certificate : Set version specific variables] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:2 Wednesday 06 July 2022 05:44:42 +0000 (0:00:02.045) 0:00:02.059 ******** included: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/set_vars.yml for /cache/centos-7.qcow2c.snap TASK [fedora.linux_system_roles.certificate : Ensure ansible_facts used by role] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/set_vars.yml:2 Wednesday 06 July 2022 05:44:42 +0000 (0:00:00.026) 0:00:02.086 ******** ok: [/cache/centos-7.qcow2c.snap] TASK [fedora.linux_system_roles.certificate : Set platform/version specific variables] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/set_vars.yml:7 Wednesday 06 July 2022 05:44:43 +0000 (0:00:00.417) 0:00:02.504 ******** skipping: [/cache/centos-7.qcow2c.snap] => (item=RedHat.yml) => { "ansible_loop_var": "item", "changed": false, "item": "RedHat.yml", "skip_reason": "Conditional result was False" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS.yml", "skip_reason": "Conditional result was False" } ok: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.yml) => { "ansible_facts": { "__certificate_default_directory": "/etc/pki/tls", "__certificate_packages": [ "python-pyasn1", "python-cryptography", "python-dbus" ] }, "ansible_included_var_files": [ "/tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/vars/CentOS_7.yml" ], "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.yml" } skipping: [/cache/centos-7.qcow2c.snap] => (item=CentOS_7.9.yml) => { "ansible_loop_var": "item", "changed": false, "item": "CentOS_7.9.yml", "skip_reason": "Conditional result was False" } TASK [fedora.linux_system_roles.certificate : Ensure certificate role dependencies are installed] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:5 Wednesday 06 July 2022 05:44:43 +0000 (0:00:00.050) 0:00:02.555 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "rc": 0, "results": [ "python2-pyasn1-0.1.9-7.el7.noarch providing python-pyasn1 is already installed", "python2-cryptography-1.7.2-2.el7.x86_64 providing python-cryptography is already installed", "dbus-python-1.1.1-9.el7.x86_64 providing python-dbus is already installed" ] } TASK [fedora.linux_system_roles.certificate : Ensure provider packages are installed] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:22 Wednesday 06 July 2022 05:44:44 +0000 (0:00:01.191) 0:00:03.746 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "rc": 0, "results": [ "certmonger-0.78.4-17.el7_9.x86_64 providing certmonger is already installed" ] } TASK [fedora.linux_system_roles.certificate : Ensure pre-scripts hooks directory exists] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:33 Wednesday 06 July 2022 05:44:45 +0000 (0:00:00.597) 0:00:04.344 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "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 [fedora.linux_system_roles.certificate : Ensure post-scripts hooks directory exists] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:59 Wednesday 06 July 2022 05:44:45 +0000 (0:00:00.495) 0:00:04.839 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "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 [fedora.linux_system_roles.certificate : Ensure provider service is running] *** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:88 Wednesday 06 July 2022 05:44:45 +0000 (0:00:00.350) 0:00:05.190 ******** ok: [/cache/centos-7.qcow2c.snap] => (item=certmonger) => { "__certificate_provider": "certmonger", "ansible_loop_var": "__certificate_provider", "changed": false, "enabled": true, "name": "certmonger", "state": "started", "status": { "ActiveEnterTimestamp": "Wed 2022-07-06 05:41:20 UTC", "ActiveEnterTimestampMonotonic": "176677201", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "system.slice syslog.target systemd-journald.socket network.target basic.target dbus.service", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Wed 2022-07-06 05:41:20 UTC", "AssertTimestampMonotonic": "176662452", "Before": "multi-user.target shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "BusName": "org.fedorahosted.certmonger", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "CollectMode": "inactive", "ConditionResult": "yes", "ConditionTimestamp": "Wed 2022-07-06 05:41:20 UTC", "ConditionTimestampMonotonic": "176662451", "Conflicts": "shutdown.target", "ControlGroup": "/system.slice/certmonger.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Certificate monitoring and PKI enrollment", "DevicePolicy": "auto", "EnvironmentFile": "/etc/sysconfig/certmonger (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "6092", "ExecMainStartTimestamp": "Wed 2022-07-06 05:41:20 UTC", "ExecMainStartTimestampMonotonic": "176663195", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/certmonger ; argv[]=/usr/sbin/certmonger -S -p /var/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", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "certmonger.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Wed 2022-07-06 05:41:20 UTC", "InactiveExitTimestampMonotonic": "176663230", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "65536", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "4096", "LimitNPROC": "14960", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "14960", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "6092", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "certmonger.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PIDFile": "/var/run/certmonger.pid", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target system.slice", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "WantedBy": "multi-user.target", "WatchdogTimestamp": "Wed 2022-07-06 05:41:20 UTC", "WatchdogTimestampMonotonic": "176677056", "WatchdogUSec": "0" } } TASK [fedora.linux_system_roles.certificate : Ensure certificate requests] ***** task path: /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:99 Wednesday 06 July 2022 05:44:46 +0000 (0:00:00.699) 0:00:05.889 ******** changed: [/cache/centos-7.qcow2c.snap] => (item={'name': 'mycert_basic_self_signed', 'dns': 'www.example.com', 'ca': 'self-sign'}) => { "ansible_loop_var": "item", "changed": true, "item": { "ca": "self-sign", "dns": "www.example.com", "name": "mycert_basic_self_signed" } } MSG: Certificate requested (new). META: role_complete for /cache/centos-7.qcow2c.snap META: ran handlers META: ran handlers PLAY [Verify certificate] ****************************************************** TASK [Gathering Facts] ********************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml:13 Wednesday 06 July 2022 05:44:47 +0000 (0:00:00.971) 0:00:06.861 ******** ok: [/cache/centos-7.qcow2c.snap] META: ran handlers TASK [Verify each certificate] ************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml:27 Wednesday 06 July 2022 05:44:48 +0000 (0:00:00.723) 0:00:07.585 ******** included: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml for /cache/centos-7.qcow2c.snap => (item={'path': '/etc/pki/tls/certs/mycert_basic_self_signed.crt', 'key_path': '/etc/pki/tls/private/mycert_basic_self_signed.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] ***************************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:2 Wednesday 06 July 2022 05:44:48 +0000 (0:00:00.044) 0:00:07.629 ******** ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "__virtualenv_path": "/tmp/certificate-tests-venv" }, "changed": false } TASK [Ensure python3 is installed] ********************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:6 Wednesday 06 July 2022 05:44:48 +0000 (0:00:00.028) 0:00:07.658 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "rc": 0, "results": [ "python3-3.6.8-18.el7.x86_64 providing python3 is already installed" ] } TASK [Install the package, force upgrade] ************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:11 Wednesday 06 July 2022 05:44:49 +0000 (0:00:00.587) 0:00:08.245 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip", "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] ****************************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:18 Wednesday 06 July 2022 05:44:50 +0000 (0:00:01.146) 0:00:09.392 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/pip", "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.1) 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] ***************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:26 Wednesday 06 July 2022 05:44:51 +0000 (0:00:00.917) 0:00:10.309 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1657086287.2063508, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "f0a483a446b2e2a0aedee6e29ace38cf55f85016", "ctime": 1657086287.2023509, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 9668427, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1657086287.2023509, "nlink": 1, "path": "/etc/pki/tls/certs/mycert_basic_self_signed.crt", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1294, "uid": 0, "version": "18446744072543466251", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if certificate file exists] *************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:31 Wednesday 06 July 2022 05:44:51 +0000 (0:00:00.491) 0:00:10.800 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate file owner and group] ********************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:37 Wednesday 06 July 2022 05:44:51 +0000 (0:00:00.033) 0:00:10.834 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate permissions] ****************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:47 Wednesday 06 July 2022 05:44:51 +0000 (0:00:00.075) 0:00:10.909 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Retrieve key file stats] ************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:53 Wednesday 06 July 2022 05:44:51 +0000 (0:00:00.072) 0:00:10.981 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "stat": { "atime": 1657086287.1553507, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 8, "charset": "us-ascii", "checksum": "b4c8edb32ddd8daf17d90b0dad9bed13a9a7a16a", "ctime": 1657086287.2023509, "dev": 64769, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 9668426, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "text/plain", "mode": "0600", "mtime": 1657086287.2023509, "nlink": 1, "path": "/etc/pki/tls/private/mycert_basic_self_signed.key", "pw_name": "root", "readable": true, "rgrp": false, "roth": false, "rusr": true, "size": 1708, "uid": 0, "version": "1861769871", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false } } TASK [Verify if key file exists] *********************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:58 Wednesday 06 July 2022 05:44:52 +0000 (0:00:00.368) 0:00:11.350 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify key file owner and group] ***************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:64 Wednesday 06 July 2022 05:44:52 +0000 (0:00:00.035) 0:00:11.385 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Parse certificate] ******************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:74 Wednesday 06 July 2022 05:44:52 +0000 (0:00:00.080) 0:00:11.466 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": [ "/tmp/certificate-tests-venv/bin/certreader2json", "/etc/pki/tls/certs/mycert_basic_self_signed.crt" ], "delta": "0:00:00.283658", "end": "2022-07-06 05:44:52.735771", "rc": 0, "start": "2022-07-06 05:44:52.452113" } 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": "63:54:F9:52:D6:EF:7C:85:38:86:37:A7:0C:14:C4:BF:49:42:7A:C3", "critical": false }, "authorityKeyIdentifier": { "value": "86:6C:07:61:C3:94:A9:ED:89:69:38:21:CE:07:8B:89:13:CF:C0:06", "critical": false } }, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "A8:19:36:C9:79:03:E5:9E:BA:73:FB:B8:FA:3E:CA:2C:71:F1:E4:C1:24:85:79:2B:3C:FA:2C:A2:41:CE:E4:E0:EC:34:67:85:BF:DE:CF:27:EB:92:3B:79:7D:94:CE:57:E2:97:15:72:4A:9B:C2:AD:AA:84:B3:B4:CF:5B:FF:BD:7C:C3:27:7D:29:D4:AE:63:91:AA:9C:A8:0C:57:6E:98:D6:BA:FF:21:E2:98:F7:75:4B:13:5F:DB:E5:31:90:C5:95:C8:75:8F:02:B0:75:0C:C2:3A:DD:9B:7A:96:12:CF:3C:8C:DE:6E:9D:10:C0:F4:81:D8:3F:FF:F6:4E:AD:4C:F6:37:37:D0:B8:12:AD:96:7C:58:3B:20:0D:85:2B:5E:57:3B:3B:C0:99:46:DB:31:08:44:2E:81:C6:41:2D:42:8B:91:0C:4C:D9:CC:39:FB:1B:DD:8D:D7:8A:07:AB:07:93:0C:39:F1:5C:99:3F:B7:83:6E:2B:70:B9:D5:A2:76:87:1F:1D:A7:79:9F:FC:18:27:A3:8C:6F:47:52:93:9E:05:A9:6B:CB:16:EA:95:65:86:4F:31:1F:F4:6B:29:97:41:9D:44:91:73:1F:91:76:5B:53:BD:B9:27:5D:D7:9F:0B:97:AC:F2:AC:BD:75:19:FE:59:47:02:2D:C6:85:D4" }, "key_size": 2048, "validity": { "not_valid_after": "2023-07-06 05:41:20", "not_valid_before": "2022-07-06 05:44:47" } } TASK [Load certificate YAML to cert_issued variable] *************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:79 Wednesday 06 July 2022 05:44:52 +0000 (0:00:00.743) 0:00:12.210 ******** ok: [/cache/centos-7.qcow2c.snap] => { "ansible_facts": { "cert_issued": { "extensions": { "authorityKeyIdentifier": { "critical": false, "value": "86:6C:07:61:C3:94:A9:ED:89:69:38:21:CE:07:8B:89:13:CF:C0:06" }, "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": "63:54:F9:52:D6:EF:7C:85:38:86:37:A7:0C:14:C4:BF:49:42:7A:C3" } }, "key_size": 2048, "signature_algorithm": { "algorithm": "sha256WithRSAEncryption", "signature": "A8:19:36:C9:79:03:E5:9E:BA:73:FB:B8:FA:3E:CA:2C:71:F1:E4:C1:24:85:79:2B:3C:FA:2C:A2:41:CE:E4:E0:EC:34:67:85:BF:DE:CF:27:EB:92:3B:79:7D:94:CE:57:E2:97:15:72:4A:9B:C2:AD:AA:84:B3:B4:CF:5B:FF:BD:7C:C3:27:7D:29:D4:AE:63:91:AA:9C:A8:0C:57:6E:98:D6:BA:FF:21:E2:98:F7:75:4B:13:5F:DB:E5:31:90:C5:95:C8:75:8F:02:B0:75:0C:C2:3A:DD:9B:7A:96:12:CF:3C:8C:DE:6E:9D:10:C0:F4:81:D8:3F:FF:F6:4E:AD:4C:F6:37:37:D0:B8:12:AD:96:7C:58:3B:20:0D:85:2B:5E:57:3B:3B:C0:99:46:DB:31:08:44:2E:81:C6:41:2D:42:8B:91:0C:4C:D9:CC:39:FB:1B:DD:8D:D7:8A:07:AB:07:93:0C:39:F1:5C:99:3F:B7:83:6E:2B:70:B9:D5:A2:76:87:1F:1D:A7:79:9F:FC:18:27:A3:8C:6F:47:52:93:9E:05:A9:6B:CB:16:EA:95:65:86:4F:31:1F:F4:6B:29:97:41:9D:44:91:73:1F:91:76:5B:53:BD:B9:27:5D:D7:9F:0B:97:AC:F2:AC:BD:75:19:FE:59:47:02:2D:C6:85:D4" }, "subject": [ { "name": "commonName", "oid": "2.5.4.3", "value": "www.example.com" } ], "validity": { "not_valid_after": "2023-07-06 05:41:20", "not_valid_before": "2022-07-06 05:44:47" } } }, "changed": false } TASK [Verify certificate subject] ********************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:83 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.046) 0:00:12.256 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate SAN] ************************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:91 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.046) 0:00:12.303 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify key size] ********************************************************* task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:99 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.033) 0:00:12.337 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Key Usage] ******************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:106 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.046) 0:00:12.384 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Verify certificate Extended Key Usage] *********************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:118 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.047) 0:00:12.431 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed TASK [Retrieve auto-renew flag] ************************************************ task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:132 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.048) 0:00:12.480 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false, "cmd": "set -euo pipefail; getcert list -f /etc/pki/tls/certs/mycert_basic_self_signed.crt | grep 'auto-renew' | sed 's/^\\s\\+auto-renew: //g'", "delta": "0:00:00.058434", "end": "2022-07-06 05:44:53.390608", "rc": 0, "start": "2022-07-06 05:44:53.332174" } STDOUT: yes TASK [Verify certificate auto-renew flag] ************************************** task path: /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:141 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.379) 0:00:12.859 ******** ok: [/cache/centos-7.qcow2c.snap] => { "changed": false } MSG: All assertions passed META: ran handlers META: ran handlers PLAY RECAP ********************************************************************* /cache/centos-7.qcow2c.snap : ok=32 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Wednesday 06 July 2022 05:44:53 +0000 (0:00:00.054) 0:00:12.914 ******** =============================================================================== Gathering Facts --------------------------------------------------------- 2.05s /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml:2 -------------- fedora.linux_system_roles.certificate : Ensure certificate role dependencies are installed --- 1.19s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:5 Install the package, force upgrade -------------------------------------- 1.15s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:11 - fedora.linux_system_roles.certificate : Ensure certificate requests ----- 0.97s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:99 Install certreader ------------------------------------------------------ 0.92s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:18 - Parse certificate ------------------------------------------------------- 0.74s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:74 - Gathering Facts --------------------------------------------------------- 0.72s /tmp/tmp5ygcfjec/tests/certificate/tests_basic_self_signed.yml:13 ------------- fedora.linux_system_roles.certificate : Ensure provider service is running --- 0.70s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:88 fedora.linux_system_roles.certificate : Ensure provider packages are installed --- 0.60s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:22 Ensure python3 is installed --------------------------------------------- 0.59s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:6 -- fedora.linux_system_roles.certificate : Ensure pre-scripts hooks directory exists --- 0.50s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:33 Retrieve certificate file stats ----------------------------------------- 0.49s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:26 - fedora.linux_system_roles.certificate : Ensure ansible_facts used by role --- 0.42s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/set_vars.yml:2 Retrieve auto-renew flag ------------------------------------------------ 0.38s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:132 Retrieve key file stats ------------------------------------------------- 0.37s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:53 - fedora.linux_system_roles.certificate : Ensure post-scripts hooks directory exists --- 0.35s /tmp/tmpoau9jedf/ansible_collections/fedora/linux_system_roles/roles/certificate/tasks/main.yml:59 Verify key file owner and group ----------------------------------------- 0.08s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:64 - Verify certificate file owner and group --------------------------------- 0.08s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:37 - Verify certificate permissions ------------------------------------------ 0.07s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:47 - Verify certificate auto-renew flag -------------------------------------- 0.05s /tmp/tmp5ygcfjec/tests/certificate/tasks/assert_certificate_parameters.yml:141