forked from StackStorm/showcase-ansible-chatops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible.sh
executable file
·29 lines (21 loc) · 886 Bytes
/
ansible.sh
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
26
27
28
29
#!/usr/bin/env bash
set -e
echo "#############################################################################################"
echo "########################### Prepare StackStorm and Ansible ##################################"
# Install Ansible core dependencies
sudo apt-get install -y gcc libkrb5-dev
# Install ansible integration pack
st2 pack install ansible
# Install our custom pack with ansible ChatOps command aliases
st2 pack install https://github.com/armab/st2_chatops_aliases
# Needed by ansible
apt-get install -y sshpass
# cowsay via ChatOps
apt-get install -y cowsay
# Copy ansible config files from vagrant shared directory to '/etc/ansible'
st2 run ansible.command_local module_name=synchronize args='src=/vagrant/ansible/ dest=/etc/ansible'
chown -R root:root /etc/ansible
chmod -R 755 /etc/ansible
chmod 640 $(find /etc/ansible -type f)
echo "Done!"
exit 0