{"action":"opened","issue":{"url":"https://api.github.com/repos/RedHatEMEA/aws-ose3/issues/4","labels_url":"https://api.github.com/repos/RedHatEMEA/aws-ose3/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/RedHatEMEA/aws-ose3/issues/4/comments","events_url":"https://api.github.com/repos/RedHatEMEA/aws-ose3/issues/4/events","html_url":"https://github.com/RedHatEMEA/aws-ose3/issues/4","id":114249943,"number":4,"title":"script to iterate all hosts from creds.csv and set passwords","user":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-30T11:12:30Z","updated_at":"2015-10-30T11:12:30Z","closed_at":null,"body":"#!/bin/bash \r\nidentity=${1}\r\nif [ \"${identity}\" = \"\" ]\r\nthen\r\n    echo \"** PLEASE PROVIDE A PATH TO AWS IDENTITY CREDENTIALS (PEM FILE)**\" \r\n    exit 255\r\nfi\r\nwhile read line\r\ndo\r\n   OLDIFS=$IFS;\r\n   IFS=, vals=($line)\r\n   IFS=$OLDIFS\r\n\r\n   name=${vals[0]}\r\n   ip=${vals[1]}\r\n   dns=$(echo ${vals[2]} | cut -d '\"' -f2)\r\n   pwd=$(echo ${vals[3]} | cut -d '\"' -f2)\r\n\r\n   echo \"*** Updating password for ${name}\"\r\n   ssh -o StrictHostKeyChecking=no cloud-user@${dns} -i ${identity} -tt \"echo ${pwd} | sudo passwd demo --stdin\" < /dev/null\r\n\r\ndone < creds.csv"}}