diff --git a/knowledge base/pulumi.md b/knowledge base/pulumi.md index 475236c..8d77d03 100644 --- a/knowledge base/pulumi.md +++ b/knowledge base/pulumi.md @@ -151,9 +151,12 @@ pulumi down -t 'targetResourceUrn' pulumi dn -s 'stack' --exclude-protected +# View the selected stack +pulumi stack --show-name + # View stacks' state. pulumi stack -pulumi stack -ius 'stack' +pulumi stack -ius 'stack-name' pulumi stack --show-ids --show-urns --show-name --show-secrets # List stacks. diff --git a/snippets/ansible/commands.sh b/snippets/ansible/commands.sh index 725d7a0..891eb56 100644 --- a/snippets/ansible/commands.sh +++ b/snippets/ansible/commands.sh @@ -63,9 +63,10 @@ ansible-navigator run 'playbook.yml' --execution-environment-image='ee/image' ansible-navigator \ --container-options='--platform=linux/amd64' --pull-policy='missing' \ --mode='stdout' \ + --execution-environment-volume-mounts="$HOME/.aws:/runner/.aws:ro" \ + --set-environment-variable='ANSIBLE_VAULT_PASSWORD_FILE=vault.passwd.txt' \ --set-environment-variable='AWS_DEFAULT_REGION=eu-west-1' \ --pass-environment-variable='AWS_PROFILE' \ - --execution-environment-volume-mounts="$HOME/.aws:/runner/.aws:ro" \ run \ --enable-prompts -i 'localhost,' \ 'playbook.yml' \ @@ -108,7 +109,10 @@ ANSIBLE_VAULT_PASSWORD='ohSuchASecurePassword' ansible-vault encrypt --output 's ansible-vault view 'ssh.key.pub' --vault-password-file 'password_file.txt' ansible-vault edit 'ssh.key.pub' ANSIBLE_VAULT_PASSWORD_FILE='password_file.txt' ansible-vault decrypt --output '.ssh/id_rsa' 'ssh.key' -diff 'some_role/files/ssh.key.plain' <(ansible-vault view --vault-password-file 'password_file.txt' 'some_role/files/ssh.key.enc') +ANSIBLE_VAULT_PASSWORD_FILE='password_file.txt' ansible-navigator \ + --pass-environment-variable='ANSIBLE_VAULT_PASSWORD_FILE' run 'playbook_with_vault_encrypted_data.yml' +diff 'some_role/files/ssh.key.plain' \ + <(ansible-vault view --vault-password-file 'password_file.txt' 'some_role/files/ssh.key.enc') echo -e '$ANSIBLE_VAULT;1.1;AES256\n386462…86436' | ansible-vault decrypt --ask-vault-password # List available plugins diff --git a/snippets/awx.sh b/snippets/awx.sh index d4da89b..bd168bb 100644 --- a/snippets/awx.sh +++ b/snippets/awx.sh @@ -36,6 +36,7 @@ curl -fs --user 'admin:password' 'https://awx.example.org/api/v2/job_templates/' # Show one job template awx job_templates get "This job template's name" | jq -S '.' - +curl -fs --user 'admin:password' 'https://awx.example.org/api/v2/job_templates/' | jq '.results[]|select(.id==22)' - # Modify job templates awx job_templates modify '1' --extra_vars "@vars.yml" diff --git a/snippets/openssl.sh b/snippets/openssl.sh index 4fb4117..f455432 100644 --- a/snippets/openssl.sh +++ b/snippets/openssl.sh @@ -142,6 +142,10 @@ openssl pkcs12 -export -out 'certificate.pfx' -inkey 'private.key.pem' -in 'cert # Convert PKCS#12 files (.pfx .p12) containing private keys and certificates to PEM openssl pkcs12 -in 'keystore.pfx' -out 'keystore.pem' -nodes +# Show certificate details +openssl x509 -noout -dates -issuer -subject -in 'certificate.pem' +openssl s_client -connect 'www.google.com:443' | openssl x509 -noout -dates -issuer -subject + ## # TLS client diff --git a/snippets/peerdb.fish b/snippets/peerdb.fish index 3835214..93e3298 100644 --- a/snippets/peerdb.fish +++ b/snippets/peerdb.fish @@ -120,9 +120,9 @@ curl -fsS --url 'http://localhost:3000/api/v1/alerts/config' -X 'POST' \ "service_type": "slack", "service_config": "{\"slot_lag_mb_alert_threshold\":15000,\"open_connections_alert_threshold\":20,\"auth_token\":\"xoxb-012345678901-0123456789012-1234ABcdEFGhijKLMnopQRST\",\"channel_ids\":[\"C01K23X4567\"]}", "alert_for_mirrors": [ - "odoo_pg_to_sf", - "pikachu_ke_pg_to_sf", - "pikachu_zm_pg_to_sf" + "odoo_postgres_to_snowflake", + "product_korea_postgres_to_snowflake", + "product_zimbabwe_postgres_to_snowflake" ] } }' diff --git a/snippets/pulumi/commands.fish b/snippets/pulumi/commands.fish index 66e5070..64e0dad 100644 --- a/snippets/pulumi/commands.fish +++ b/snippets/pulumi/commands.fish @@ -64,6 +64,9 @@ find '.' -type f -name 'Pulumi.yaml' -not -path "*/node_modules/*" -exec dirname find '.' -type f -name 'Pulumi.yaml' -not -path "*/node_modules/*" -exec dirname {} + | xargs -pn '1' pulumi preview --parallel "$(nproc)" --cwd find '.' -type f -name 'Pulumi.yaml' -not -path "*/node_modules/*" -exec dirname {} + | xargs -pn '1' pulumi refresh --parallel "$(nproc)" -s 'dev' --non-interactive -v '3' --cwd +# View the selected stack +pulumi stack --show-name + # Rename stacks pulumi stack rename -s 'dev' 'staging' # When the project name (and backend) changed