How to get the host name of the current machine as defined in the Ansible hosts file?

前端 未结 3 931
情书的邮戳
情书的邮戳 2020-12-07 16:12

I\'m setting up an Ansible playbook to set up a couple servers. There are a couple of tasks that I only want to run if the current host is my local dev host, named \"local\"

3条回答
  •  生来不讨喜
    2020-12-07 16:50

    This is an alternative:

    - name: Install this only for local dev machine
      pip: name=pyramid
      delegate_to: localhost
    

提交回复
热议问题