diff --git a/ansible/windows.sh b/ansible/windows.sh index 13d133c6..5826b08a 100755 --- a/ansible/windows.sh +++ b/ansible/windows.sh @@ -7,19 +7,8 @@ then echo ubuntu:ubuntu | chpasswd fi -if [ "$CHECK_ANSIBLE" == "/usr/bin/ansible" ] +if [ "$CHECK_ANSIBLE" != "/usr/bin/ansible" ] then - # Setup Ansible for Local Use and Run - cp /vagrant/ansible/inventory/vagrant /etc/ansible/hosts -f - chmod 666 /etc/ansible/hosts - if [ "$VERSION_UBUNTU" == "16.04" ] - then - cat /etc/ssh/ssh_host_rsa_key.pub >> /home/ubuntu/.ssh/authorized_keys - else - cat /etc/ssh/ssh_host_rsa_key.pub >> /home/vagrant/.ssh/authorized_keys - fi - sudo ansible-playbook /vagrant/ansible/playbook_vagrant.yml -e hostname=$1 --connection=local #-vvv -else # Update Repositories if [ "$VERSION_UBUNTU" == "14.04" ] then @@ -45,14 +34,15 @@ else sudo apt-get update sudo apt-get install -y ansible --allow-unauthenticated sudo ansible-galaxy install -r /vagrant/ansible/requirements.yml - # Setup Ansible for Local Use and Run - cp /vagrant/ansible/inventory/vagrant /etc/ansible/hosts -f - chmod 666 /etc/ansible/hosts - if [ "$VERSION_UBUNTU" == "16.04" ] - then - cat /etc/ssh/ssh_host_rsa_key.pub >> /home/ubuntu/.ssh/authorized_keys - else - cat /etc/ssh/ssh_host_rsa_key.pub >> /home/vagrant/.ssh/authorized_keys - fi - sudo ansible-playbook /vagrant/ansible/playbook_vagrant.yml -e hostname=$1 --connection=local #-vvv -fi \ No newline at end of file +fi + +# Setup Ansible for Local Use and Run +cp /vagrant/ansible/inventory/vagrant /etc/ansible/hosts -f +chmod 666 /etc/ansible/hosts +if [ "$VERSION_UBUNTU" == "16.04" ] + then + cat /etc/ssh/ssh_host_rsa_key.pub >> /home/ubuntu/.ssh/authorized_keys +else + cat /etc/ssh/ssh_host_rsa_key.pub >> /home/vagrant/.ssh/authorized_keys +fi +sudo ansible-playbook /vagrant/ansible/playbook_vagrant.yml -e hostname=$1 --connection=local #-vvv \ No newline at end of file