- An active LastPass account
- LastPass cli installed, see here
name: my-super-secretusername: my-super-secret-usernamepassword: my-super-secret-password
| cd /var/log | |
| touch syslog | |
| chown syslog:adm syslog | |
| service rsyslog restart | |
| logger "Didier MISSON logger test" |
| source /etc/os-release | |
| echo $UBUNTU_CODENAME # xenial |
| export PIVNET_TOKEN="123456" # Get from network.pivotal.io | |
| export DEPLOYMENT_URL="http://network.pivotal.io" # This is the API download URL for your release | |
| export FILE_NAME="ert.zip" # This is the name of the file that gets created locally | |
| # download from pivnet | |
| wget -O "$FILE_NAME" --post-data="" --header="Authorization: Token $PIVNET_TOKEN" "$DEPLOYMENT_URL" | |
| # download from pivnet (with special sauce for flaky connections) | |
| wget -c --tries=0 --retry-connrefused --timeout=2 --wait=1 -O "$FILE_NAME" --post-data="" --header="Authorization: Token $PIVNET_TOKEN" "$DEPLOYMENT_URL" |
| export FILE_NAME="cf-2.2.7-build.8.pivotal" # This is the name of the file (tile) to upload to om | |
| export OM_USER="admin" | |
| export OM_PWD="supersecurepassword" | |
| export OM_TARGET="ops-manager address" | |
| export OM_TIMEOUT=86400 # set a high timeout incase upload takes a while | |
| om -t $OM_TARGET -u $OM_USER -p $OM_PWD -k upload-product -p $FILE_NAME -r $OM_TIMEOUT |
name: my-super-secretusername: my-super-secret-usernamepassword: my-super-secret-password| JUMPBOX_NAME="<name of ec2 instance>" | |
| INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=$JUMPBOX_NAME" \ | |
| --output text --query 'Reservations[*].Instances[*].InstanceId') | |
| aws ssm start-session --target "$INSTANCE_ID" |
| export OM_KEY=om.pem | |
| terraform output ops_manager_ssh_private_key > $OM_KEY | |
| chmod 0600 $OM_KEY | |
| CREDS=$(om -t $OM_TARGET --skip-ssl-validation curl --silent \ | |
| -p /api/v0/deployed/director/credentials/bosh_commandline_credentials | \ | |
| jq -r .credential | sed 's/bosh //g') | |
| # this will set BOSH_CLIENT, BOSH_ENVIRONMENT, BOSH_CLIENT_SECRET, and BOSH_CA_CERT | |
| # however, BOSH_CA_CERT will be a path that is only valid on the OM VM |
| interpolate-creds: &interpolate-creds | |
| do: | |
| - task: tfstate-interpolate | |
| image: platform-automation-image | |
| ... | |
| ... | |
| - task: credhub-interpolate | |
| ... | |
| ... | |
| etc |
| REVOKE CREATE ON SCHEMA public FROM PUBLIC; | |
| CREATE ROLE <db_owner> WITH LOGIN PASSWORD '<db_owner_password>'; | |
| CREATE DATABASE <db_name> WITH OWNER=<db_owner>; | |
| REVOKE ALL ON DATABASE <db_name> FROM public; | |
| GRANT ALL ON DATABASE <db_name> TO <db_owner>; |