Esthetic change lol...

This commit is contained in:
Vlad Raducanu
2022-05-08 19:53:50 +01:00
parent d146a063a0
commit 9e0ed41929
5 changed files with 0 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
[defaults]
private_key_file = /home/vlad/.ssh/id_rsa
+4
View File
@@ -0,0 +1,4 @@
all:
hosts:
172.16.1.112:
10.221.0.104:
+86
View File
@@ -0,0 +1,86 @@
---
- name: Prestage server and install services [SYSLOG, FTP, TFTP, NTP]
hosts: all
roles:
- common
become: yes
tasks:
- name: Update and upgrade current packages
apt:
update_cache: yes
upgrade: yes
- name: Update apt cache and install required packages
apt:
name: "{{ item }}"
loop:
- curl
- tree
- syslog-ng
- vsftpd
- tftpd-hpa
- ntp
- ufw
- xrdp
- name: Create a new regular user with sudo privileges
user:
name: "{{ create_user }}"
state: present
groups: sudo
append: true
create_home: true
shell: /bin/bash
- name: Set authorized key for remote user
authorized_key:
user: "{{ create_user }}"
state: present
key: "{{ copy_local_key }}"
- name: Configure UFW to allow inbound NTP, SSH, SYSLOG, FTP connections
ufw:
rule: allow
direction: in
port: "{{ item.port }}"
proto: "{{ item.proto }}"
loop:
- port: '22'
proto: tcp
- port: '123'
proto: udp
- port: '514'
proto: udp
- port: '23'
proto: tcp
- port: '3389'
proto: tcp
- port: '5140'
proto: tcp
- port: '5141'
proto: tcp
- port: '5142'
proto: tcp
- name: UFW - Deny all other incoming traffic by default
ufw:
state: enabled
policy: deny
direction: incoming
- name: Block all IPv6 incoming connections
ufw:
rule: deny
direction: in
proto: ipv6
- name: Send Webex Teams message via BOT to confirm playbook completion
community.general.cisco_webex:
recipient_type: toPersonEmail
recipient_id: "{{ webex_id }}"
msg_type: markdown
personal_token: "{{ webex_token }}"
msg: "**Prestaging has been completed for host {{ inventory_hostname }}.**"
+22
View File
@@ -0,0 +1,22 @@
---
- name: Reboots linux host and checks status
hosts: all
roles:
- common
become: yes
tasks:
- name: Rebooting...
reboot:
reboot_timeout: 60
msg: Reboot issued by Ansible
test_command: whoami
- name: Send Webex Teams message via BOT to confirm playbook completion
community.general.cisco_webex:
recipient_type: toPersonEmail
recipient_id: "{{ webex_id }}"
msg_type: markdown
personal_token: "{{ webex_token }}"
msg: "**Host {{ inventory_hostname }} has successfully rebooted.**"
+25
View File
@@ -0,0 +1,25 @@
$ANSIBLE_VAULT;1.1;AES256
64393466643139323164303532333865626432353430346466643432613664363962666137373861
3138323435393937373239386136626436346462383965630a376366316130376631633339636531
39643138323166313131313533643662363731316532633664326634373434356338343533653866
6234346535343362390a393666626362313763346362663837376664663762656339393430353132
64313164323630363637353230643834303164333665376437623235613264363965623530666236
61643430333861376334373061643239386566316561373531333862626163386261643636313531
39616637306466636462323337393239653135633962623965346134623262613236366438336264
38326265666363643166363565636534633061643165646239663565363434323561633235353663
65306636333664666361396638613634353166313430646462623633306239376331303066656536
65623939306564613037613263343537623933653761303139323033633066393665393236366635
36316462643231363832303233316461643330346435326263666337363435333833656632656231
39636638313336613135653830396262366330636266653333336433316637626634306236393033
65313061303066643566306133663830633136366633303665633332613432616237373161613338
65643266336330393936663461386464386262323638343365313136326137373661363161633730
30323630363038636462653737386232343562376433646435663335376562346466313863656330
34363731636163396465653830303263393937633332333937633434343732343234386536653832
31663535333732363736656138663163333861376365333632656266626161616166373537623166
35626161383336333835336364653135356437353535373765383337326261303037373964356330
33346264343736663866363639363766373435363137326638366636613464636637666432333331
33383238323537656565393066373034346664396339366564343261643765343865353361393961
34633538653333343234366332613739383738306462366139666537343965613465623236333733
34656239393537656532383061383861623235323664663837356137333736316132383334363138
37643363333636303935373461653436333436323439323662373731383536383662353637383664
32366363333437323161