Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs #60

Merged
merged 2 commits into from
Sep 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Checklist
=================================================

- Fork the repository on GitHub.

- Make changes on a branch *with tests*

- Run tests `bundle exec rake spec`

- Check for style `bundle exec rake lint`

- Push your changes to a topic branch in your fork of the
repository. (the format ticket/1234-short_description_of_change is
usually preferred for this project).

- Submit a pull request to the repository


Testing
=======

Getting Started
---------------

Our puppet modules provide [`Gemfile`](./Gemfile)s which can tell a ruby
package manager such as [bundler](http://bundler.io/) what Ruby packages,
or Gems, are required to build, develop, and test this software.

Please make sure you have [bundler installed](http://bundler.io/#getting-started)
on your system, then use it to install all dependencies needed for this project,
by running

```shell
% bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Using builder (3.2.2)
-- 8><-- many more --><8 --
Using rspec-system-puppet (2.2.0)
Using serverspec (0.6.3)
Using rspec-system-serverspec (1.0.0)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
```

NOTE some systems may require you to run this command with sudo.


Running Tests
-------------

```shell
$ bundle exec rake spec
Cloning into 'spec/fixtures/modules/stdlib'...
remote: Counting objects: 5550, done.
remote: Total 5550 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5550/5550), 1.09 MiB | 271.00 KiB/s, done.
Resolving deltas: 100% (2302/2302), done.
Checking connectivity... done.
HEAD is now at 9e8127b Merge pull request #313 from mhaskel/spec_updates
Cloning into 'spec/fixtures/modules/concat'...
remote: Counting objects: 1467, done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 1467 (delta 52), reused 2 (delta 0)
Receiving objects: 100% (1467/1467), 319.82 KiB | 256.00 KiB/s, done.
Resolving deltas: 100% (688/688), done.
.....................................................................

Finished in 4.59 seconds
69 examples, 0 failures

Total resources: 72
Touched resources: 22
Resource coverage: 30.56%
```

Writing Tests
------------
See the [tutorial](http://rspec-puppet.com/tutorial/)
184 changes: 99 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,99 +22,113 @@ or

Tweak and add the following to your site manifest:

node 'server.example.com' {
include dns::server

# Forwarders
dns::server::options{ '/etc/bind/named.conf.options':
forwarders => [ '8.8.8.8', '8.8.4.4' ]
}

# Forward Zone
dns::zone { 'example.com':
soa => "ns1.example.com",
soa_email => 'admin.example.com',
nameservers => ["ns1"]
}

# Reverse Zone
dns::zone { '1.168.192.IN-ADDR.ARPA':
soa => "ns1.example.com",
soa_email => 'admin.example.com',
nameservers => ["ns1"]
}

# A Records:
dns::record::a {
'huey':
zone => 'example.com',
data => ["98.76.54.32"];
'duey':
zone => 'example.com',
data => ["12.34.56.78", "12.23.34.45"];
'luey':
zone => 'example.com',
data => ["192.168.1.25"],
ptr => true; # Creates a matching reverse zone record. Make sure you've added the proper reverse zone in the manifest.
}

# MX Records:
dns::record::mx {
'mx,0':
zone => 'example.com',
preference => 0,
data => 'ASPMX.L.GOOGLE.com';
'mx,10':
zone => 'example.com',
preference => 10,
data => 'ALT1.ASPMX.L.GOOGLE.com';
}

# CNAME Record:
dns::record::cname { 'www':
zone => 'example.com',
data => 'huey.example.com',
}

# TXT Record:
dns::record::txt { 'www':
zone => 'example.com',
data => 'Hello World',
}
}
```puppet
node 'server.example.com' {
include dns::server

# Forwarders
dns::server::options { '/etc/bind/named.conf.options':
forwarders => [ '8.8.8.8', '8.8.4.4' ]
}

# Forward Zone
dns::zone { 'example.com':
soa => 'ns1.example.com',
soa_email => 'admin.example.com',
nameservers => ['ns1']
}

# Reverse Zone
dns::zone { '1.168.192.IN-ADDR.ARPA':
soa => 'ns1.example.com',
soa_email => 'admin.example.com',
nameservers => ['ns1']
}

# A Records:
dns::record::a {
'huey':
zone => 'example.com',
data => ['98.76.54.32'];
'duey':
zone => 'example.com',
data => ['12.34.56.78', "12.23.34.45'];
'luey':
zone => 'example.com',
data => ['192.168.1.25'],
ptr => true; # Creates a matching reverse zone record. Make sure you've added the proper reverse zone in the manifest.
}

# MX Records:
dns::record::mx {
'mx,0':
zone => 'example.com',
preference => 0,
data => 'ASPMX.L.GOOGLE.com';
'mx,10':
zone => 'example.com',
preference => 10,
data => 'ALT1.ASPMX.L.GOOGLE.com';
}

# CNAME Record:
dns::record::cname { 'www':
zone => 'example.com',
data => 'huey.example.com',
}

# TXT Record:
dns::record::txt { 'www':
zone => 'example.com',
data => 'Hello World',
}
}
```

You can also declare forwarders for a specific zone, if you don't have one in the dns::option.

dns::zone { 'example.com':
soa => "ns1.example.com",
soa_email => 'admin.example.com',
allow_forwarder => ['8.8.8.8'],
forward_policy => 'first'
nameservers => ["ns1"]
}
```puppet
dns::zone { 'example.com':
soa => 'ns1.example.com',
soa_email => 'admin.example.com',
allow_forwarder => ['8.8.8.8'],
forward_policy => 'first',
nameservers => ['ns1'],
}
```

You can change the checking of the domain name. The policy can be either warn fail or ignore.

dns::option {
check_name_master = 'fail'
check_name_slave = 'warn'
check_name_remote = 'ignore'
}
```puppet
dns::server::options { '/etc/bind/named.conf.options':
check_name_master => 'fail',
check_name_slave => 'warn',
check_name_remote => 'ignore',
forwarders => [ '8.8.8.8', '4.4.4.4' ],
}
```

### Exported resource patterns
node default {
# Other nodes export an A record for thier hostname
@@dns::record::a { $hostname: zone => $::domain, data => $::ipaddress, }
}
node 'ns1.xkyle.com' {
dns::zone { $::domain:
soa => $::fqdn,
soa_email => "admin.${::domain}",
nameservers => [ 'ns1' ],
}
# Collect all the records from other nodes
Dns::Record::A <<||>>
}

```puppet
node default {
# Other nodes export an A record for thier hostname
@@dns::record::a { $::hostname:
zone => $::domain,
data => $::ipaddress,
}
}

node 'ns1.xkyle.com' {
dns::zone { $::domain:
soa => $::fqdn,
soa_email => "admin.${::domain}",
nameservers => [ 'ns1' ],
}
# Collect all the records from other nodes
Dns::Record::A <<||>>
}
```

## Contributing

Expand Down