|
44 | 44 | type:
|
45 | 45 | description:
|
46 | 46 | - The type of DNS record to create.
|
| 47 | + - Support for V(SSHFP) was added in release 9.2.0. See AWS Doc for more information |
| 48 | + U(https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html). |
47 | 49 | required: true
|
48 |
| - choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA' ] |
| 50 | + choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA', 'SSHFP' ] |
49 | 51 | type: str
|
50 | 52 | alias:
|
51 | 53 | description:
|
|
273 | 275 | ttl: 7200
|
274 | 276 | value: 1.1.1.1,2.2.2.2,3.3.3.3
|
275 | 277 | wait: true
|
| 278 | +
|
276 | 279 | - name: Update new.foo.com as an A record with a list of 3 IPs and wait until the changes have been replicated
|
277 | 280 | amazon.aws.route53:
|
278 | 281 | state: present
|
|
285 | 288 | - 2.2.2.2
|
286 | 289 | - 3.3.3.3
|
287 | 290 | wait: true
|
| 291 | +
|
288 | 292 | - name: Retrieve the details for new.foo.com
|
289 | 293 | amazon.aws.route53:
|
290 | 294 | state: get
|
291 | 295 | zone: foo.com
|
292 | 296 | record: new.foo.com
|
293 | 297 | type: A
|
294 | 298 | register: rec
|
| 299 | +
|
295 | 300 | - name: Delete new.foo.com A record using the results from the get command
|
296 | 301 | amazon.aws.route53:
|
297 | 302 | state: absent
|
|
300 | 305 | ttl: "{{ rec.set.ttl }}"
|
301 | 306 | type: "{{ rec.set.type }}"
|
302 | 307 | value: "{{ rec.set.value }}"
|
| 308 | +
|
303 | 309 | # Add an AAAA record. Note that because there are colons in the value
|
304 | 310 | # that the IPv6 address must be quoted. Also shows using the old form command=create.
|
305 | 311 | - name: Add an AAAA record
|
|
310 | 316 | type: AAAA
|
311 | 317 | ttl: 7200
|
312 | 318 | value: "::1"
|
| 319 | +
|
313 | 320 | # For more information on SRV records see:
|
314 | 321 | # https://en.wikipedia.org/wiki/SRV_record
|
315 | 322 | - name: Add a SRV record with multiple fields for a service on port 22222
|
|
319 | 326 | record: "_example-service._tcp.foo.com"
|
320 | 327 | type: SRV
|
321 | 328 | value: "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com"
|
| 329 | +
|
322 | 330 | # Note that TXT and SPF records must be surrounded
|
323 | 331 | # by quotes when sent to Route 53:
|
324 | 332 | - name: Add a TXT record.
|
|
329 | 337 | type: TXT
|
330 | 338 | ttl: 7200
|
331 | 339 | value: '"bar"'
|
| 340 | +
|
332 | 341 | - name: Add an alias record that points to an Amazon ELB
|
333 | 342 | amazon.aws.route53:
|
334 | 343 | state: present
|
|
338 | 347 | value: "{{ elb_dns_name }}"
|
339 | 348 | alias: true
|
340 | 349 | alias_hosted_zone_id: "{{ elb_zone_id }}"
|
| 350 | +
|
341 | 351 | - name: Retrieve the details for elb.foo.com
|
342 | 352 | amazon.aws.route53:
|
343 | 353 | state: get
|
344 | 354 | zone: foo.com
|
345 | 355 | record: elb.foo.com
|
346 | 356 | type: A
|
347 | 357 | register: rec
|
| 358 | +
|
348 | 359 | - name: Delete an alias record using the results from the get command
|
349 | 360 | amazon.aws.route53:
|
350 | 361 | state: absent
|
|
355 | 366 | value: "{{ rec.set.value }}"
|
356 | 367 | alias: true
|
357 | 368 | alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}"
|
| 369 | +
|
358 | 370 | - name: Add an alias record that points to an Amazon ELB and evaluates it health
|
359 | 371 | amazon.aws.route53:
|
360 | 372 | state: present
|
|
365 | 377 | alias: true
|
366 | 378 | alias_hosted_zone_id: "{{ elb_zone_id }}"
|
367 | 379 | alias_evaluate_target_health: true
|
| 380 | +
|
368 | 381 | - name: Add an AAAA record with Hosted Zone ID
|
369 | 382 | amazon.aws.route53:
|
370 | 383 | state: present
|
|
374 | 387 | type: AAAA
|
375 | 388 | ttl: 7200
|
376 | 389 | value: "::1"
|
| 390 | +
|
377 | 391 | - name: Use a routing policy to distribute traffic
|
378 | 392 | amazon.aws.route53:
|
379 | 393 | state: present
|
|
386 | 400 | identifier: "host1@www"
|
387 | 401 | weight: 100
|
388 | 402 | health_check: "d994b780-3150-49fd-9205-356abdd42e75"
|
| 403 | +
|
389 | 404 | - name: Add a CAA record (RFC 6844)
|
390 | 405 | amazon.aws.route53:
|
391 | 406 | state: present
|
|
396 | 411 | - 0 issue "ca.example.net"
|
397 | 412 | - 0 issuewild ";"
|
398 | 413 | - 0 iodef "mailto:[email protected]"
|
| 414 | +
|
399 | 415 | - name: Create a record with geo_location - country_code
|
400 | 416 | amazon.aws.route53:
|
401 | 417 | state: present
|
|
407 | 423 | ttl: 30
|
408 | 424 | geo_location:
|
409 | 425 | country_code: US
|
| 426 | +
|
410 | 427 | - name: Create a record with geo_location - subdivision code
|
411 | 428 | amazon.aws.route53:
|
412 | 429 | state: present
|
|
419 | 436 | geo_location:
|
420 | 437 | country_code: US
|
421 | 438 | subdivision_code: TX
|
| 439 | +
|
| 440 | +- name: Add new.foo.com as an SSHFP record |
| 441 | + amazon.aws.route53: |
| 442 | + state: present |
| 443 | + zone: test-zone.com |
| 444 | + record: new.foo.com |
| 445 | + type: SSHFP |
| 446 | + ttl: 7200 |
| 447 | + value: 1 1 11F1A11D1111112B111C1B11B1C11C11C1234567 |
| 448 | +
|
| 449 | +- name: Delete new.foo.com as an SSHFP record |
| 450 | + amazon.aws.route53: |
| 451 | + state: absent |
| 452 | + zone: test-zone.com |
| 453 | + record: new.foo.com |
| 454 | + type: SSHFP |
422 | 455 | """
|
423 | 456 |
|
424 | 457 | from operator import itemgetter
|
@@ -558,7 +591,7 @@ def main():
|
558 | 591 | type=dict(
|
559 | 592 | type="str",
|
560 | 593 | required=True,
|
561 |
| - choices=["A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"], |
| 594 | + choices=["A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SPF", "SSHFP", "SRV", "TXT"], |
562 | 595 | ),
|
563 | 596 | alias=dict(type="bool"),
|
564 | 597 | alias_hosted_zone_id=dict(type="str"),
|
|
0 commit comments