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

Added docs, renamed packages to package to for consistency with other modules #384

Merged
merged 2 commits into from
Oct 18, 2016
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
41 changes: 41 additions & 0 deletions docs/content/resources/package.rpm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "package.rpm"
slug: "package-rpm"
date: ""
menu:
main:
parent: resources
---


RPM Package manages system packages with `rpm` and `yum`. It assumes that
both `rpm` and `yum` are installed on the system, and that the user has
permissions to install, remove, and query packages.


## Example

```hcl
package.rpm "mc" {
name = "mc"
state = "present"
}

```


## Parameters

- `name` (required string)

Name of the package or package group.

- `state` (State)


Valid values: `present` and `absent`

State of the package. Present means the package will be installed if
missing; Absent means the package will be uninstalled if present.


14 changes: 13 additions & 1 deletion docs/resources.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# automatically generated Wed Oct 12 11:29:51 CDT 2016
# automatically generated Mon Oct 17 11:33:29 CDT 2016
include Makefile

content/resources/docker.container.md: extract ../resource/docker/container/preparer.go ../samples/dockerContainer.hcl
Expand Down Expand Up @@ -73,6 +73,18 @@ content/resources/module.md: extract ../resource/module/preparer.go ../samples/s
echo >> $@
./extract --example ../samples/sourceFile.hcl --resource-name module --path ../resource/module/preparer.go --type Preparer --strip-doc-lines=2 >> $@

content/resources/package.rpm.md: extract ../resource/package/rpm/preparer.go ../samples/rpm.hcl
echo '---' > $@
echo 'title: "package.rpm"' >> $@
echo 'slug: "package-rpm"' >> $@
echo "date: \"$$(date -j '+%Y-%m-%dT%H:%M:%S%z' | sed -E 's/(..)$$/:\1/')\"" >> $@
echo "menu:" >> $@
echo " main:" >> $@
echo " parent: resources" >> $@
echo '---' >> $@
echo >> $@
./extract --example ../samples/rpm.hcl --resource-name package.rpm --path ../resource/package/rpm/preparer.go --type Preparer --strip-doc-lines=2 >> $@

content/resources/param.md: extract ../resource/param/preparer.go ../samples/basic.hcl
echo '---' > $@
echo 'title: "param"' >> $@
Expand Down
1 change: 1 addition & 0 deletions docs/sources.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ file.content,../resource/file/content/preparer.go,../samples/fileContent.hcl,Pre
file.directory,../resource/file/directory/preparer.go,../samples/fileDirectory.hcl,Preparer
file.mode,../resource/file/mode/preparer.go,../samples/fileMode.hcl,Preparer
module,../resource/module/preparer.go,../samples/sourceFile.hcl,Preparer
package.rpm,../resource/package/rpm/preparer.go,../samples/rpm.hcl,Preparer
param,../resource/param/preparer.go,../samples/basic.hcl,Preparer
task,../resource/shell/preparer.go,../samples/basic.hcl,Preparer
task.query,../resource/shell/query/preparer.go,../samples/query.hcl,Preparer
Expand Down
2 changes: 1 addition & 1 deletion load/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
_ "github.com/asteris-llc/converge/resource/file/mode"
_ "github.com/asteris-llc/converge/resource/group"
_ "github.com/asteris-llc/converge/resource/module"
_ "github.com/asteris-llc/converge/resource/packages/rpm"
_ "github.com/asteris-llc/converge/resource/package/rpm"
_ "github.com/asteris-llc/converge/resource/param"
_ "github.com/asteris-llc/converge/resource/shell"
_ "github.com/asteris-llc/converge/resource/shell/query"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"os/exec"
"testing"

"github.com/asteris-llc/converge/resource/packages/rpm"
"github.com/asteris-llc/converge/resource/package/rpm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ import (

// Preparer for RPM Package
//
// RPM Package manages system packages
// RPM Package manages system packages with `rpm` and `yum`. It assumes that
// both `rpm` and `yum` are installed on the system, and that the user has
// permissions to install, remove, and query packages.
type Preparer struct {
// Name of the system package to be managed.
// Name of the package or package group.
Name string `hcl:"name" required:"true" `

// State defines desired system package state.
// State of the package. Present means the package will be installed if
// missing; Absent means the package will be uninstalled if present.
State State `hcl:"state" valid_values:"present,absent" default:"present"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/asteris-llc/converge/resource"
"github.com/asteris-llc/converge/resource/packages/rpm"
"github.com/asteris-llc/converge/resource/package/rpm"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/asteris-llc/converge/helpers/fakerenderer"
"github.com/asteris-llc/converge/resource"
"github.com/asteris-llc/converge/resource/packages/rpm"
"github.com/asteris-llc/converge/resource/package/rpm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down