forked from StackStorm/showcase-ansible-chatops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ansible.sh
executable file
·26 lines (19 loc) · 841 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
#!/usr/bin/env bash
set -e
echo "#############################################################################################"
echo "########################### Prepare StackStorm and Ansible ##################################"
# Install ansible integration pack
st2 run packs.install packs=ansible
# Install our custom pack with ansible ChatOps command aliases
st2 run packs.install packs=st2-chatops-aliases repo_url=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