This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in `ls -1` ; do cd ${x}; echo ${x}\: NFOS=$(ls *.nfo | wc -l) DIZS=$(ls *.diz | wc -l) ; cd .. ; done | grep -v 'NFOS=1 DIZS=1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in `ls -1` ; do cd ${x}; echo ${x}\: NFOS=$(ls *.nfo | wc -l) RARS=$(ls *.rar | wc -l) SFVS=$(ls *.sfv | wc -l) ; cd .. ; done | grep -v 'NFOS=1 RARS=1 SFVS=1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Tested on Ansible 2.9.4 | |
# ansible-playbook -i localhost, -e "ami_backup_ec2_name=sandbox-dev-b" -e "ami_backup_count=3" -e "ami_backup_remove=yes" -e "ami_backup_ec2_region=ap-southeast-2" playbook-backup_ami_role.yml | |
# Copyright (c) 2020 Lucian Maly, Red Hat | |
- name: 1.0 | BACKUP_AMI | Gathering information about the instance {{ ami_backup_ec2_name }}. | |
ec2_instance_info: | |
filters: | |
"tag:Name": "{{ ami_backup_ec2_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: 01 | Run Normal Tasks | |
hosts: all | |
gather_facts: no | |
vars: | |
ansible_connection: local | |
tasks: | |
- debug: var=vars | |
- name: 01.1 | FACT >> Set Status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Tested on Ansible 2.9.4 | |
# Assign a FQDN of Windows machine based on the existence of hostname.properties | |
# Copyright (c) 2020 Lucian Maly, Red Hat | |
- name: 1.0 | FAILOVER_PORTAL | Find out if the 'hostname.properties' file exists. | |
win_stat: | |
path: 'C:\Program Files\PRODUCT\FOLDER1\FOLDER2\etc\hostname.properties' | |
register: hostname_stat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Tested on Ansible 2.9.4 | |
# aws_s3 module lists all objects, including folders - that is sometimes undesirable | |
# Copyright (c) 2020 Lucian Maly, Red Hat | |
- hosts: localhost | |
gather_facts: false | |
vars: | |
s3_keys: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Tested on Ansible 2.9.4 & Tower 3.6.4 | |
# Passing Sumologic accessID/accessKEY from the Microsoft Azure Key Vault to the playbook example | |
# Copyright (c) 2020 Lucian Maly, Red Hat | |
# Configuration in Tower: | |
# 1) Credentials > prod-ansible-azure-kms: | |
# a/ VAULT URL (DNS NAME) | |
# b/ CLIENT ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type f -iname "*.mkv" -execdir sh -c 'md5sum {} > $(basename {} .mkv).md5' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for x in $(ls -1); do mv {${x},$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)}; done | |
# Before: | |
# ~ ls | |
# ~ IMG_20200522_225920.jpg IMG_20200522_230114.jpg IMG_20200522_230302.jpg | |
# After: | |
# ~ ls | |
# ~ 14pkJd 4ld2t9 6foTRm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'First you must get the pull-secret.txt from `https://cloud.redhat.com/openshift/install/pre-release` to the same directory where you run this from' | |
# Exports - required environment variables: | |
DEFAULT_OCPVERSION="4.4.3" | |
DEFAULT_ARCH="x86_64" | |
LOCAL_REPOSITORY="openshift/ocp${OCP_RELEASE}" | |
PRODUCT_REPO="openshift-release-dev" | |
LOCAL_SECRET_JSON="pull-secret.txt" |