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

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 
主站蜘蛛池模板: 文登市| 西盟| 文成县| 临猗县| 大关县| 长兴县| 湘乡市| 枣强县| 开化县| 昭通市| 惠水县| 曲阳县| 绥宁县| 马尔康县| 林口县| 宝坻区| 嵊州市| 蓬溪县| 昌宁县| 安宁市| 庄浪县| 威远县| 许昌市| 吴旗县| 墨江| 家居| 林西县| 呼伦贝尔市| 东平县| 藁城市| 西充县| 六安市| 临武县| 邯郸县| 邛崃市| 四平市| 察隅县| 丹阳市| 米泉市| 濉溪县| 巧家县|