main.yml (735B)
1 --- 2 - name: Check for Xcode Command Line Tools 3 ansible.builtin.stat: 4 path: /Library/Developer/CommandLineTools/usr/bin/git 5 register: xcode_clt 6 7 - name: Trigger Xcode Command Line Tools install 8 ansible.builtin.command: 9 cmd: xcode-select --install 10 when: not xcode_clt.stat.exists 11 register: xcode_trigger 12 13 # On a fresh machine this opens a GUI dialog — the user must click "Install". 14 # The loop below waits up to 5 minutes (30 × 10 s) for that to complete. 15 - name: Wait for Xcode Command Line Tools installation 16 ansible.builtin.stat: 17 path: /Library/Developer/CommandLineTools/usr/bin/git 18 register: xcode_clt_done 19 retries: 30 20 delay: 10 21 until: xcode_clt_done.stat.exists 22 when: not xcode_clt.stat.exists