danvaida.route53

Build Status Galaxy

Ansible Route53 Role

This role helps you create, update, and delete DNS zones and records in Route53.

Requirements

  • You need boto version 2.24.0 or higher.

Role Variables

  • route53_records_to_add: A list of DNS records you want to add. For details on the difference between a CNAME record and a Route53-specific alias record, check the official documentation here.

  • route53_records_to_remove: A list of DNS records you want to remove.

  • route53_zones_to_add: A list of DNS zones you want to create.

  • route53_zones_to_remove: A list of DNS zones you want to delete.

Dependencies

None.

Example Playbook

Here’s an example of how to use the role:

- hosts: localhost
  connection: local
  gather_facts: false
  become: false
  roles:
    - role: route53
      route53_zones_to_add:
        - zone: 'zone.xxx'
          comment: 'some comment'
          vpc_id: vpc-12345678
          vpc_region: 'eu-central-1'

      route53_records_to_add:
        - zone: 'zone.xxx'
          private_zone: true
          comment: 'zone 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'

Testing

If you want to run tests using Docker, follow these commands:

$ 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

To Do

  • Add tests for private zones.
Informazioni sul progetto

Creates, updates and deletes DNS records in Route53.

Installa
ansible-galaxy install danvaida.route53
Licenza
Unknown
Download
751
Proprietario
sysadmin & solutions architect