Wednesday, 6 May 2020

Ansible JOBS AND PROCESS CONTROL


run Ansible ad hoc with 10 parallel forks
ansible -i hosts testnode1 -a "uname -a" -f 10

show human readable output
add this line to ansible.cfg
stdout_callback=yaml

Ansible PACKAGES AND INSTALLATION

#install multiple packages
yum: name="{{ item }}" state=present
with_items:
  - http 
  - htop
  - myapp

Ansible SERVER DIAGNOSTICS

Test Connection
ansible -i hosts all -m ping -u root

Diagnostics



manage nodes via "/etc/ansible/hosts" file

Debug (debug output for playbook)
- debug: var=result verbosity=2  

Ansible REMOTE CMD (Ad Hoc)


Ping specific node
ansible -i hosts nycweb01.prod.local -m ping

Ping with wildcard
ansible -i hosts "nycweb*" -m ping

Ping all nodes with SSH user 'root'
ansible -i hosts all -m ping -u root

run a command
ansible -i hosts dev -a 'uname -a'

check Yum packages
ansible -i hosts dev -m yum 

check if Docker rpm is installed
ansible -i hosts web01.nyc.local -m shell -a "rpm -qa | grep docker"

Get facts about a box
ansible -i hosts web01.nyc.local -m setup -a 'filter=facter_*'

run command with sudo
ansible -i hosts target-host -m shell -a "cat /etc/sudoers" --sudo 

limit command to a certain group or server: add --limit *.nyc

Copy your Ansible Master's public key to the managed node

ssh-keygen  ## generate public key
ssh-copy-id <name of node>  # copy key, provide password to node

Saturday, 2 May 2020

uninstall any application in windows 10 via cmd


Below example is to uninstall onedrive


  1. Open Command Prompt as Administrator

  2. Type in taskkill /f /im OneDrive.exe to terminate any OneDrive processes and hit Enter.

  3. Type in %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall if you’re using 64-bit Windows 10 and hit Enter.

Wednesday, 29 April 2020

k8s pod ??

A pod is the smallest object model that you can create and run. You can add labels to a pod to identify a subset to run operations on. When you are ready to scale your app, you can use the label to tell Kubernetes which Pod you need to scale. 
A pod typically represents a process in your cluster. Pods contain at least one container that runs the job and additionally might have other containers in it called sidecars for monitoring, logging, and so on. Essentially, a pod is a group of containers.

$ kubectl (create|get|apply|delete) -f Resource.yaml

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...