# RuboCop Inspection Report

27 files inspected, 157 offenses detected:

- Rakefile - 1 offense
- Vagrantfile - 4 offenses
- packer-ami.rb - 77 offenses
- packer-vagrant.rb - 70 offenses
- recipes/alfresco.rb - 1 offense
- recipes/run-chef-client.rb - 3 offenses
- recipes/snort-config.rb - 1 offense

###

### Rakefile - 1 offense

Line #26 – convention: Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

    task :default => [:foodcritic, :rubocop, :knife, :dist]

###

### Vagrantfile - 4 offenses

Line #22 – convention: Style/CommentAnnotation: Annotation keywords like `TODO` should be all upper case, followed by a colon, and a space, then a note describing the problem.

      # TODO - hacky replacement of https://www.vagrantup.com/docs/provisioning/chef_solo.html#recipe_url

Line #26 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

      config.vm.provision "shell",

Line #35 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

      config.vm.provider "virtualbox" do |v|

Line #42 – warning: Lint/UselessAssignment: Useless assignment to variable - `run_list`.

        run_list = ['alfresco::default']

###

### packer-ami.rb - 77 offenses

Line #3 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

        "alfresco_version" => "{{env `ALFRESCO_VERSION`}}"

Line #3 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

        "alfresco_version" => "{{env `ALFRESCO_VERSION`}}"

Line #3 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

        "alfresco_version" => "{{env `ALFRESCO_VERSION`}}"

Line #7 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "clean-temp-folders" => {

Line #8 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #8 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "type"=> "shell",

Line #8 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #9 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "inline" => [

Line #11 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /tmp/packer-chef-solo",

Line #12 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/chef/cookbooks",

Line #13 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/chef/databags"

Line #13 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

              "sudo rm -rf /etc/chef/databags"

Line #14 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            ]

Line #15 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #18 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "chef" => {

Line #19 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "json"=> {

Line #19 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "json"=> {

Line #20 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "name" => "img-trials",

Line #20 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "name" => "img-trials",

Line #21 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "alfresco" => {

Line #22 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "version" => "{{user `alfresco_version`}}"

Line #22 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                "version" => "{{user `alfresco_version`}}"

Line #22 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "version" => "{{user `alfresco_version`}}"

Line #24 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "hosts" => {

Line #25 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "host_list" => {

Line #26 – convention: Style/CommentAnnotation: Annotation keywords like `TODO` should be all upper case, followed by a colon, and a space, then a note describing the problem.

                  # TODO - This is temporary, until there's a better solution

Line #27 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                  "minislaven1 minislaven1.alfresco.pri" => "10.80.217.144"

Line #27 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                  "minislaven1 minislaven1.alfresco.pri" => "10.80.217.144"

Line #27 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                  "minislaven1 minislaven1.alfresco.pri" => "10.80.217.144"

Line #28 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                }

Line #32 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "snort" => {

Line #33 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "start_snort" => false

Line #33 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                "start_snort" => false

Line #35 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "chef_client" => {

Line #36 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_cookbook_path" => "/tmp/packer-chef-solo/cookbooks-0",

Line #36 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_cookbook_path" => "/tmp/packer-chef-solo/cookbooks-0",

Line #37 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_data_bag_path" => "/tmp/packer-chef-solo/data_bags"

Line #37 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                "source_data_bag_path" => "/tmp/packer-chef-solo/data_bags"

Line #37 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_data_bag_path" => "/tmp/packer-chef-solo/data_bags"

Line #38 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

              }

Line #40 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "run_list" => [ "img-trials::default" ]

Line #40 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            "run_list" => [ "img-trials::default" ]

Line #40 – convention: Style/SpaceInsideBrackets: Space inside square brackets detected.

            "run_list" => [ "img-trials::default" ]

Line #40 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "run_list" => [ "img-trials::default" ]

Line #40 – convention: Style/SpaceInsideBrackets: Space inside square brackets detected.

            "run_list" => [ "img-trials::default" ]

Line #41 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #44 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "yum-clean-all" => {

Line #45 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #45 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "type"=> "shell",

Line #45 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #46 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "inline" => [

Line #47 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo yum -y clean all",

Line #48 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /root/.m2",

Line #49 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomca*/work/*",

Line #50 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomca*/temp/*",

Line #51 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/chef/nodes/*",

Line #52 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/yum.repos.d/alfresco.repo",

Line #53 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/cron.hourly/0yum-hourly.cron",

Line #54 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/cron.daily/0yum-daily.cron",

Line #55 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/cron.hourly/0anacron",

Line #56 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/anacrontab",

Line #57 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo find /var/log -type f -delete",

Line #58 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo find /tmp -type f -delete",

Line #59 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

              "echo 'Printing DF\n' ; sudo df -h"

Line #60 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            ]

Line #61 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #62 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

        }

