mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-16 00:34:25 +00:00
chore: postgresql services file and rds commands
This commit is contained in:
@@ -38,6 +38,14 @@ postgres.lan:5643:postgres:postgres:BananaORama
|
||||
*:*:sales:elaine:modestPassword
|
||||
EOF
|
||||
chmod '600' ~/'.pgpass'
|
||||
|
||||
# Set up the per-user services file.
|
||||
cat <<EOF > ~/'.pg_service.conf'
|
||||
[prod]
|
||||
host = prod.0123456789ab.eu-west-1.rds.amazonaws.com
|
||||
port = 5433
|
||||
user = master
|
||||
EOF
|
||||
```
|
||||
|
||||
```sh
|
||||
@@ -51,6 +59,7 @@ psql 'my-db' 'user'
|
||||
psql 'postgresql://host:5433/my-db?sslmode=require'
|
||||
psql -U 'username' -d 'my-db' -h 'hostname' -p 'port' -W
|
||||
psql --host 'host.fqnd' --port '5432' --username 'postgres' --database 'postgres' --password
|
||||
psql "service=prod sslmode=require"
|
||||
|
||||
# List available databases.
|
||||
psql … --list
|
||||
|
||||
@@ -384,3 +384,10 @@
|
||||
-r --no-role-passwords
|
||||
changed_when: false
|
||||
register: dump_execution
|
||||
- name: Wait for pending changes to be applied
|
||||
amazon.aws.rds_instance_info:
|
||||
db_instance_identifier: "{{ db_instance_identifier }}"
|
||||
register: instance_check
|
||||
retries: 12
|
||||
delay: 15
|
||||
until: instance_check.instances[0].pending_modified_values.keys() | length > 0
|
||||
|
||||
@@ -79,6 +79,17 @@ echo {1..5} | xargs -p -n '1' -I '{}' aws rds start-export-task …
|
||||
|
||||
aws rds describe-export-tasks --query 'ExportTasks[].WarningMessage' --output 'json'
|
||||
|
||||
aws rds restore-db-instance-to-point-in-time \
|
||||
--source-db-instance-identifier 'awx' --target-db-instance-identifier 'awx-pitred' \
|
||||
--restore-time '2024-07-31T09:29:40+00:00' \
|
||||
--allocated-storage '20'
|
||||
|
||||
aws rds restore-db-instance-from-db-snapshot \
|
||||
--db-instance-identifier 'awx-pitr-snapshot' \
|
||||
--db-snapshot-identifier 'rds:awx-2024-07-30-14-15'
|
||||
|
||||
aws rds delete-db-instance --skip-final-snapshot --db-instance-identifier 'awx'
|
||||
|
||||
aws s3api list-buckets --output 'text' --query 'Buckets[].Name' | xargs -pn '1' aws s3api list-multipart-uploads --bucket
|
||||
|
||||
aws ec2 describe-volumes --output 'text' --filters 'Name=status,Values=available' \
|
||||
|
||||
Reference in New Issue
Block a user