官术网_书友最值得收藏!

How to do it...

We can use the Route53 module for creating, retrieving, and deleting a Route53 record. In the following task, we have assumed that the DNS zone example.com belongs to us and has been registered with the AWS Route53 service:

  1. To create a Route53 record, do the following:
- name: Create Route53 record 
  route53: 
      state: present 
      zone: example.com 
      record: app.example.com 
      type: A 
      ttl: 7200 
      value: 
          - 1.1.1.1 
          - 2.2.2.2 
          - 3.3.3.3 
  tags: 
    - recipe2 
  1. To get an existing Route53 record, do the following:
- name: Get existing Route53 record 
  route53: 
    state: get 
    zone: example.com 
    record: dns.example.com 
    type: A 
    register: record 
  tags: 
    - recipe2 
  1. To delete a Route53 record, do the following:
- name: Delete existing Route53 record 
  route53: 
    state: absent 
    zone: example.com 
    record: "{{ record.set.record }}" 
    ttl: "{{ record.set.ttl }}" 
    type: "{{ record.set.type }}" 
    value: "{{ record.set.value }}" 
  tags: 
    - recipe2 
主站蜘蛛池模板: 昌吉市| 乡城县| 绩溪县| 广饶县| 六安市| 共和县| 沙洋县| 贡嘎县| 吉安县| 耿马| 屏山县| 横峰县| 闸北区| 保山市| 铜山县| 瑞昌市| 甘肃省| 赤城县| 高要市| 容城县| 彭州市| 宜兰市| 平阳县| 新安县| 于田县| 吉林市| 巫溪县| 万盛区| 军事| 涟水县| 天气| 奇台县| 会泽县| 韶山市| 通江县| 广安市| 龙门县| 泰安市| 新蔡县| 桑植县| 泰顺县|