Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

syntax error for sysctl_multi LWRP use #983

Open
donnielee opened this issue Mar 9, 2017 · 1 comment
Open

syntax error for sysctl_multi LWRP use #983

donnielee opened this issue Mar 9, 2017 · 1 comment

Comments

@donnielee
Copy link

When I created a parameter.rb under recipes directory and uploaded to the Chef automate, knife displayed below syntax error message. Would you help me what did I wrong?

#cat ~/sysctl/recipes/parameter.rb
include_recipe 'sysctl::default'
sysctl_multi 'ip config' do
instructions {
'net.ipv4.ip_forward' => '1',
'net.ipv6.conf.all.forwarding' => '1',
'net.ipv4.tcp_syncookies' => '1'}
end

1103143ui-MacBook-Pro:chef-repo a1103143$ knife cookbook upload sysctl
Uploading sysctl [0.1.7]
FATAL: Cookbook file recipes/parameter.rb has a ruby syntax error:
FATAL: /Users/a1103143/chef-repo/cookbooks/sysctl/recipes/parameter.rb:22: syntax error, unexpected =>, expecting '}'
FATAL: 'net.ipv4.ip_forward' =>'1',
FATAL: ^
FATAL: /Users/a1103143/chef-repo/cookbooks/sysctl/recipes/parameter.rb:22: syntax error, unexpected ',', expecting '}'
FATAL: /Users/a1103143/chef-repo/cookbooks/sysctl/recipes/parameter.rb:23: syntax error, unexpected =>, expecting '}'
FATAL: 'net.ipv6.conf.all.forwarding' =>'1',
FATAL: ^
FATAL: /Users/a1103143/chef-repo/cookbooks/sysctl/recipes/parameter.rb:23: syntax error, unexpected ',', expecting '}'
FATAL: /Users/a1103143/chef-repo/cookbooks/sysctl/recipes/parameter.rb:24: syntax error, unexpected =>, expecting '}'
FATAL: 'net.ipv4.tcp_syncookies' =>'1'}

@donnielee
Copy link
Author

I made it with my colleague Jaebok Park's help.

Just include () like below.
#cat ~/sysctl/recipes/parameter.rb
include_recipe 'sysctl::default'
sysctl_multi 'ip config' do
instructions ({
'net.ipv4.ip_forward' => '1',
'net.ipv6.conf.all.forwarding' => '1',
'net.ipv4.tcp_syncookies' => '1'})
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant