run the script over ssh ssh user@host "path to script"
Alvaro On Tue, Feb 27, 2018 at 7:34 AM, Pradeep Patra <[email protected]> wrote: > When I run all the commands in a shell script it works fine without any > error in a separate VM. Only when I run from packer build it fails. > > On Tuesday, February 27, 2018 at 10:09:17 PM UTC+8, Alvaro Miranda > Aguilera wrote: >> >> hello >> >> if you comment our the aws cli and dont' run any more steps I assume the >> box will be created fine >> >> you are having a issue on how to install and use awscli >> >> i would suggest spin a vm and get those commands a try until you can >> confirm they work >> >> don't think is a packer issue >> >> >> Alvaro >> >> >> On Tue, Feb 27, 2018 at 1:31 AM, Pradeep Patra <[email protected]> >> wrote: >> >>> Hi all, >>> >>> I am trying to use packer(amazon-ebs) for creating the AMI. The packer >>> version I used is 1.0.2. I could able to run the below code from a simple >>> shell script and it works perfectly. But when I run using "packer build" >>> command it fails with the error " *amazon-ebs: sudo: >>> /usr/local/bin/aws: command not found" * >>> >>> Can anyone help in this regard? >>> >>> Regards >>> Pradeep >>> >>> echo "======================" >>> echo "Installing the AWS CLI" >>> echo "======================" >>> >>> python --version >>> sudo curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o >>> "/var/awscli-bundle.zip" >>> sudo yum install zip unzip -y >>> sudo unzip /var/awscli-bundle.zip -d /var >>> sudo /var/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws >>> sudo /usr/local/bin/aws --version >>> >>> >>> amazon-ebs: Downloading python_dateutil-2.6.1-py2.py3-none-any.whl >>> (194kB) >>> amazon-ebs: Requirement already satisfied: futures<4.0.0,>=2.2.0; >>> python_version == "2.6" or python_version == "2.7" in >>> /usr/lib/python2.7/site-packages (from s3transfer<0.2.0,>=0.1.12->aws >>> cli) >>> amazon-ebs: Requirement already satisfied: pyasn1>=0.1.3 in >>> /usr/lib/python2.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli) >>> amazon-ebs: Requirement already satisfied: six>=1.5 in >>> /usr/lib/python2.7/site-packages (from python-dateutil<3.0.0,>=2.1->b >>> otocore==1.9.0->awscli) >>> amazon-ebs: Installing collected packages: colorama, >>> python-dateutil, botocore, s3transfer, awscli >>> amazon-ebs: Found existing installation: python-dateutil 1.5 >>> amazon-ebs: Uninstalling python-dateutil-1.5: >>> amazon-ebs: Successfully uninstalled python-dateutil-1.5 >>> amazon-ebs: Found existing installation: botocore 1.6.0 >>> amazon-ebs: Uninstalling botocore-1.6.0: >>> amazon-ebs: Successfully uninstalled botocore-1.6.0 >>> amazon-ebs: Found existing installation: s3transfer 0.1.10 >>> amazon-ebs: Uninstalling s3transfer-0.1.10: >>> amazon-ebs: Successfully uninstalled s3transfer-0.1.10 >>> amazon-ebs: Successfully installed awscli-1.14.47 botocore-1.9.0 >>> colorama-0.3.7 python-dateutil-2.6.1 s3transfer-0.1.13 >>> >>> >>> * amazon-ebs: + sudo /usr/local/bin/aws --version* >>> * amazon-ebs: sudo: /usr/local/bin/aws: command not found* >>> >>> >>> ==> amazon-ebs: Terminating the source AWS instance... >>> >>> -- >>> This mailing list is governed under the HashiCorp Community Guidelines - >>> https://www.hashicorp.com/community-guidelines.html. Behavior in >>> violation of those guidelines may result in your removal from this mailing >>> list. >>> >>> GitHub Issues: https://github.com/mitchellh/packer/issues >>> IRC: #packer-tool on Freenode >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Packer" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/packer-tool/82a0df02-7d29-4235-96b8-d48fa8b6dc48%40googlegroups.com >>> <https://groups.google.com/d/msgid/packer-tool/82a0df02-7d29-4235-96b8-d48fa8b6dc48%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Alvaro >> >> -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/002a8757-ff46-425f-aaf2-531b46661150%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/002a8757-ff46-425f-aaf2-531b46661150%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Alvaro -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0ewpnVZ%2BDCeLxu4%3D39sxbXkgG-i08MieriMg44vwoR3BnA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
