-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.yml
62 lines (54 loc) · 1.99 KB
/
setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
- name: SETUP INITIALIZATION
hosts: localhost
gather_facts: true
vars_files:
- vars.yml
vars_prompt:
- name: desired_hostname
prompt: What is the hostname?
private: false
- name: git_email
prompt: What is your email?
private: false
tasks:
- name: Setup for MacOSX with apple silicon chip
when: ansible_distribution == "MacOSX" and ansible_architecture == "arm64"
block:
- name: Set development settings
block:
- name: Link dotfiles into home folder.
ansible.builtin.file:
src: "{{ dotfile_path }}/{{ item }}"
dest: "{{ home_path }}/{{ item }}"
state: link
mode: 0644
become: false
loop: "{{ dotfile_list }}"
- name: Install homebrew and apps
ansible.builtin.import_role:
name: geerlingguy.mac.homebrew
tasks_from: main.yml
- name: Install mas and apps
ansible.builtin.import_role:
name: geerlingguy.mac.mas
tasks_from: main.yml
- name: manage dock and apps
ansible.builtin.import_role:
name: geerlingguy.mac.dock
tasks_from: main.yml
- name: Check if hostname is already Setup
ignore_errors: true
changed_when: false
ansible.builtin.command: "scutil --get HostName"
register: get_hostname
- name: Set Hostname
become: true
become_method: ansible.builtin.sudo
register: current_hostname
changed_when: get_hostname.stdout != desired_hostname
when: get_hostname.stdout != desired_hostname
ansible.builtin.command: "scutil --set HostName {{ desired_hostname }}"
- name: Run finisher script
changed_when: false
ansible.builtin.command: "./files/.osx"