Posts

Showing posts from 2019

AWS Services List : All you need to know

Image
AWS Services List - All the services you need to know:

Working with Git command line

Working with Git CLI   Core concepts: git config --global user.name=‘isharma’ git config --global user.email='xyz@abc.com’ git config   --list   git status [ Check the current status ]   Git remote add origin [Url to empty git branch on Remote] [This will basically create repo from local directory] Git steps: Working Area, Staging Area, History, Git Server git branch -r [ Check all the branches ] git branch -b ‘branch-name’ [create new local branch] Git add . [move changes to Staging Area from the working area] Git diff [Difference between changes in the working area to staging area] Git commit -m ‘msg’ [move changes from staging area to git history] Git diff   --staged [difference between changes in the staging area to git history] Git push origin master: master [move changes from history to git server] Git reset HEAD ‘added files’ [Revert the changes done to history   area] Git checkout   -- ‘committed files’ [Revert th...

Best practices for writing better ansible playbooks

Some of the best practices for writing the clean and scalable ansible playbooks: Maintain all ansible code in git. Maintain the standard directory structure. Here is the reference:  https://github.com/Indu-sharma/learningansible Use requirements.txt for python dependencies management and requirements.yml for ansible-galaxy modules/roles. Configure ansible_stdout_callback, log file path, forks in ansible.cfg. Always use -check mode for ansible playbooks for the dry run.  Verify all your variables in advance with -m setup. Use ansible-galaxy init for your creating your roles directory/files structures. Within a role playbook, follow the sequence in the start Use assert to check that requirements are met Install packages Use Validate for Template config files  Trigger handlers when config files have been changed   Avoid using shell/command modules if possible; they are skipped in -check mode. Avoid using set_facts; they are not visible when us...