diff --git a/VERSION.yml b/VERSION.yml index 0ab8ed80..dba16183 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1 +1 @@ -version: 1.7.6 +version: 1.7.7 diff --git a/provisioners/redhat/modules/iptables.sh b/provisioners/redhat/modules/iptables.sh index ed7ba853..321c89d8 100644 --- a/provisioners/redhat/modules/iptables.sh +++ b/provisioners/redhat/modules/iptables.sh @@ -1,8 +1,6 @@ redhat_ip="$(echo "${configuration}" | shyaml get-value environments.${1}.servers.redhat.ip)" redhat_ip_private="$(echo "${configuration}" | shyaml get-value environments.${1}.servers.redhat.ip)" -# list adapters -ifconfig # remove all rules sudo iptables --flush # we're not a router diff --git a/provisioners/redhat/modules/rsync.sh b/provisioners/redhat/modules/rsync.sh index f3134c98..1c7189f7 100644 --- a/provisioners/redhat/modules/rsync.sh +++ b/provisioners/redhat/modules/rsync.sh @@ -1,3 +1,11 @@ +if [ "${1}" == "dev" ]; then + test_redhat_ip="$(echo "${configuration}" | shyaml get-value environments.test.servers.redhat.ip)" + production_redhat_ip="$(echo "${configuration}" | shyaml get-value environments.production.servers.redhat.ip)" +else + test_redhat_ip="$(echo "${configuration}" | shyaml get-value environments.test.servers.redhat.ip_private)" + production_redhat_ip="$(echo "${configuration}" | shyaml get-value environments.production.servers.redhat.ip_private)" +fi + echo "${configuration}" | shyaml get-values-0 websites.apache | while IFS='' read -r -d '' key; do @@ -11,30 +19,30 @@ while IFS='' read -r -d '' key; do elif [ "${software}" = "drupal6" ]; then if ([ "${software_workflow}" = "downstream" ] && [ "$1" != "production" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ from production..." - sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.production.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}sites/default/files/ /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${production_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" "/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" 2>&1 | sed "s/^/\t\t/" elif ([ "${software_workflow}" = "upstream" ] && [ "$1" != "test" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ from test..." - sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.test.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}sites/default/files/ /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${test_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" "/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" 2>&1 | sed "s/^/\t\t/" else echo -e "\t * software_workflow is set to ${software_workflow} and this is ${1} - no rsync needed, skipping..." fi elif [ "${software}" = "drupal7" ]; then if ([ "${software_workflow}" = "downstream" ] && [ "$1" != "production" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ from production..." - sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.production.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}sites/default/files/ /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${production_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" "/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" 2>&1 | sed "s/^/\t\t/" elif ([ "${software_workflow}" = "upstream" ] && [ "$1" != "test" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ from test..." - sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.test.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}sites/default/files/ /var/www/repositories/apache/${domain}/${webroot}sites/default/files/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive --exclude="css/" --exclude="js/" -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${test_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" "/var/www/repositories/apache/${domain}/${webroot}sites/default/files/" 2>&1 | sed "s/^/\t\t/" else echo -e "\t * software_workflow is set to ${software_workflow} and this is ${1} - no rsync needed, skipping..." fi elif [ "${software}" = "wordpress" ]; then if ([ "${software_workflow}" = "downstream" ] && [ "$1" != "production" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ from production..." - sudo rsync --compress --delete --recursive -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.production.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ /var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${production_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/" "/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/" 2>&1 | sed "s/^/\t\t/" elif ([ "${software_workflow}" = "upstream" ] && [ "$1" != "test" ]); then echo -e "\t * rysncing /var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ from test..." - sudo rsync --compress --delete --recursive -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" root@$(echo "${configuration}" | shyaml get-value environments.test.servers.redhat.ip):/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ /var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/ 2>&1 | sed "s/^/\t\t/" + sudo rsync --compress --delete --recursive -e "ssh -oStrictHostKeyChecking=no -i /catapult/secrets/id_rsa" "root@${test_redhat_ip}:/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/" "/var/www/repositories/apache/${domain}/${webroot}wp-content/uploads/" 2>&1 | sed "s/^/\t\t/" else echo -e "\t * software_workflow is set to ${software_workflow} and this is ${1} - no rsync needed, skipping..." fi diff --git a/provisioners/redhat/provision.sh b/provisioners/redhat/provision.sh index fd4222e7..bb13a02d 100644 --- a/provisioners/redhat/provision.sh +++ b/provisioners/redhat/provision.sh @@ -30,6 +30,8 @@ cat /proc/cpuinfo | grep 'model name' | cut -d: -f2 | awk 'NR==1' | tr -d " " echo -e "$(top -bn 1 | awk '{print $9}' | tail -n +8 | awk '{s+=$1} END {print s}')% utilization" echo -e "\nHDD" df -h +echo -e "\nNET" +ifconfig echo -e "\nRAM" free -h