resources/google_cloud_ops_agents.rb [27:62]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  case node['platform_family']
  when 'rhel', 'debian', 'suse', 'amazon'
    bash node['file_url_name'] do
      cwd node['tmp_file_path']
      code "./#{node['file_url_name']} --also-install --version=#{node['version']}"
      only_if "./#{node['file_url_name']} --also-install --version=#{node['version']} --dry-run | grep -qi 'installation succeeded'" == 0
      user 'root'
    end
    case node['agent_type']
    when 'ops-agent'
      servicename = 'google-cloud-ops-agent'
    when 'monitoring'
      servicename = 'stackdriver-agent'
    when 'logging'
      servicename = 'google-fluentd'
    end
    service servicename do
      action [:start, :enable]
      # TODO: When CINC fixes the bug related to this, uncomment the below line
      # user 'root'
    end
    # The user parameter for service isn't working, hack to bypass
    # TODO: once the service command above has the bug fixed and can
    # specify user properly, remove this.
    bash 'hack service' do
      user 'root'
      code "systemctl enable #{servicename}"
    end
  when 'windows'
    powershell_script node['file_url_name'] do
      cwd node['tmp_file_path']
      code "#{node['tmp_file_path']}/#{node['file_url_name']} -AlsoInstall -Version #{node['version']}"
      only_if "#{node['file_url_name']} -AlsoInstall -Version #{node['version']} -WhatIf | findstr /i \"Verification of google-cloud-ops-agent.x86_64.${version} completed\"" == 0
    end
  end
end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



resources/google_cloud_ops_agents.rb [67:102]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  case node['platform_family']
  when 'rhel', 'debian', 'suse', 'amazon'
    bash node['file_url_name'] do
      cwd node['tmp_file_path']
      code "./#{node['file_url_name']} --also-install --version=#{node['version']}"
      only_if "./#{node['file_url_name']} --also-install --version=#{node['version']} --dry-run | grep -qi 'installation succeeded'" == 0
      user 'root'
    end
    case node['agent_type']
    when 'ops-agent'
      servicename = 'google-cloud-ops-agent'
    when 'monitoring'
      servicename = 'stackdriver-agent'
    when 'logging'
      servicename = 'google-fluentd'
    end
    service servicename do
      action [:start, :enable]
      # TODO: When CINC fixes the bug related to this, uncomment the below line
      # user 'root'
    end
    # The user parameter for service isn't working, hack to bypass
    # TODO: once the service command above has the bug fixed and can
    # specify user properly, remove this.
    bash 'hack service' do
      user 'root'
      code "systemctl enable #{servicename}"
    end
  when 'windows'
    powershell_script node['file_url_name'] do
      cwd node['tmp_file_path']
      code "#{node['tmp_file_path']}/#{node['file_url_name']} -AlsoInstall -Version #{node['version']}"
      only_if "#{node['file_url_name']} -AlsoInstall -Version #{node['version']} -WhatIf | findstr /i \"Verification of google-cloud-ops-agent.x86_64.${version} completed\"" == 0
    end
  end
end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



