Skip to content

Commit

Permalink
Adds CI to GitHub Actions (#120)
Browse files Browse the repository at this point in the history
* Delete .travis.yml

* Adds YAML lint

* Adds Markdown lint

* Adds Github Actions CI

* Add actions build badge

Co-authored-by: Stephen Nelson <[email protected]>
  • Loading branch information
san983 and AGS4NO authored Oct 19, 2021
1 parent ad13701 commit 223a620
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 81 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: ci

"on":
pull_request:
push:
branches:
- main

jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Chef Workstation
uses: actionshub/chef-install@main
- name: Run Chef Delivery
run: chef exec delivery local all
env:
CHEF_LICENSE: accept-no-persist

markdownlint-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run markdownlint-cli
uses: nosborn/[email protected]
with:
files: .
config_file: ".markdownlint.yaml"

yamllint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run YAML Lint
uses: actionshub/yamllint@main

integration:
needs: [delivery, markdownlint-cli, yamllint]
runs-on: ubuntu-latest
strategy:
matrix:
os:
- 'centos-7'
- 'centos-8'
- 'debian-10'
- 'debian-9'
- 'ubuntu-1804'
- 'ubuntu-2004'
suite:
- 'authoritative-multi'
- 'authoritative-postgres'
- 'recursor-multi'
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Chef Workstation
uses: actionshub/chef-install@main
- name: Run Test Kitchen
uses: actionshub/test-kitchen@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.yml
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
- name: Debug
if: failure()
run: |
set -x
sudo journalctl -l --since today
KITCHEN_LOCAL_YAML=kitchen.yml /usr/bin/kitchen exec \
${{ matrix.suite }}-${{ matrix.os }} -c "journalctl -l"
3 changes: 3 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
default: true
line-length: false
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default
rules:
document-start: false
line-length:
max: 256
level: warning
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,4 @@
- \[COOK-2986\] Fix foodcritic warnings [\#7](https://github.com/dnsimple/chef-pdns/pull/7) ([stevendanna](https://github.com/stevendanna))
- \[COOK-2604\] Configure a PowerDNS server [\#2](https://github.com/dnsimple/chef-pdns/pull/2) ([dje](https://github.com/dje))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# PowerDNS Community Cookbook

![CI](https://github.com/dnsimple/pdns/actions/workflows/ci.yml/badge.svg)

Provides resources for installing and configuring both PowerDNS authoritative and recursor. It uses the official PowerDNS repositories for packages and installs the appropriate configuration for your platform's init system.

## Build Status
Expand Down Expand Up @@ -31,20 +33,20 @@ You can look at the [test cookbook](https://github.com/dnsimple/chef-pdns/blob/m

## Requirements

### Platforms:
### Platforms

- Ubuntu 18.04 and newer
- Debian 9 and newer
- RHEL 7 and newer
- CentOS 7 and newer

### Chef:
### Chef

- Chef 15 or newer

### Init Systems:
### Init Systems

* systemd
- systemd

## Usage

Expand Down Expand Up @@ -93,7 +95,7 @@ end

Will create a file named `/etc/powerdns/pdns-server_01.conf`:

```
```shell
launch ['gpgsql']
gpgsql-host=127.0.0.1
gpgsql-user=pdns
Expand All @@ -117,7 +119,7 @@ Most of the properties are optional and have sane defaults, so they are only rec

Installs PowerDNS authoritative server 4.4.x series using PowerDNS official repository in the supported platforms.

#### Properties
#### pdns_authoritative_install Properties

| Name | Type | Default value |
|---------------|-------------|----------------|
Expand All @@ -129,7 +131,7 @@ Installs PowerDNS authoritative server 4.4.x series using PowerDNS official repo

**Note:** When specifying backends, the name of the backend must match the repository package. For example, in Debian systems the Postgresql backend is actually named `pgsql` while on RHEL systems it is `postgresql`. Consider using the `value_for_platform` if you are installing on multiple platforms. There is an example of this technique in the test folder cookbook recipe.

#### Usage examples
#### pdns_authoritative_install Usage examples

Install the latest 4.4.x series PowerDNS Authoritative Server

Expand Down Expand Up @@ -167,7 +169,7 @@ end

Creates a PowerDNS authoritative configuration, there is a fixed set of required properties (listed below) but most of the configuration is left to the user freely, every property set in the `variables` hash property will be rendered in the config template. Remember that using underscores `_` for property names is required and it's translated to hyphens `-` in configuration templates.

#### Properties
#### pdns_authoritative_config Properties

| Name | Class | Default value | Consistent? |
|----------------|------------|-------------------------------------------------------------|-------------|
Expand All @@ -188,11 +190,11 @@ Creates a PowerDNS authoritative configuration, there is a fixed set of required
- `variables`: Variables for the configuration template.
- `virtual` : Is this a virtual instance or the default?

#### Usage Example
#### pdns_authoritative_config Usage Example

Create a PowerDNS authoritative configuration file named `server-01`:

```
```ruby
pdns_authoritative_config 'server_01' do
virtual true
launch ['gpgsql']
Expand All @@ -216,15 +218,15 @@ Creates a service to manage a PowerDNS authoritative instance. This service supp

*Important:* services are not restarted or reloaded automatically on config changes in this cookbook, you need to add this in your wrapper cookbook if you desire this functionality, the `pdns_authoritative_service` cookbook provides actions to do it.

#### Properties
#### pdns_authoritative_service Properties

| Name | Class | Default value | Consistent? |
|----------------|-------------|------------------------------------------------------------|-------------|
| instance_name | String | name_property | Yes |
| config_dir | String | See `default_authoritative_config_directory` helper method | Yes |
| virtual | Boolean | false | No |

#### Usage example
#### pdns_authoritative_service Usage example

To enable and start the default PowerDNS Authoritative server

Expand All @@ -247,7 +249,7 @@ end

Installs PowerDNS recursor 4.4.x series using PowerDNS official repository in the supported platforms.

#### Properties
#### pdns_recursor_install Properties

| Name | Type | Default value |
|----------------|-------------|-----------------|
Expand All @@ -256,7 +258,7 @@ Installs PowerDNS recursor 4.4.x series using PowerDNS official repository in th
| debug | true, false | false |
| allow_upgrade | true, false | false |

#### Usage examples
#### pdns_recursor_install Usage examples

Install the latest 4.4.x release PowerDNS recursor

Expand Down Expand Up @@ -285,7 +287,7 @@ end

Creates a PowerDNS recursor configuration.

#### Properties
#### pdns_recursor_config Properties

| Name | Class | Default value | Consistent? |
|----------------|------------|-------------------------------------------------------------|-------------|
Expand All @@ -310,18 +312,17 @@ Sets up a PowerDNS recursor instance.

*Important:* services not restarted or reloaded automatically on config changes in this cookbook, you need to add this in your wrapper cookbook if you desire this functionality, the `pdns_recursor_service` cookbook provides actions to do it.


#### Properties
#### pdns_recursor_service Properties

| Name | Class | Default value | Consistent? |
|----------------|-------------|------------------------------------------------------------|-------------|
| instance_name | String | name_property | Yes |
| config_dir | String | See `default_recursor_config_directory` helper method | Yes |
| virtual | Boolean | false | No |

#### Usage Example
#### pdns_recursor_service Usage Examples

Disable the default PowerDNS recursor install service
##### Disable the default PowerDNS recursor install service

```ruby
pdns_recursor_service 'default' do
Expand All @@ -339,9 +340,7 @@ pdns_recursor_service 'my_recursor' do
end
```

#### Usage Example

Customize the default recursor installation and change it's port to 54:
##### Customize the default recursor installation and change it's port to 54

```ruby
pdns_recursor_config 'default' do
Expand Down
16 changes: 8 additions & 8 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,32 @@ platforms:
image: dokken/debian-9
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y

- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y

- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y

- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install dnsutils -y

suites:
- name: recursor-multi
Expand Down
1 change: 0 additions & 1 deletion test/cookbooks/pdns_test/README.md

This file was deleted.

0 comments on commit 223a620

Please sign in to comment.