emAmazed / redlamp

Bloggie Bloggie
MIT License
0 stars 1 forks source link

Working with Ansible on Mac OS X #28

Open emAmazed opened 7 years ago

emAmazed commented 7 years ago

Initial Installation

Note: For Ansible installation on Mac, I will highly recommend using package installation. This will avoid additional step to manually create configure file such as install from the source or using brew install.

You should have something look like this: alt text

Troubleshooting on Configuration

Create ansible hosts inventory file

Ad-Hoc ansible command

ansible webservers -s -C -m yum -a "name=httpd state=latest"

Playbook

Install boto to connect S3 bucket

sudo pip install boto

alt text

Install awscli Tool on OSX

This will install the most recent version of awscli

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

unzip awscli-bundle.zip

install awscli tool to your preferred location

./awscli-bundle/install -b my/preferred/path/aws

get PATH from workspace

export $PATH | grep my/preferred/path

add awscli path to your env PATH

export PATH=my/preferred/path:$PATH

OR

create symbolic link from your PATH

ln -s my/preferred/path/aws /user/local/bin/aws

Upload files to S3 bucket using ansible

alt text

Sync S3 repo to EC2 node

sudo su -

aws configure

Access ID Key ......

Secret Key ....

region [get node region]

output format [e.g. json]

aws s3 sync s3://[bucket-name]/[repo-name] [web-root]/[project-name]

Update Security Key Pairs Using Boto

alt text

Reference:

Boto Config