When you deploy your software solution and you are configuring manually, then you may forgot and need to look back what is missed. Anyway, it will take long time to configure and troubleshot is very likely. Infra as a code can help in this regard.
Refer here and then set the Path via here (needed for locating the Ansible binary)
https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#task
https://stackoverflow.com/questions/42417079/how-to-debug-ansible-issues
https://stackoverflow.com/questions/34334377/how-to-specify-user-name-in-host-file-of-ansible
Edit /etc/sudoers file to allow password less sudo
Refer:https://stackoverflow.com/questions/25582740/missing-sudo-password-in-ansible
Refer: https://docs.ansible.com/ansible/2.3/docker_service_module.html
Use files option
Refer: https://docs.ansible.com/ansible/2.6/modules/docker_service_module.html
Refer: https://stackoverflow.com/questions/24095807/ansible-get-the-username-from-the-command-line
Use shell option in Task
Refer: https://docs.ansible.com/ansible/latest/modules/shell_module.html
For running multiple commands, use with_items
Ref: https://docs.ansible.com/ansible/latest/plugins/lookup/items.html
Refer: https://docs.ansible.com/ansible/latest/modules/copy_module.html
To add timestamp in the file name
Refer: http://www.mydailytutorials.com/working-date-timestamp-ansible/
Refer: https://www.tutorialspoint.com/ansible/ansible_variables.htm
Refer: https://docs.ansible.com/ansible/latest/modules/import_playbook_module.html
Refer: https://www.serverlab.ca/tutorials/dev-ops/automation/how-to-use-ansible-to-deploy-your-website/
Use become_user
Refer: https://stackoverflow.com/questions/31640637/ansible-how-to-clone-a-repository-as-other-user
Use vars_files
Refer: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
Add user to docker group so that command can be run without any sudo
Ref: https://groups.google.com/forum/#!topic/ansible-project/MrfR-FfsVMg
Ref: https://docs.ansible.com/ansible/latest/modules/user_module.html
Ref: https://docs.ansible.com/ansible/latest/reference_appendices/faq.html
https://stackoverflow.com/questions/27733511/how-to-set-linux-environment-variables-with-ansible
Example: % ansible-playbook deploy/deploy_neo4jdb.yml --tags "configure"
Use tag in the playbook task
Refer: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html
https://www.youtube.com/watch?v=4nKW2eF-nIw
https://www.serverlab.ca/tutorials/dev-ops/automation/how-to-use-ansible-to-deploy-your-website/