diff options
Diffstat (limited to 'ansible-server/src/main/scripts/startAnsibleServer.sh')
-rw-r--r-- | ansible-server/src/main/scripts/startAnsibleServer.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ansible-server/src/main/scripts/startAnsibleServer.sh b/ansible-server/src/main/scripts/startAnsibleServer.sh index 51018475..03b1498d 100644 --- a/ansible-server/src/main/scripts/startAnsibleServer.sh +++ b/ansible-server/src/main/scripts/startAnsibleServer.sh @@ -3,8 +3,20 @@ exec &> >(tee -a "/var/log/ansible-server.log") if [ ! -f /tmp/.ansible-server-installed ] then - cp /etc/ansible/ansible.cfg /etc/ansible/ansible.cfg.orig - cat /etc/ansible/ansible.cfg.orig | sed -e 's/#host_key_checking/host_key_checking/' > /etc/ansible/ansible.cfg + if [ -f /etc/ansible/ansible.cfg ] + then + cp /etc/ansible/ansible.cfg /etc/ansible/ansible.cfg.orig + cat /etc/ansible/ansible.cfg.orig | sed -e 's/#host_key_checking/host_key_checking/' > /etc/ansible/ansible.cfg + else + if [ ! -d /etc/ansible ] + then + mkdir /etc/ansible + fi + cat > /etc/ansible/ansible.cfg <<-END +[defaults] +host_key_checking = False +END + fi date > /tmp/.ansible-server-installed 2>&1 fi |