danvaida.route53

构建状态 银河

Ansible Route53 角色

在 Route53 中创建、更新和删除 DNS 区域和记录。

要求

  • boto >= 2.24.0

角色变量

  • route53_records_to_add: 要添加的 DNS 区域记录列表。关于 CNAME 记录和 Route53 特有的 alias 记录的区别,请参见官方文档 这里

  • route53_records_to_remove: 要删除的 DNS 区域记录列表。

  • route53_zones_to_add: 要添加的 DNS 区域列表。

  • route53_zones_to_remove: 要删除的 DNS 区域列表。

依赖

无。

示例 Playbook

- hosts: localhost
  connection: local
  gather_facts: False
  become: False
  roles:
    - role: route53
      route53_zones_to_add:
        - zone: 'zone.xxx'
          comment: '一些评论'
          vpc_id: vpc-12345678
          vpc_region: 'eu-central-1'

      route53_records_to_add:
        - zone: 'zone.xxx'
          private_zone: True
          comment: '区域评论'
          records:
            - record: 'in.the.zone.xxx'
              type: A
              ttl: 600
              value: '1.1.1.1'

            - record: 'by.the.zone.xxx'
              type: CNAME
              ttl: 300
              value: 'in.the.zone.xxx'

            - record: 'to.the.zone.xxx'
              type: A
              value: 'in.the.zone.xxx.'
              alias: True
              alias_hosted_zone_id: 'ABCD1234567890'

      route53_records_to_remove:
        - zone: 'zone.xxx'
          private_zone: True
          records:
            - record: 'in.the.zone.xxx'
              type: A
              ttl: 600
              value: '1.1.1.1'

            - record: 'by.the.zone.xxx'
              type: CNAME
              ttl: 300
              value: 'in.the.zone.xxx'

            - record: 'to.the.zone.xxx'
              type: A
              value: 'in.the.zone.xxx'
              alias: True
              alias_hosted_zone_id: 'ABCD1234567890'

      route53_zones_to_remove:
        - zone: 'zone.xxx'

测试

如果您想在提供的 Docker 环境中运行测试,请执行以下命令:

$ cd /path/to/ansible-roles/route53
$ docker build -t ansible-roles-test tests/support
$ docker run --rm -it \
  -v $PWD:/etc/ansible/roles/route53 \
  --env AWS_ACCESS_KEY=$AWS_ACCESS_KEY \
  --env AWS_SECRET_KEY=$AWS_SECRET_KEY \
  --env AWS_REGION=$AWS_REGION \
  --workdir /etc/ansible/roles/route53/tests \
  ansible-roles-test

待办事项

  • 为私有区域添加集成测试
关于项目

Creates, updates and deletes DNS records in Route53.

安装
ansible-galaxy install danvaida.route53
许可证
Unknown
下载
751
拥有者
sysadmin & solutions architect