Adding some ansible code
This commit is contained in:
		
							
								
								
									
										41
									
								
								ESXi/ansible/dc/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								ESXi/ansible/dc/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| --- | ||||
|  | ||||
| - name: Hostname -> DC | ||||
|   win_hostname: | ||||
|     name: dc | ||||
|   register: res | ||||
|  | ||||
| - name: Reboot | ||||
|   win_reboot: | ||||
|   when: res.reboot_required | ||||
|  | ||||
| - name: Install git | ||||
|   win_chocolatey: | ||||
|     name: git | ||||
|     state: present | ||||
|  | ||||
| - name: Check if existing DetectionLab directory | ||||
|   win_stat: | ||||
|     path: 'c:\DetectionLab' | ||||
|   register: dir | ||||
|  | ||||
| - name: Git clone Detectionlab | ||||
|   win_shell: git clone https://github.com/clong/DetectionLab.git | ||||
|   args: | ||||
|     chdir: 'c:\' | ||||
|   when: not dir.stat.exists | ||||
|  | ||||
| - name: Copy scripts to c:\vagrant | ||||
|   win_shell: Copy-Item -Recurse c:\DetectionLab\Vagrant c:\vagrant | ||||
|  | ||||
| - name: Provision | ||||
|   win_shell: .\\provision.ps1 | ||||
|   args: | ||||
|     chdir: 'c:\vagrant\scripts' | ||||
|  | ||||
| - name: reboot server | ||||
|   win_reboot: | ||||
|     msg: "Installing AD. Rebooting..." | ||||
|     pre_reboot_delay: 15 | ||||
|     reboot_timeout: 600 | ||||
|     post_reboot_delay: 420 | ||||
		Reference in New Issue
	
	Block a user
	 Chris Long
					Chris Long