Skip to content

Commit 9c839e1

Browse files
Use ansible_env.HOME instead of hardcoded vagrant user path (NO_JIRA)
1 parent d7fa8dc commit 9c839e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tasks/Darwin.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- name: "Download command line tools dmg"
1010
ansible.builtin.get_url:
1111
url: https://artifactory.ccdc.cam.ac.uk/artifactory/ccdc-3rdparty-macos-xcode-installers/Command_Line_Tools_for_Xcode_12.4.dmg
12-
dest: /Users/vagrant/Downloads/Command_Line_Tools_for_Xcode_12.4.dmg
12+
dest: "{{ ansible_env.HOME }}/Downloads/Command_Line_Tools_for_Xcode_12.4.dmg"
1313
mode: 0755
1414
url_username: "{{ ansible_deployment_artifactory_user }}"
1515
headers:
@@ -18,17 +18,17 @@
1818

1919
- name: Create temporary download directory for command line tools
2020
ansible.builtin.file:
21-
path: /Users/vagrant/Downloads/clt
21+
path: "{{ ansible_env.HOME }}/Downloads/clt"
2222
state: directory
2323
mode: '0755'
2424
when: clt_pkg_info.rc != 0
2525

2626
- name: "Mount command line tools dmg" # noqa: no-changed-when
27-
ansible.builtin.command: hdiutil attach /Users/vagrant/Downloads/Command_Line_Tools_for_Xcode_12.4.dmg -nobrowse -mountpoint /Users/vagrant/Downloads/clt
27+
ansible.builtin.command: hdiutil attach "{{ ansible_env.HOME }}/Downloads/Command_Line_Tools_for_Xcode_12.4.dmg" -nobrowse -mountpoint "{{ ansible_env.HOME }}/Downloads/clt"
2828
when: clt_pkg_info.rc != 0
2929

3030
- name: Install command line tools package # noqa: no-changed-when
31-
ansible.builtin.command: installer -pkg "/Users/vagrant/Downloads/clt/Command Line Tools.pkg" -target /
31+
ansible.builtin.command: installer -pkg "{{ ansible_env.HOME }}/Downloads/clt/Command Line Tools.pkg" -target /
3232
when: clt_pkg_info.rc != 0
3333
become: true
3434

@@ -37,12 +37,12 @@
3737
when: clt_pkg_info.rc != 0
3838

3939
- name: "Unmount command line tools dmg" # noqa: no-changed-when
40-
ansible.builtin.command: hdiutil detach /Users/vagrant/Downloads/clt
40+
ansible.builtin.command: hdiutil detach "{{ ansible_env.HOME }}/Downloads/clt"
4141
when: clt_pkg_info.rc != 0
4242

4343
- name: "Remove command line tools dmg mountpoint"
4444
ansible.builtin.file:
45-
path: /Users/vagrant/Downloads/clt
45+
path: "{{ ansible_env.HOME }}/Downloads/clt"
4646
state: absent
4747

4848
- name: Install homebrew

0 commit comments

Comments
 (0)