ansible playbook execute in this order: task, role, task, role, task -
forgive newbie question, execute 3 tasks , use 2 roles in playbook, in order:
- task
- role
- task
- role
- task
this have far (task, role, task):
--- - name: task role task hosts: 127.0.0.1 connection: local gather_facts: false pre_tasks: - name: task first foo: roles: - role: role second foo: post_tasks: - name: task third foo:
is possible or should changing tasks roles?
i recommend create roles post , pre tasks ansible.
your site.yml must this:
--- - hosts: localhost remote_user: "{{remote_user}}" sudo: yes gather_facts: false roles: - pre - main_role - post
in roles folder must have 3 roles, pre, post , main_role.
Comments
Post a Comment