项目作者: dnsimple

项目描述 :
Chef cookbook for DNSimple.
高级语言: Ruby
项目地址: git://github.com/dnsimple/chef-dnsimple.git
创建时间: 2011-12-15T19:24:03Z
项目社区:https://github.com/dnsimple/chef-dnsimple

开源协议:Apache License 2.0

下载


Description

CI

A chef resource for automated DNS configuration via the dnsimple API.

DEPRECATION WARNING

If you used the dnsimple_certificate resource, you’ll want to do the following to migrate:

  • The resource property expires_on has changed to be expires_at to match the dnsimple gem

Requirements

Attributes

  • None

Resources/Providers

dnsimple_record

Manage a DNS record through the dnsimple API. This resource uses the
dnsimple Ruby library to connect and use
the dnsimple API. This resource also exposes a ChefSpec matcher for you to do
unit testing as well.

Record Actions

Action Description Default
create Create the record. Yes
update Update the record.
destroy Destroy the record.

Record Resource Properties

Property Description Required Default
domain Domain to manage true
record_name Name of the record ‘’
type Type of DNS record (see note) true
content String/Array content of records true
ttl Time to live 3600
priority Priorty of record
regions Specific regions for this record
access_token DNSimple API token true
base_url DNSimple API url https://api.dnsimple.com

Record Types: The type of record can be one of the following: A, AAAA,
CAA, CNAME, MX, NS, TXT, SPF, SRV, NAPTR, HINFO, SSHFP, ALIAS, URL or POOL.
Some of these record types such as POOL require special account access which
you can contact support for access and
assistance.

Note: If you do not provide the record_name parameter, it will be blank
and thus will be assumed to be the domain apex. The apex is the domain name
without a subdomain. For example bar.com is the apex of foo.bar.com.

Regional Records: Only certain plan types have regional records so it is
blank by default. If you do not have this feature available it will return
an error.

Record Examples

Note that these examples assume you have obtained an account level access token
which is documented above (see Requirements). We’re also assuming you’re securely
storing your API keys in Chef Vault but
it is not a requirement.

  1. dnsimple_record 'foo.com main server' do
  2. domain 'foo.com'
  3. type 'A'
  4. content '1.2.3.4'
  5. ttl 3600
  6. access_token chef_vault_item('secrets', 'dnsimple_token')
  7. action :create
  8. end
  9. dnsimple_record 'create a CNAME record for a Google Apps site calendar at calendar.example.com' do
  10. record_name 'calendar'
  11. content 'ghs.google.com'
  12. type 'CNAME'
  13. domain 'example.com'
  14. access_token chef_vault_item('secrets', 'dnsimple_token')
  15. action :create
  16. end
  17. dnsimple_record 'create an A record with multiple content values at servers.example.com' do
  18. record_name 'servers'
  19. content ['1.1.1.1', '2.2.2.2']
  20. type 'A'
  21. domain 'example.com'
  22. access_token chef_vault_item('secrets', 'dnsimple_token')
  23. action :create
  24. end
  25. # Note: This only works with certain accounts, see the note above for
  26. # regional records! The Chef run will fail otherwise.
  27. dnsimple_record "create an A record in Tokyo only" do
  28. record_name 'myserverinjapan'
  29. content '2.2.2.2'
  30. type 'A'
  31. domain 'example.com'
  32. regions ['tko']
  33. access_token chef_vault_item('secrets', 'dnsimple_token')
  34. action :create
  35. end

dnsimple_certificate

Download and install a certificate. Currently this only supports basic matched
.crt & .key files. We would like to expand this to support all formats
including java keystores. PRs are welcome!

This resource uses the dnsimple Ruby
library
to connect and use the dnsimple
API. This resource also exposes a ChefSpec matcher for you to do unit testing
as well.

Certificate Actions

Action Description Default
install Install the crt & key Yes

Certificate Resource Properties

Property Description Required Default
install_path where the crt & key are installed yes
common_name certificate common name yes name of the resource
domain the main domain name on the crt yes
expires_at when the certificate expires yes
private_key_pem provide your own private key no
mode files mode no 0600
owner files owner no root
group files group no root
access_token DNSimple API token true
base_url DNSimple API url https://api.dnsimple.com

Certificate Examples

  1. dnsimple_certificate 'dnsimple.xyz certificate' do
  2. install_path '/etc/apache2/ssl'
  3. common_name 'www.dnsimple.xyz'
  4. domain 'dnsimple.xyz'
  5. expires_at '2019-09-08 17:21:29 UTC'
  6. mode '0755'
  7. owner 'web_admin'
  8. group 'web_admin'
  9. access_token chef_vault_item('secrets', 'dnsimple_token')
  10. end

Usage

Add the dnsimple cookbook to your cookbook’s metadata and it will automatically
install the dnsimple gem and make the dnsimple_record resource available.

Note: If you want to avoid any issues with a maintenance window or service outage causing a Chef run failure, be sure to set the ignore_failure property to true as documented in the common properties which will only print warnings if records could not be updated during the Chef run.

Testing

See TESTING.md

Contributing

See CONTRIBUTING.md

License

Copyright 2024, DNSimple Corp.

Licensed under the Apache License, Version 2.0.