Override hosts variable of Ansible playbook from the command line

前端 未结 11 1781
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 12:29

This is a fragment of a playbook that I\'m using (server.yml):

- name: Determine Remote User
  hosts: web
  gather_facts: false
  roles:
    - {         


        
11条回答
  •  半阙折子戏
    2020-12-12 13:31

    If you want to run a task that's associated with a host, but on different host, you should try delegate_to.

    In your case, you should delegate to your localhost (ansible master) and calling ansible-playbook command

提交回复
热议问题