Merge "Update packages inside the container"
[ccsdk/distribution.git] / ansible-server / src / main / scripts / startAnsibleServer.sh
1 #!/bin/bash
2 exec &> >(tee -a "/var/log/ansible-server.log")
3
4 if [ ! -f /tmp/.ansible-server-installed ]
5 then
6     pip install PyMySQL
7     pip install 'cherrypy<18.0.0'
8     pip install requests
9
10     apt-get update -y
11     apt-get -y install software-properties-common
12     apt-add-repository -y ppa:ansible/ansible
13     apt-get -y install ansible
14
15     cp /etc/ansible/ansible.cfg /etc/ansible/ansible.cfg.orig
16     cat /etc/ansible/ansible.cfg.orig | sed -e 's/#host_key_checking/host_key_checking/' > /etc/ansible/ansible.cfg
17     date > /tmp/.ansible-server-installed 2>&1
18 fi
19
20 cd /opt/onap/ccsdk
21 exec /usr/bin/python RestServer.py