ansible.rst
changeset 2447 cb043d4756a2
parent 2443 0c3dea222c3c
child 2448 1a02d5429a5d
equal deleted inserted replaced
2446:ad63d001b5f4 2447:cb043d4756a2
    89   Ansible Configuration Settings.
    89   Ansible Configuration Settings.
    90 https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
    90 https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
    91   Magic variables.
    91   Magic variables.
    92 https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html
    92 https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html
    93   Discovering variables: facts and magic variables.
    93   Discovering variables: facts and magic variables.
       
    94 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/set_fact_module.html
       
    95   ``ansible.builtin.set_fact`` – Set host facts from a task.
    94 
    96 
    95 Inventory:
    97 Inventory:
    96 
    98 
    97 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/generator_inventory.html
    99 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/generator_inventory.html
    98   Uses Jinja2 to construct hosts and groups from patterns.
   100   Uses Jinja2 to construct hosts and groups from patterns.
       
   101 
       
   102 Collections:
       
   103 
       
   104 https://docs.ansible.com/ansible/latest/user_guide/collections_using.html
       
   105   Using collections.
       
   106 https://docs.ansible.com/ansible/2.10/collections/index.html
       
   107   Collection Index.
    99 
   108 
   100 Inclusion:
   109 Inclusion:
   101 
   110 
   102 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html
   111 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html
   103   Include a play or task list.
   112   Include a play or task list.
   106 
   115 
   107 https://jinja.palletsprojects.com/en/master/templates/
   116 https://jinja.palletsprojects.com/en/master/templates/
   108   Jinja template language. List of Builtin Filters.
   117   Jinja template language. List of Builtin Filters.
   109 https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html
   118 https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html
   110   Using filters to manipulate data.
   119   Using filters to manipulate data.
       
   120 
       
   121 Execution:
       
   122 
       
   123 https://docs.ansible.com/ansible/latest/user_guide/playbooks_strategies.html
       
   124   Controlling playbook execution: strategies and more.
       
   125 https://docs.ansible.com/ansible/latest/plugins/strategy.html
       
   126   Strategy Plugins.
       
   127 https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html
       
   128   Controlling where tasks run: delegation and local actions.
       
   129 https://docs.ansible.com/ansible/latest/reference_appendices/general_precedence.html
       
   130   Controlling how Ansible behaves: precedence rules.
       
   131 https://docs.ansible.com/ansible/latest/user_guide/playbooks_handlers.html
       
   132   Handlers: running operations on change.
       
   133 https://docs.ansible.com/ansible/latest/collections/ansible/builtin/setup_module.html
       
   134   ansible.builtin.setup – Gathers facts about remote hosts.
   111 
   135 
   112 Search path
   136 Search path
   113 ===========
   137 ===========
   114 
   138 
   115 Files, templates, variables definitions are looked in ``files``, ``templates``, ``vars`` role / play
   139 Files, templates, variables definitions are looked in ``files``, ``templates``, ``vars`` role / play
   132 =========
   156 =========
   133 
   157 
   134 https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html
   158 https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html
   135   Templating (Jinja2).
   159   Templating (Jinja2).
   136 
   160 
       
   161 Execution
       
   162 =========
       
   163 
       
   164 ``-f`` option controls forking: how many executors are started to perform tasks.
       
   165 
       
   166 The way tasks are processed depends on ``strategy`` and ``serial``.
       
   167 
       
   168 ``strategy`` * ``serial`` can be defined on each ``hosts`` in a play::
       
   169 
       
   170   - hosts: web
       
   171     strategy: free
       
   172     serial: 50%
       
   173   - hosts: db
       
   174     strategy: linear
       
   175     serial: 1
       
   176 
       
   177 * With ``linear`` strategy all workers execute the same tasks, idling until every is finished the
       
   178   task. Then next task is executed. ``serial`` sets how many hosts at a time to run at a time to the
       
   179   end of subplay.
       
   180 * With ``free`` strategy tasks are executed without waiting for completion of the same task on every
       
   181   host.
       
   182