#!/usr/bin/env bash
#get OS distro
. /etc/os-release
OS=$NAME
VER=$VERSION_ID

echo "Installing dependencies..."
bash utils/install-base-dependencies.sh


#echo "Installing puppet agent..."
#if [[ $NAME =~ "Ubuntu" ]];
#then
#    CODENAME=$VERSION_CODENAME
#    PKG="puppet7-release-$CODENAME.deb"
#    URL="https://apt.puppet.com/$PKG"
#
#    wget "$URL"
#    dpkg -i "$PKG"
#    apt-get update
#    apt-get install puppet-agent -y
#
#    #NTP setup
#    echo "Installing and syncing ntp..."
#    apt-get install ntp -y
#    systemctl stop ntp
#    ntpd -gq
#    systemctl start ntp
#    systemctl enable ntp
#fi
#
#if [[ $NAME =~ "Debian GNU/Linux" ]];
#then
#    apt-get update
#    apt-get install puppet-agent -y
#fi
#
#
#if [[ $NAME =~ "CentOS Linux" ]];
#then
#    yum install epel-release -y
#    yum install puppet-agent
#fi
#
##Puppet setup
#echo "Starting puppet service"
#sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true

ansible-playbook puppet/configure-puppet/site.yml