| 1 |
--- |
| 2 |
# Copyright (c) Ansible Project |
| 3 |
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 4 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
|
| 6 |
- name: Create CRL 1 (check mode) |
| 7 |
community.crypto.x509_crl: |
| 8 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 9 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 10 |
issuer: |
| 11 |
CN: Ansible |
| 12 |
last_update: 20191013000000Z |
| 13 |
next_update: 20191113000000Z |
| 14 |
revoked_certificates: |
| 15 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 16 |
revocation_date: 20191013000000Z |
| 17 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 18 |
revocation_date: 20191013000000Z |
| 19 |
reason: key_compromise |
| 20 |
reason_critical: true |
| 21 |
invalidity_date: 20191012000000Z |
| 22 |
- serial_number: 1234 |
| 23 |
revocation_date: 20191001000000Z |
| 24 |
check_mode: true |
| 25 |
register: crl_1_check |
| 26 |
|
| 27 |
- name: Create CRL 1 |
| 28 |
community.crypto.x509_crl: |
| 29 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 30 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 31 |
issuer: |
| 32 |
CN: Ansible |
| 33 |
last_update: 20191013000000Z |
| 34 |
next_update: 20191113000000Z |
| 35 |
revoked_certificates: |
| 36 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 37 |
revocation_date: 20191013000000Z |
| 38 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 39 |
revocation_date: 20191013000000Z |
| 40 |
reason: key_compromise |
| 41 |
reason_critical: true |
| 42 |
invalidity_date: 20191012000000Z |
| 43 |
- serial_number: 1234 |
| 44 |
revocation_date: 20191001000000Z |
| 45 |
register: crl_1 |
| 46 |
|
| 47 |
- ansible.builtin.assert: |
| 48 |
that: |
| 49 |
- crl_1_check is changed |
| 50 |
- crl_1 is changed |
| 51 |
|
| 52 |
- name: Retrieve CRL 1 infos |
| 53 |
community.crypto.x509_crl_info: |
| 54 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 55 |
register: crl_1_info_1 |
| 56 |
|
| 57 |
- name: Read ca-crl1.crl |
| 58 |
ansible.builtin.slurp: |
| 59 |
src: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 60 |
register: slurp |
| 61 |
|
| 62 |
- name: Retrieve CRL 1 infos via file content |
| 63 |
community.crypto.x509_crl_info: |
| 64 |
content: '{{ slurp.content | b64decode }}' |
| 65 |
register: crl_1_info_2 |
| 66 |
|
| 67 |
- name: Retrieve CRL 1 infos via file content (Base64) |
| 68 |
community.crypto.x509_crl_info: |
| 69 |
content: '{{ slurp.content }}' |
| 70 |
register: crl_1_info_3 |
| 71 |
|
| 72 |
- name: Create CRL 1 (idempotent, check mode) |
| 73 |
community.crypto.x509_crl: |
| 74 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 75 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 76 |
issuer: |
| 77 |
CN: Ansible |
| 78 |
last_update: 20191013000000Z |
| 79 |
next_update: 20191113000000Z |
| 80 |
revoked_certificates: |
| 81 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 82 |
revocation_date: 20191013000000Z |
| 83 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 84 |
revocation_date: 20191013000000Z |
| 85 |
reason: key_compromise |
| 86 |
reason_critical: true |
| 87 |
invalidity_date: 20191012000000Z |
| 88 |
- serial_number: 1234 |
| 89 |
revocation_date: 20191001000000Z |
| 90 |
check_mode: true |
| 91 |
register: crl_1_idem_check |
| 92 |
|
| 93 |
- name: Create CRL 1 (idempotent) |
| 94 |
community.crypto.x509_crl: |
| 95 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 96 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 97 |
issuer: |
| 98 |
CN: Ansible |
| 99 |
last_update: 20191013000000Z |
| 100 |
next_update: 20191113000000Z |
| 101 |
revoked_certificates: |
| 102 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 103 |
revocation_date: 20191013000000Z |
| 104 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 105 |
revocation_date: 20191013000000Z |
| 106 |
reason: key_compromise |
| 107 |
reason_critical: true |
| 108 |
invalidity_date: 20191012000000Z |
| 109 |
- serial_number: 1234 |
| 110 |
revocation_date: 20191001000000Z |
| 111 |
register: crl_1_idem |
| 112 |
|
| 113 |
- name: Read file |
| 114 |
ansible.builtin.slurp: |
| 115 |
src: '{{ remote_tmp_dir }}/{{ item }}' |
| 116 |
loop: |
| 117 |
- ca.key |
| 118 |
- cert-1.pem |
| 119 |
- cert-2.pem |
| 120 |
register: slurp |
| 121 |
|
| 122 |
- name: Create CRL 1 (idempotent with content and octet string serial, check mode) |
| 123 |
community.crypto.x509_crl: |
| 124 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 125 |
privatekey_content: "{{ slurp.results[0].content | b64decode }}" |
| 126 |
issuer: |
| 127 |
CN: Ansible |
| 128 |
last_update: 20191013000000Z |
| 129 |
next_update: 20191113000000Z |
| 130 |
serial_numbers: hex-octets |
| 131 |
revoked_certificates: |
| 132 |
- content: "{{ slurp.results[1].content | b64decode }}" |
| 133 |
revocation_date: 20191013000000Z |
| 134 |
- content: "{{ slurp.results[2].content | b64decode }}" |
| 135 |
revocation_date: 20191013000000Z |
| 136 |
reason: key_compromise |
| 137 |
reason_critical: true |
| 138 |
invalidity_date: 20191012000000Z |
| 139 |
- serial_number: 04:D2 |
| 140 |
revocation_date: 20191001000000Z |
| 141 |
check_mode: true |
| 142 |
register: crl_1_idem_content_check |
| 143 |
|
| 144 |
- name: Create CRL 1 (idempotent with content and octet string serial) |
| 145 |
community.crypto.x509_crl: |
| 146 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 147 |
privatekey_content: "{{ slurp.results[0].content | b64decode }}" |
| 148 |
issuer: |
| 149 |
CN: Ansible |
| 150 |
last_update: 20191013000000Z |
| 151 |
next_update: 20191113000000Z |
| 152 |
serial_numbers: hex-octets |
| 153 |
revoked_certificates: |
| 154 |
- content: "{{ slurp.results[1].content | b64decode }}" |
| 155 |
revocation_date: 20191013000000Z |
| 156 |
- content: "{{ slurp.results[2].content | b64decode }}" |
| 157 |
revocation_date: 20191013000000Z |
| 158 |
reason: key_compromise |
| 159 |
reason_critical: true |
| 160 |
invalidity_date: 20191012000000Z |
| 161 |
- serial_number: 04:D2 |
| 162 |
revocation_date: 20191001000000Z |
| 163 |
register: crl_1_idem_content |
| 164 |
|
| 165 |
- name: Create CRL 1 (format, check mode) |
| 166 |
community.crypto.x509_crl: |
| 167 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 168 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 169 |
format: der |
| 170 |
issuer: |
| 171 |
CN: Ansible |
| 172 |
last_update: 20191013000000Z |
| 173 |
next_update: 20191113000000Z |
| 174 |
revoked_certificates: |
| 175 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 176 |
revocation_date: 20191013000000Z |
| 177 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 178 |
revocation_date: 20191013000000Z |
| 179 |
reason: key_compromise |
| 180 |
reason_critical: true |
| 181 |
invalidity_date: 20191012000000Z |
| 182 |
- serial_number: 1234 |
| 183 |
revocation_date: 20191001000000Z |
| 184 |
check_mode: true |
| 185 |
register: crl_1_format_check |
| 186 |
|
| 187 |
- name: Create CRL 1 (format) |
| 188 |
community.crypto.x509_crl: |
| 189 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 190 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 191 |
format: der |
| 192 |
issuer: |
| 193 |
CN: Ansible |
| 194 |
last_update: 20191013000000Z |
| 195 |
next_update: 20191113000000Z |
| 196 |
revoked_certificates: |
| 197 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 198 |
revocation_date: 20191013000000Z |
| 199 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 200 |
revocation_date: 20191013000000Z |
| 201 |
reason: key_compromise |
| 202 |
reason_critical: true |
| 203 |
invalidity_date: 20191012000000Z |
| 204 |
- serial_number: 1234 |
| 205 |
revocation_date: 20191001000000Z |
| 206 |
register: crl_1_format |
| 207 |
|
| 208 |
- name: Create CRL 1 (format, idempotent, check mode) |
| 209 |
community.crypto.x509_crl: |
| 210 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 211 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 212 |
format: der |
| 213 |
issuer: |
| 214 |
CN: Ansible |
| 215 |
last_update: 20191013000000Z |
| 216 |
next_update: 20191113000000Z |
| 217 |
revoked_certificates: |
| 218 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 219 |
revocation_date: 20191013000000Z |
| 220 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 221 |
revocation_date: 20191013000000Z |
| 222 |
reason: key_compromise |
| 223 |
reason_critical: true |
| 224 |
invalidity_date: 20191012000000Z |
| 225 |
- serial_number: "1234" |
| 226 |
revocation_date: 20191001000000Z |
| 227 |
check_mode: true |
| 228 |
register: crl_1_format_idem_check |
| 229 |
|
| 230 |
- name: Create CRL 1 (format, idempotent) |
| 231 |
community.crypto.x509_crl: |
| 232 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 233 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 234 |
format: der |
| 235 |
issuer: |
| 236 |
CN: Ansible |
| 237 |
last_update: 20191013000000Z |
| 238 |
next_update: 20191113000000Z |
| 239 |
revoked_certificates: |
| 240 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 241 |
revocation_date: 20191013000000Z |
| 242 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 243 |
revocation_date: 20191013000000Z |
| 244 |
reason: key_compromise |
| 245 |
reason_critical: true |
| 246 |
invalidity_date: 20191012000000Z |
| 247 |
- serial_number: "1234" |
| 248 |
revocation_date: 20191001000000Z |
| 249 |
return_content: true |
| 250 |
register: crl_1_format_idem |
| 251 |
|
| 252 |
- name: Retrieve CRL 1 infos via file |
| 253 |
community.crypto.x509_crl_info: |
| 254 |
path: '{{ remote_tmp_dir }}/ca-crl1.crl' |
| 255 |
register: crl_1_info_4 |
| 256 |
|
| 257 |
- name: Read ca-crl1.crl |
| 258 |
ansible.builtin.slurp: |
| 259 |
src: "{{ remote_tmp_dir }}/ca-crl1.crl" |
| 260 |
register: content |
| 261 |
|
| 262 |
- name: Retrieve CRL 1 infos via file content (Base64) |
| 263 |
community.crypto.x509_crl_info: |
| 264 |
content: '{{ content.content }}' |
| 265 |
register: crl_1_info_5 |
| 266 |
|
| 267 |
- name: Create CRL 2 (check mode) |
| 268 |
community.crypto.x509_crl: |
| 269 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 270 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 271 |
issuer_ordered: |
| 272 |
- CN: Ansible |
| 273 |
- CN: CRL |
| 274 |
- countryName: US |
| 275 |
- CN: Test |
| 276 |
last_update: +0d |
| 277 |
next_update: +0d |
| 278 |
revoked_certificates: |
| 279 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 280 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 281 |
reason: key_compromise |
| 282 |
reason_critical: true |
| 283 |
invalidity_date: 20191012000000Z |
| 284 |
- serial_number: 1234 |
| 285 |
check_mode: true |
| 286 |
register: crl_2_check |
| 287 |
|
| 288 |
- name: Create CRL 2 |
| 289 |
community.crypto.x509_crl: |
| 290 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 291 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 292 |
issuer_ordered: |
| 293 |
- CN: Ansible |
| 294 |
- CN: CRL |
| 295 |
- countryName: US |
| 296 |
- CN: Test |
| 297 |
last_update: +0d |
| 298 |
next_update: +0d |
| 299 |
revoked_certificates: |
| 300 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 301 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 302 |
reason: key_compromise |
| 303 |
reason_critical: true |
| 304 |
invalidity_date: 20191012000000Z |
| 305 |
- serial_number: 1234 |
| 306 |
register: crl_2 |
| 307 |
|
| 308 |
- name: Create CRL 2 (idempotent, check mode) |
| 309 |
community.crypto.x509_crl: |
| 310 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 311 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 312 |
issuer_ordered: |
| 313 |
- CN: Ansible |
| 314 |
- CN: CRL |
| 315 |
- C: US |
| 316 |
- CN: Test |
| 317 |
last_update: +0d |
| 318 |
next_update: +0d |
| 319 |
revoked_certificates: |
| 320 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 321 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 322 |
reason: key_compromise |
| 323 |
reason_critical: true |
| 324 |
invalidity_date: 20191012000000Z |
| 325 |
- serial_number: 1234 |
| 326 |
ignore_timestamps: true |
| 327 |
check_mode: true |
| 328 |
register: crl_2_idem_check |
| 329 |
|
| 330 |
- name: Create CRL 2 (idempotent) |
| 331 |
community.crypto.x509_crl: |
| 332 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 333 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 334 |
issuer_ordered: |
| 335 |
- CN: Ansible |
| 336 |
- CN: CRL |
| 337 |
- countryName: US |
| 338 |
- CN: Test |
| 339 |
last_update: +0d |
| 340 |
next_update: +0d |
| 341 |
revoked_certificates: |
| 342 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 343 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 344 |
reason: key_compromise |
| 345 |
reason_critical: true |
| 346 |
invalidity_date: 20191012000000Z |
| 347 |
- serial_number: 1234 |
| 348 |
ignore_timestamps: true |
| 349 |
register: crl_2_idem |
| 350 |
|
| 351 |
- name: Create CRL 2 (idempotent update, check mode) |
| 352 |
community.crypto.x509_crl: |
| 353 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 354 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 355 |
issuer_ordered: |
| 356 |
- CN: Ansible |
| 357 |
- CN: CRL |
| 358 |
- countryName: US |
| 359 |
- CN: Test |
| 360 |
last_update: +0d |
| 361 |
next_update: +0d |
| 362 |
revoked_certificates: |
| 363 |
- serial_number: 1235 |
| 364 |
ignore_timestamps: true |
| 365 |
crl_mode: update |
| 366 |
check_mode: true |
| 367 |
register: crl_2_idem_update_change_check |
| 368 |
|
| 369 |
- name: Create CRL 2 (idempotent update) |
| 370 |
community.crypto.x509_crl: |
| 371 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 372 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 373 |
issuer_ordered: |
| 374 |
- CN: Ansible |
| 375 |
- CN: CRL |
| 376 |
- countryName: US |
| 377 |
- CN: Test |
| 378 |
last_update: +0d |
| 379 |
next_update: +0d |
| 380 |
revoked_certificates: |
| 381 |
- serial_number: 1235 |
| 382 |
ignore_timestamps: true |
| 383 |
crl_mode: update |
| 384 |
register: crl_2_idem_update_change |
| 385 |
|
| 386 |
- name: Create CRL 2 (idempotent update, check mode) |
| 387 |
community.crypto.x509_crl: |
| 388 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 389 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 390 |
issuer_ordered: |
| 391 |
- CN: Ansible |
| 392 |
- CN: CRL |
| 393 |
- countryName: US |
| 394 |
- CN: Test |
| 395 |
last_update: +0d |
| 396 |
next_update: +0d |
| 397 |
revoked_certificates: |
| 398 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 399 |
reason: key_compromise |
| 400 |
reason_critical: true |
| 401 |
invalidity_date: 20191012000000Z |
| 402 |
ignore_timestamps: true |
| 403 |
crl_mode: update |
| 404 |
check_mode: true |
| 405 |
register: crl_2_idem_update_check |
| 406 |
|
| 407 |
- name: Create CRL 2 (idempotent update) |
| 408 |
community.crypto.x509_crl: |
| 409 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 410 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 411 |
issuer_ordered: |
| 412 |
- CN: Ansible |
| 413 |
- CN: CRL |
| 414 |
- countryName: US |
| 415 |
- CN: Test |
| 416 |
last_update: +0d |
| 417 |
next_update: +0d |
| 418 |
revoked_certificates: |
| 419 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 420 |
reason: key_compromise |
| 421 |
reason_critical: true |
| 422 |
invalidity_date: 20191012000000Z |
| 423 |
ignore_timestamps: true |
| 424 |
crl_mode: update |
| 425 |
register: crl_2_idem_update |
| 426 |
|
| 427 |
- name: Create CRL 2 (changed timestamps, check mode) |
| 428 |
community.crypto.x509_crl: |
| 429 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 430 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 431 |
issuer_ordered: |
| 432 |
- CN: Ansible |
| 433 |
- CN: CRL |
| 434 |
- countryName: US |
| 435 |
- CN: Test |
| 436 |
last_update: +0d |
| 437 |
next_update: +0d |
| 438 |
revoked_certificates: |
| 439 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 440 |
reason: key_compromise |
| 441 |
reason_critical: true |
| 442 |
invalidity_date: 20191012000000Z |
| 443 |
ignore_timestamps: false |
| 444 |
crl_mode: update |
| 445 |
check_mode: true |
| 446 |
register: crl_2_change_check |
| 447 |
|
| 448 |
- name: Create CRL 2 (changed timestamps) |
| 449 |
community.crypto.x509_crl: |
| 450 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 451 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 452 |
issuer_ordered: |
| 453 |
- CN: Ansible |
| 454 |
- CN: CRL |
| 455 |
- countryName: US |
| 456 |
- CN: Test |
| 457 |
last_update: +0d |
| 458 |
next_update: +0d |
| 459 |
revoked_certificates: |
| 460 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 461 |
reason: key_compromise |
| 462 |
reason_critical: true |
| 463 |
invalidity_date: 20191012000000Z |
| 464 |
ignore_timestamps: false |
| 465 |
crl_mode: update |
| 466 |
return_content: true |
| 467 |
register: crl_2_change |
| 468 |
|
| 469 |
- name: Read ca-crl2.crl |
| 470 |
ansible.builtin.slurp: |
| 471 |
src: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 472 |
register: slurp_crl2_1 |
| 473 |
|
| 474 |
- name: Retrieve CRL 2 infos |
| 475 |
community.crypto.x509_crl_info: |
| 476 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 477 |
list_revoked_certificates: false |
| 478 |
register: crl_2_info_1 |
| 479 |
|
| 480 |
- name: Create CRL 2 (changed order, should be ignored) |
| 481 |
community.crypto.x509_crl: |
| 482 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 483 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 484 |
issuer: |
| 485 |
countryName: US |
| 486 |
CN: |
| 487 |
- Ansible |
| 488 |
- CRL |
| 489 |
- Test |
| 490 |
last_update: +0d |
| 491 |
next_update: +0d |
| 492 |
revoked_certificates: |
| 493 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 494 |
reason: key_compromise |
| 495 |
reason_critical: true |
| 496 |
invalidity_date: 20191012000000Z |
| 497 |
ignore_timestamps: true |
| 498 |
crl_mode: update |
| 499 |
return_content: true |
| 500 |
register: crl_2_change_order_ignore |
| 501 |
|
| 502 |
- name: Create CRL 2 (changed order) |
| 503 |
community.crypto.x509_crl: |
| 504 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 505 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 506 |
issuer_ordered: |
| 507 |
- CN: Ansible |
| 508 |
- countryName: US |
| 509 |
- CN: CRL |
| 510 |
- CN: Test |
| 511 |
last_update: +0d |
| 512 |
next_update: +0d |
| 513 |
revoked_certificates: |
| 514 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 515 |
reason: key_compromise |
| 516 |
reason_critical: true |
| 517 |
invalidity_date: 20191012000000Z |
| 518 |
ignore_timestamps: true |
| 519 |
crl_mode: update |
| 520 |
return_content: true |
| 521 |
register: crl_2_change_order |
| 522 |
|
| 523 |
- name: Read ca-crl2.crl |
| 524 |
ansible.builtin.slurp: |
| 525 |
src: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 526 |
register: slurp_crl2_2 |
| 527 |
|
| 528 |
- name: Retrieve CRL 2 infos again |
| 529 |
community.crypto.x509_crl_info: |
| 530 |
path: '{{ remote_tmp_dir }}/ca-crl2.crl' |
| 531 |
list_revoked_certificates: false |
| 532 |
register: crl_2_info_2 |
| 533 |
|
| 534 |
- name: Create CRL 3 |
| 535 |
community.crypto.x509_crl: |
| 536 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 537 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 538 |
issuer: |
| 539 |
CN: Ansible |
| 540 |
last_update: +0d |
| 541 |
next_update: +0d |
| 542 |
revoked_certificates: |
| 543 |
- serial_number: 1234 |
| 544 |
revocation_date: 20191001000000Z |
| 545 |
# * cryptography < 2.1 strips username and password from URIs. To avoid problems, we do |
| 546 |
# not pass usernames and passwords for URIs when the cryptography version is < 2.1. |
| 547 |
# * Python 3.5 before 3.5.8 rc 1 has a bug in urllib.parse.urlparse() that results in an |
| 548 |
# error if a Unicode netloc has a username or password included. |
| 549 |
# (https://github.com/ansible-collections/community.crypto/pull/436#issuecomment-1101737134) |
| 550 |
# This affects the Python 3.5 included in Ansible 2.9's default test container; to avoid |
| 551 |
# this, we also do not pass usernames and passwords for Python 3.5. |
| 552 |
issuer: |
| 553 |
- "DNS:ca.example.org" |
| 554 |
- "DNS:ffóò.ḃâŗ.çøṁ" |
| 555 |
- "email:foo@ḃâŗ.çøṁ" |
| 556 |
- "URI:https://admin:hunter2@ffóò.ḃâŗ.çøṁ/baz?foo=bar" |
| 557 |
- "URI:https://[email protected]ße.de" |
| 558 |
- "URI:https://straße.de:8080" |
| 559 |
- "URI:http://gefäß.org" |
| 560 |
- "URI:http://a:b@ä:1" |
| 561 |
issuer_critical: true |
| 562 |
register: crl_3 |
| 563 |
|
| 564 |
- name: Create CRL 3 (IDNA encoding) |
| 565 |
community.crypto.x509_crl: |
| 566 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 567 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 568 |
issuer: |
| 569 |
CN: Ansible |
| 570 |
last_update: +0d |
| 571 |
next_update: +0d |
| 572 |
revoked_certificates: |
| 573 |
- serial_number: 1234 |
| 574 |
revocation_date: 20191001000000Z |
| 575 |
issuer: |
| 576 |
- "DNS:ca.example.org" |
| 577 |
- "DNS:xn--ff-3jad.xn--2ca8uh37e.xn--7ca8a981n" |
| 578 |
- "email:[email protected]" |
| 579 |
- "URI:https://admin:[email protected]/baz?foo=bar" |
| 580 |
- "URI:https://[email protected]" |
| 581 |
- "URI:https://xn--strae-oqa.de:8080" |
| 582 |
- "URI:http://xn--gef-7kay.org" |
| 583 |
- "URI:http://a:b@xn--4ca:1" |
| 584 |
issuer_critical: true |
| 585 |
ignore_timestamps: true |
| 586 |
name_encoding: idna |
| 587 |
register: crl_3_idna |
| 588 |
|
| 589 |
- name: Create CRL 3 (Unicode encoding) |
| 590 |
community.crypto.x509_crl: |
| 591 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 592 |
privatekey_path: '{{ remote_tmp_dir }}/ca.key' |
| 593 |
issuer: |
| 594 |
CN: Ansible |
| 595 |
last_update: +0d |
| 596 |
next_update: +0d |
| 597 |
revoked_certificates: |
| 598 |
- serial_number: 1234 |
| 599 |
revocation_date: 20191001000000Z |
| 600 |
issuer: |
| 601 |
- "DNS:ca.example.org" |
| 602 |
- "DNS:ffóò.ḃâŗ.çøṁ" |
| 603 |
- "email:foo@ḃâŗ.çøṁ" |
| 604 |
- "URI:https://admin:hunter2@ffóò.ḃâŗ.çøṁ/baz?foo=bar" |
| 605 |
- "URI:https://[email protected]ße.de" |
| 606 |
- "URI:https://straße.de:8080" |
| 607 |
- "URI:http://gefäß.org" |
| 608 |
- "URI:http://a:b@ä:1" |
| 609 |
issuer_critical: true |
| 610 |
ignore_timestamps: true |
| 611 |
name_encoding: unicode |
| 612 |
register: crl_3_unicode |
| 613 |
|
| 614 |
- name: Retrieve CRL 3 infos |
| 615 |
community.crypto.x509_crl_info: |
| 616 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 617 |
list_revoked_certificates: true |
| 618 |
register: crl_3_info |
| 619 |
|
| 620 |
- name: Retrieve CRL 3 infos (IDNA encoding) |
| 621 |
community.crypto.x509_crl_info: |
| 622 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 623 |
name_encoding: idna |
| 624 |
list_revoked_certificates: true |
| 625 |
register: crl_3_info_idna |
| 626 |
|
| 627 |
- name: Retrieve CRL 3 infos (Unicode encoding) |
| 628 |
community.crypto.x509_crl_info: |
| 629 |
path: '{{ remote_tmp_dir }}/ca-crl3.crl' |
| 630 |
name_encoding: unicode |
| 631 |
list_revoked_certificates: true |
| 632 |
register: crl_3_info_unicode |
| 633 |
|
| 634 |
- name: Ed25519 and Ed448 tests (for cryptography >= 2.6) |
| 635 |
block: |
| 636 |
- name: Generate private keys |
| 637 |
community.crypto.openssl_privatekey: |
| 638 |
path: '{{ remote_tmp_dir }}/ca-{{ item }}.key' |
| 639 |
type: '{{ item }}' |
| 640 |
loop: |
| 641 |
- Ed25519 |
| 642 |
- Ed448 |
| 643 |
register: ed25519_ed448_privatekey |
| 644 |
ignore_errors: true |
| 645 |
|
| 646 |
- when: ed25519_ed448_privatekey is not failed |
| 647 |
block: |
| 648 |
|
| 649 |
- name: Create CRL |
| 650 |
community.crypto.x509_crl: |
| 651 |
path: '{{ remote_tmp_dir }}/ca-crl-{{ item }}.crl' |
| 652 |
privatekey_path: '{{ remote_tmp_dir }}/ca-{{ item }}.key' |
| 653 |
issuer: |
| 654 |
CN: Ansible |
| 655 |
last_update: 20191013000000Z |
| 656 |
next_update: 20191113000000Z |
| 657 |
revoked_certificates: |
| 658 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 659 |
revocation_date: 20191013000000Z |
| 660 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 661 |
revocation_date: 20191013000000Z |
| 662 |
reason: key_compromise |
| 663 |
reason_critical: true |
| 664 |
invalidity_date: 20191012000000Z |
| 665 |
- serial_number: 1234 |
| 666 |
revocation_date: 20191001000000Z |
| 667 |
register: ed25519_ed448_crl |
| 668 |
loop: |
| 669 |
- Ed25519 |
| 670 |
- Ed448 |
| 671 |
ignore_errors: true |
| 672 |
|
| 673 |
- name: Create CRL (idempotence) |
| 674 |
community.crypto.x509_crl: |
| 675 |
path: '{{ remote_tmp_dir }}/ca-crl-{{ item }}.crl' |
| 676 |
privatekey_path: '{{ remote_tmp_dir }}/ca-{{ item }}.key' |
| 677 |
issuer: |
| 678 |
CN: Ansible |
| 679 |
last_update: 20191013000000Z |
| 680 |
next_update: 20191113000000Z |
| 681 |
revoked_certificates: |
| 682 |
- path: '{{ remote_tmp_dir }}/cert-1.pem' |
| 683 |
revocation_date: 20191013000000Z |
| 684 |
- path: '{{ remote_tmp_dir }}/cert-2.pem' |
| 685 |
revocation_date: 20191013000000Z |
| 686 |
reason: key_compromise |
| 687 |
reason_critical: true |
| 688 |
invalidity_date: 20191012000000Z |
| 689 |
- serial_number: 1234 |
| 690 |
revocation_date: 20191001000000Z |
| 691 |
register: ed25519_ed448_crl_idempotence |
| 692 |
loop: |
| 693 |
- Ed25519 |
| 694 |
- Ed448 |
| 695 |
ignore_errors: true |
| 696 |
|
| 697 |
when: cryptography_version is version('3.3', '>=') |