Line #66 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

        "launch_block_device_mappings" => [

Line #67 – convention: Style/IndentArray: Use 2 spaces for indentation in an array, relative to the start of the line where the left square bracket is.

        { ...

Line #68 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "device_name" => "/dev/sda1",

Line #68 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "device_name" => "/dev/sda1",

Line #69 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "volume_size" => 60,

Line #70 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "volume_type" => "gp2",

Line #70 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "volume_type" => "gp2",

Line #71 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "delete_on_termination" => true

Line #71 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          "delete_on_termination" => true

Line #72 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

        }]

###

### packer-vagrant.rb - 70 offenses

Line #4 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "clean-temp-folder" => {

Line #5 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #5 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "type"=> "shell",

Line #5 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #6 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "inline" => [

Line #7 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -Rf /tmp/*"

Line #7 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

              "sudo rm -Rf /tmp/*"

Line #8 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            ]

Line #9 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #12 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "chef" => {

Line #13 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "json"=> {

Line #13 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "json"=> {

Line #14 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "name"=> "img-trials-test",

Line #14 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

              "name"=> "img-trials-test",

Line #14 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "name"=> "img-trials-test",

Line #15 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "image" => {

Line #17 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "root_alias" => "not_set"

Line #17 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                "root_alias" => "not_set"

Line #17 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "root_alias" => "not_set"

Line #19 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "hosts" => {

Line #20 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "host_list" => {

Line #21 – convention: Style/CommentAnnotation: Annotation keywords like `TODO` should be all upper case, followed by a colon, and a space, then a note describing the problem.

                  # TODO - not needed anymore, test it

Line #23 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                }

Line #25 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "chef_client" => {

Line #26 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_cookbook_path" => "/tmp/packer-chef-solo/cookbooks-0",

Line #26 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_cookbook_path" => "/tmp/packer-chef-solo/cookbooks-0",

Line #27 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_data_bag_path" => "/tmp/packer-chef-solo/databags"

Line #27 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

                "source_data_bag_path" => "/tmp/packer-chef-solo/databags"

Line #27 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

                "source_data_bag_path" => "/tmp/packer-chef-solo/databags"

Line #28 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

              }

Line #30 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "run_list" => [ "img-trials::default" ]

Line #30 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            "run_list" => [ "img-trials::default" ]

Line #30 – convention: Style/SpaceInsideBrackets: Space inside square brackets detected.

            "run_list" => [ "img-trials::default" ]

Line #30 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "run_list" => [ "img-trials::default" ]

Line #30 – convention: Style/SpaceInsideBrackets: Space inside square brackets detected.

            "run_list" => [ "img-trials::default" ]

Line #31 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #34 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "vagrant-insecure-ssh-key" => {

Line #35 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type" => "shell",

Line #35 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type" => "shell",

Line #36 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "inline" => [

Line #37 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "mkdir -p /home/vagrant/.ssh",

Line #38 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "chmod 0700 /home/vagrant/.ssh",

Line #39 – convention: Style/CommentAnnotation: Annotation keywords like `TODO` should be all upper case, followed by a colon, and a space, then a note describing the problem.

              # TODO - Why this? Next one shouldn't be needed, as delivered by img-basic::_packages

Line #41 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo yum install -y wget bzip2",

Line #42 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys",

Line #43 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "chmod 0600 /home/vagrant/.ssh/authorized_keys",

Line #44 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "chown -R vagrant /home/vagrant/.ssh"

Line #44 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

              "chown -R vagrant /home/vagrant/.ssh"

Line #45 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            ]

Line #46 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #49 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

          "erase-data" => {

Line #50 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #50 – convention: Style/SpaceAroundOperators: Surrounding space missing for operator `=>`.

            "type"=> "shell",

Line #50 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "type"=> "shell",

Line #51 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

            "inline" => [

Line #52 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -f /var/log/*",

Line #53 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /tmp/*",

Line #54 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /etc/chef/nodes/*",

Line #55 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo yum -y clean all",

Line #56 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /root/.m2",

Line #57 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomca*/work/*",

Line #58 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomca*/temp/*",

Line #59 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomca*/logs/*",

Line #60 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomcat/*.log",

Line #61 – convention: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

              "sudo rm -rf /usr/share/tomcat/*.log.*",

Line #62 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

              "echo 'Printing DF\n' ; sudo df -h"

Line #63 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

            ]

Line #64 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          }

Line #65 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

        }

Line #73 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

        'only' => ['vbox-iso']

###

### recipes/alfresco.rb - 1 offense

Line #6 – convention: Style/BlockDelimiters: Avoid using `{...}` for multi-line blocks.

      packages.each { |package|

###

### recipes/run-chef-client.rb - 3 offenses

Line #26 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          'url' => internal_rules_url

Line #30 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.

          'url' => internal_emerging_rules_url

Line #31 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

        }

###

### recipes/snort-config.rb - 1 offense

Line #6 – convention: Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline array.

      { 'path' => '/etc/snort/emerging.rules.tar.gz' }