Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
beb190d9
Commit
beb190d9
authored
Aug 25, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jvandyke-provisioner-chef-solo'
Chef-solo provisioner first pass.
parents
86abf14b
585cee9b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
469 additions
and
0 deletions
+469
-0
config.go
config.go
+1
-0
plugin/provisioner-chef-solo/main.go
plugin/provisioner-chef-solo/main.go
+10
-0
provisioner/chef-solo/provisioner.go
provisioner/chef-solo/provisioner.go
+390
-0
provisioner/chef-solo/provisioner_test.go
provisioner/chef-solo/provisioner_test.go
+68
-0
No files found.
config.go
View file @
beb190d9
...
@@ -39,6 +39,7 @@ const defaultConfig = `
...
@@ -39,6 +39,7 @@ const defaultConfig = `
},
},
"provisioners": {
"provisioners": {
"chef-solo": "packer-provisioner-chef-solo",
"file": "packer-provisioner-file",
"file": "packer-provisioner-file",
"shell": "packer-provisioner-shell",
"shell": "packer-provisioner-shell",
"salt-masterless": "packer-provisioner-salt-masterless"
"salt-masterless": "packer-provisioner-salt-masterless"
...
...
plugin/provisioner-chef-solo/main.go
0 → 100644
View file @
beb190d9
package
main
import
(
"github.com/mitchellh/packer/packer/plugin"
"github.com/mitchellh/packer/provisioner/chef-solo"
)
func
main
()
{
plugin
.
ServeProvisioner
(
new
(
chefSolo
.
Provisioner
))
}
provisioner/chef-solo/provisioner.go
0 → 100644
View file @
beb190d9
This diff is collapsed.
Click to expand it.
provisioner/chef-solo/provisioner_test.go
0 → 100644
View file @
beb190d9
package
chefSolo
import
(
"github.com/mitchellh/packer/packer"
"io/ioutil"
"os"
"testing"
)
func
testConfig
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
// "inline": []interface{}{"foo", "bar"},
}
}
func
TestProvisioner_Impl
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
&
Provisioner
{}
if
_
,
ok
:=
raw
.
(
packer
.
Provisioner
);
!
ok
{
t
.
Fatalf
(
"must be a Provisioner"
)
}
}
// Cookbook paths
//////////////////
func
TestProvisionerPrepare_DefaultCookbookPathIsUsed
(
t
*
testing
.
T
)
{
var
p
Provisioner
config
:=
testConfig
()
err
:=
p
.
Prepare
(
config
)
if
err
==
nil
{
t
.
Errorf
(
"expected error to be thrown for unavailable cookbook path"
)
}
if
len
(
p
.
config
.
CookbooksPaths
)
!=
1
||
p
.
config
.
CookbooksPaths
[
0
]
!=
DefaultCookbooksPath
{
t
.
Errorf
(
"unexpected default cookbook path: %s"
,
p
.
config
.
CookbooksPaths
)
}
}
func
TestProvisionerPrepare_GivenCookbookPathsAreAddedToConfig
(
t
*
testing
.
T
)
{
var
p
Provisioner
path1
,
err
:=
ioutil
.
TempDir
(
""
,
"cookbooks_one"
)
if
err
!=
nil
{
t
.
Errorf
(
"err: %s"
,
err
)
}
path2
,
err
:=
ioutil
.
TempDir
(
""
,
"cookbooks_two"
)
if
err
!=
nil
{
t
.
Errorf
(
"err: %s"
,
err
)
}
defer
os
.
Remove
(
path1
)
defer
os
.
Remove
(
path2
)
config
:=
testConfig
()
config
[
"cookbooks_paths"
]
=
[]
string
{
path1
,
path2
}
err
=
p
.
Prepare
(
config
)
if
err
!=
nil
{
t
.
Errorf
(
"err: %s"
,
err
)
}
if
len
(
p
.
config
.
CookbooksPaths
)
!=
2
||
p
.
config
.
CookbooksPaths
[
0
]
!=
path1
||
p
.
config
.
CookbooksPaths
[
1
]
!=
path2
{
t
.
Errorf
(
"unexpected default cookbook path: %s"
,
p
.
config
.
CookbooksPaths
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment