Run command on the Ansible host

后端 未结 8 1307
小鲜肉
小鲜肉 2020-12-22 14:45

Is it possible to run commands on the Ansible host?

My scenario is that I want to take a checkout from a git server that is hosted internally (and isn\'t accessible

8条回答
  •  半阙折子戏
    2020-12-22 15:23

    I've found a couple other ways you can write these which are a bit more readable IMHO.

    - name: check out a git repository
      local_action: 
        module: git
        repo: git://foosball.example.org/path/to/repo.git
        dest: /local/path
    

    OR

    - name: check out a git repository
      local_action: git
      args:
        repo: git://foosball.example.org/path/to/repo.git
        dest: /local/path
    

提交回复
热议问题