CJChandan Joshiindevopswithcj.com·Feb 10, 2023 · 4 min readAnsible StrategiesAnsible strategy defines how a playbook is executed in ansible. --- # sample ansible playbook (strategies) - name: Deploy a web application hosts: server1 tasks: - name: Install dependencies #-----<Some Code>----- - name: Install M...00
CJChandan Joshiindevopswithcj.com·Feb 10, 2023 · 3 min readAnsible Handlers, Conditions, and LoopsA handler is exactly the same as a task, but it will run when called by another task OR Handlers are just like regular tasks in an ansible playbook but are only run if the task conta...00
CJChandan Joshiindevopswithcj.com·Feb 8, 2023 · 3 min readHow to handle long-running tasks in Ansible/ Ansible Asynchronous Actions and PollingBy default, Ansible runs tasks synchronously holding the connections to the remote node open until the action is completed. This means within a playbook, each task blocks the next task by default, meaning the subsequent task will not run until the cu...00
CJChandan Joshiindevopswithcj.com·Feb 6, 2023 · 4 min readAnsible ModulesAnsible works by connecting to your nodes and pushing out small programs, called modules. Ansible modules are categorized into various groups based on their functionality Ansible modules should follow the idempotency principle, which means that con...00
CJChandan Joshiindevopswithcj.com·Feb 5, 2023 · 6 min readVariables in AnsibleVariables are used to store values that can be later used in the playbook. Host variable We will use our default inventory file - /etc/ansible/hosts In this inventory file, we will define 2 variables for server 2 Demo Inventory file - s...00