Git Product home page Git Product logo

ansible-role-cloudflare's Introduction

Cloudflare

Cloudflare DNS records managment role

Requirements

Requires Cloudflare account and admin API key.

Role Variables

Variable Description Default value Required
cloudflare_account_email Account email. none Yes
cloudflare_account_api_token Account API token. You can obtain your API key from the bottom of the Cloudflare 'My Account' page, found here: https://dash.cloudflare.com/ none Yes
cloudflare_dns_records.zone DNS zone to mange. none Yes
cloudflare_dns_records.records DNS record to mange (described below). none Yes

cloudflare_dns_records.records (https://docs.ansible.com/ansible/latest/modules/cloudflare_dns_module.html#id3)

Key Description Default value Required
name DNS name @ No
type The type of DNS record to create. none If state: present
value The record value as quoted string or unqoted IP. none If state: present
priority Record priority. 1 Required for type: MX and type: SRV
ttl The TTL to give the new record. Must be between 120 and 2,147,483,647 seconds, or 1 for automatic. 1 No
state Whether the record(s) should exist or not. present no
solo Whether the record should be the only one for that record type and record name. Only use with state: present. This will delete all other records with the same record name and type. Yes No

Example config

cloudflare_account_email: [email protected]
cloudflare_account_api_token: xxx

DNS records:

cloudflare_dns_records:
  - zone: foobar.com
    records:
      - type: MX
        priotity: 1
        ttl: 3600
        value: 'aspmx.l.google.com.'
        solo: false
      - type: MX
        priotity: 5
        ttl: 3600
        value: 'alt1.aspmx.l.google.com.'
        solo: false
      - type: MX
        priotity: 5
        ttl: 3600
        value: 'alt2.aspmx.l.google.com.'
        solo: false
      - type: MX
        priotity: 10
        ttl: 3600
        value: 'alt3.aspmx.l.google.com.'
        solo: false
      - type: MX
        priotity: 10
        ttl: 3600
        value: 'alt4.aspmx.l.google.com.'
        solo: false
      - name: cname-record
        type: CNAME
        value: hgs.google.com
      - name: a-record
        type: A
        value: 45.68.13.8

Dependencies

None

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - cloudflare

License

BSD

Author Information

If You like this role and would like to buy me โ˜• or ๐Ÿบ You can do it via PayPal

ansible-role-cloudflare's People

Contributors

artkrz avatar zenathar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.