Ansible: Add homebrew, system log, and main tasks for macOS to the eryn role
This commit is contained in:
		
							parent
							
								
									41dc68869a
								
							
						
					
					
						commit
						73ca945487
					
				
					 3 changed files with 48 additions and 0 deletions
				
			
		
							
								
								
									
										37
									
								
								Ansible/roles/eryn/tasks/macos/homebrew.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								Ansible/roles/eryn/tasks/macos/homebrew.yml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,37 @@ | |||
| --- | ||||
| - name: "macOS : homebrew : Does the brew command exist?" | ||||
|   ansible.builtin.stat: | ||||
|     path: /opt/homebrew/bin/brew | ||||
|   register: _eryn_homebrew_brew | ||||
| 
 | ||||
| - name: "macOS : homebrew : Install Homebrew" | ||||
|   when: not _eryn_homebrew_brew.stat.exists | ||||
|   block: | ||||
|     - name: "macOS : homebrew : Create temporary file for install script" | ||||
|       ansible.builtin.tempfile: | ||||
|         state: file | ||||
|         prefix: homebrew-install | ||||
|       register: _eryn_homebrew_install_script | ||||
| 
 | ||||
|     - name: "macOS : homebrew : Set up homebrew" | ||||
|       block: | ||||
|         - name: "macOS : homebrew : Fetch install script" | ||||
|           ansible.builtin.get_url: | ||||
|             url: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | ||||
|             dest: "{{ _eryn_homebrew_install_script.path }}" | ||||
|             mode: "0644" | ||||
| 
 | ||||
|         - name: "macOS : homebrew : Run install script" | ||||
|           ansible.builtin.command: | ||||
|             cmd: bash {{ _eryn_homebrew_install_script.path }} | ||||
|           environment: | ||||
|             NONINTERACTIVE: 1 | ||||
| 
 | ||||
|         - name: "macOS : homebrew : Gather package manager facts" | ||||
|           ansible.builtin.setup: | ||||
|             gather_subset: pkg_mgr | ||||
|       always: | ||||
|         - name: "macOS : homebrew : Remove temporary install script" | ||||
|           ansible.builtin.file: | ||||
|             path: "{{ _eryn_homebrew_install_script.path }}" | ||||
|             state: absent | ||||
							
								
								
									
										6
									
								
								Ansible/roles/eryn/tasks/macos/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Ansible/roles/eryn/tasks/macos/main.yml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| --- | ||||
| - name: "macOS : Configure log utility" | ||||
|   ansible.builtin.import_tasks: macos/system-log.yml | ||||
| 
 | ||||
| - name: "macOS : Configure homebrew" | ||||
|   ansible.builtin.import_tasks: macos/homebrew.yml | ||||
							
								
								
									
										5
									
								
								Ansible/roles/eryn/tasks/macos/system-log.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								Ansible/roles/eryn/tasks/macos/system-log.yml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| --- | ||||
| - name: "macOS : log : Symlink config" | ||||
|   ansible.builtin.include_tasks: symlink_dotfile.yml | ||||
|   vars: | ||||
|     dotfile_src: logrc | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue