2019-04-04 20:27:49 +00:00
|
|
|
- name: Waiting for SSH connection
|
|
|
|
wait_for_connection:
|
|
|
|
|
2019-07-01 06:52:29 +00:00
|
|
|
- name: Gathering facts
|
2019-04-04 20:27:49 +00:00
|
|
|
setup:
|
|
|
|
|
2019-07-01 06:52:29 +00:00
|
|
|
- name: Cloning T-Pot install directory
|
2019-04-04 20:27:49 +00:00
|
|
|
git:
|
2019-06-29 16:21:47 +00:00
|
|
|
repo: "https://github.com/dtag-dev-sec/tpotce.git"
|
2019-04-04 20:27:49 +00:00
|
|
|
dest: /root/tpot
|
|
|
|
|
|
|
|
- name: Prepare to set user password
|
|
|
|
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-04-04 20:27:49 +00:00
|
|
|
|
2019-10-21 14:12:08 +00:00
|
|
|
- name: Changing password for user {{ user_name }}
|
2019-04-04 20:27:49 +00:00
|
|
|
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
|
2019-04-04 20:27:49 +00:00
|
|
|
template:
|
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-07-01 06:52:29 +00:00
|
|
|
- name: Install T-Pot on instance - be patient, this might take 15 to 30 minutes depending on the connection speed. No further output is given.
|
2019-04-15 19:58:35 +00:00
|
|
|
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
|
2019-04-04 20:27:49 +00:00
|
|
|
file:
|
|
|
|
path: /root/tpot.conf
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Change unattended-upgrades to take default action
|
|
|
|
blockinfile:
|
|
|
|
dest: /etc/apt/apt.conf.d/50unattended-upgrades
|
|
|
|
block: |
|
|
|
|
Dpkg::Options {
|
|
|
|
"--force-confdef";
|
|
|
|
"--force-confold";
|
|
|
|
}
|