Skip to main content
Solved

Install AWS CLI through Jamf

  • September 13, 2017
  • 5 replies
  • 9 views

Forum|alt.badge.img+4

Hi, I'm looking to make a policy that will install AWS CLI, and have been running into a few problems. I originally tried via pip, but ran into permissions issues during the execution.

I then tried via brew, however I am running into a roadblock there. Currently, I am able to successfully get brew installed via a script I found here. I then created another policy with the command 'brew install awsci', configured under files and processors-> execute comand, but get the response 'brew not found'.

I accounted this to the command being run as root instead of the user, so I then tried to create a script (attached below) that would run as the current user. Unfortunately, it returned with: 'Script result: bash: brew: command not found'

I am able to manually enter the command 'brew install awscli' from the logged in user via terminal, so I know that works...any thoughts on how to get this working completely via jamf?

Thanks in advance

Best answer by Asnyder

You might want to setup an if/then to make sure homebrew is installed and if not then install it and then install awscli. There could be something else causing it to throw that error but I would double check all endpoints have it installed. If you know it's installed try adding the path to the command. I think it would look like "/usr/local/bin/brew install awscli".

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+10
  • Valued Contributor
  • 224 replies
  • Answer
  • September 13, 2017

You might want to setup an if/then to make sure homebrew is installed and if not then install it and then install awscli. There could be something else causing it to throw that error but I would double check all endpoints have it installed. If you know it's installed try adding the path to the command. I think it would look like "/usr/local/bin/brew install awscli".


stevewood
Forum|alt.badge.img+35
  • Employee
  • 1797 replies
  • September 13, 2017

@discounteggroll as @Asnyder pointed out at the end, you probably need to call the full path to the brew binary. You can probably use which or do a find to figure out where the brew binary is located and then use that path in your script:

which brew

or

sudo find / -name "brew" -print


Forum|alt.badge.img+4

Thanks you two, I modified the script to add the path, and it now works as expected.


bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • September 16, 2017

There's also some AutoPkg recipes for this title, with some EA's that might help: https://github.com/autopkg/dataJAR-recipes/tree/master/AWSCLI


Mcleveland
Forum|alt.badge.img+7
  • New Contributor
  • 9 replies
  • February 8, 2024

A lot has changed during this time, but just in case anyone goes to this post:

https://github.com/Installomator/Installomator <--- would be a good resource to use

awscli2) # credit: Bilal Habib (@Pro4TLZZ) name="AWSCLI" type="pkg" packageID="com.amazon.aws.cli2" downloadURL="https://awscli.amazonaws.com/AWSCLIV2.pkg" appNewVersion=$( curl -fs "h

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings