-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcommon.sh
More file actions
25 lines (23 loc) · 806 Bytes
/
common.sh
File metadata and controls
25 lines (23 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
##########################
## Standard Command
##########################
source /var/tmp/catalogpack_vars.txt
yum update -y
pip install ansible
yum install -y git gcc openssl-devel libffi-devel
cd ~
git clone https://github.com/cloudpack/c-ansible.git
##########################
## Standard Parameter
##########################
aws_region=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g')
cat <<EOF > c-ansible/group_vars/all.yml
aws_region: "${aws_region}"
EOF
##########################
## Ansible Exec
##########################
/usr/local/bin/ansible-playbook -i "localhost," -c local c-ansible/common.yml\
-e aws_region=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g')
-e awslogs=enable