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

syntax error for sysctl_multi LWRP use #983

@donnielee

Description

@donnielee

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'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions