| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  | - name: Waiting for SSH connection
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.wait_for_connection:
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-01 06:52:29 +00:00
										 |  |  | - name: Gathering facts
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.setup:
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-01 06:52:29 +00:00
										 |  |  | - name: Cloning T-Pot install directory
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.git:
 | 
					
						
							| 
									
										
										
										
											2020-09-04 13:01:21 +00:00
										 |  |  |     repo: "https://github.com/telekom-security/tpotce.git"
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  |     dest: /root/tpot
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-21 23:50:24 +00:00
										 |  |  | - name: Prepare to set user password
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.set_fact:
 | 
					
						
							| 
									
										
										
										
											2019-06-30 14:25:24 +00:00
										 |  |  |     user_name: "{{ ansible_user }}"
 | 
					
						
							| 
									
										
										
										
											2019-06-29 16:21:47 +00:00
										 |  |  |     user_salt: "s0mew1ck3dTpoT"
 | 
					
						
							| 
									
										
										
										
											2019-10-21 14:40:19 +00:00
										 |  |  |   no_log: true
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 14:12:08 +00:00
										 |  |  | - name: Changing password for user {{ user_name }}
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.user:
 | 
					
						
							| 
									
										
										
										
											2019-06-30 14:25:24 +00:00
										 |  |  |    name: "{{ ansible_user }}"
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  |    password: "{{ user_password | password_hash('sha512', user_salt) }}"
 | 
					
						
							|  |  |  |    state: present
 | 
					
						
							|  |  |  |    shell: /bin/bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-01 06:52:29 +00:00
										 |  |  | - name: Copy T-Pot configuration file
 | 
					
						
							| 
									
										
										
										
											2021-09-01 19:55:22 +00:00
										 |  |  |   ansible.builtin.copy:
 | 
					
						
							| 
									
										
										
										
											2019-05-09 21:40:32 +00:00
										 |  |  |     src: ../../../../../../iso/installer/tpot.conf.dist
 | 
					
						
							| 
									
										
										
										
											2019-04-05 06:04:47 +00:00
										 |  |  |     dest: /root/tpot.conf
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  |     owner: root
 | 
					
						
							|  |  |  |     group: root
 | 
					
						
							|  |  |  |     mode: 0644
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 14:13:04 +00:00
										 |  |  | - name: Install T-Pot on instance -  be patient, this might take 15 to 30 minutes depending on the connection speed.
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.command: /root/tpot/iso/installer/install.sh --type=auto --conf=/root/tpot.conf
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-01 06:52:29 +00:00
										 |  |  | - name: Delete T-Pot configuration file
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.file:
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  |     path: /root/tpot.conf
 | 
					
						
							|  |  |  |     state: absent
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - name: Change unattended-upgrades to take default action
 | 
					
						
							| 
									
										
										
										
											2021-02-13 16:46:28 +00:00
										 |  |  |   ansible.builtin.blockinfile:
 | 
					
						
							| 
									
										
										
										
											2019-04-04 20:27:49 +00:00
										 |  |  |     dest: /etc/apt/apt.conf.d/50unattended-upgrades
 | 
					
						
							|  |  |  |     block: |
 | 
					
						
							|  |  |  |       Dpkg::Options {
 | 
					
						
							|  |  |  |         "--force-confdef";
 | 
					
						
							|  |  |  |         "--force-confold";
 | 
					
						
							|  |  |  |       }
 |