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

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 
主站蜘蛛池模板: 德令哈市| 怀远县| 南充市| 商都县| 普定县| 马尔康县| 鄂托克旗| 赤水市| 新干县| 永靖县| 含山县| 静宁县| 凤阳县| 揭东县| 桃园市| 浦县| 安龙县| SHOW| 富川| 祁阳县| 昭觉县| 宁强县| 苏尼特左旗| 凤山县| 旬邑县| 禹州市| 上饶县| 全南县| 乌拉特后旗| 新建县| 临泽县| 泸溪县| 漯河市| 大庆市| 扶绥县| 农安县| 洛隆县| 南康市| 成武县| 昌黎县| 隆德县|