Fixing script
parent
4c3d0b2750
commit
d7a2181ab9
|
@ -1,2 +1,4 @@
|
|||
[okeanos_server]
|
||||
faust.ad
|
||||
# root: r00tP@ssWd
|
||||
# user: KrknPGiD0E
|
||||
|
|
39
playbook.yml
39
playbook.yml
|
@ -1,24 +1,45 @@
|
|||
---
|
||||
- name: Setup faustAD platform
|
||||
hosts: okeanos_server
|
||||
gather_facts: yes
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Update and upgrade system
|
||||
- name: System details
|
||||
debug: msg='{{ item }}'
|
||||
with_items:
|
||||
- '{{ ansible_distribution }}'
|
||||
- '{{ ansible_distribution_release }}'
|
||||
- '{{ ansible_distribution_version }}'
|
||||
- '{{ ansible_distribution_major_version }}'
|
||||
|
||||
- name: Update system
|
||||
apt:
|
||||
name: '*'
|
||||
state: latest
|
||||
update_cache: yes
|
||||
force_apt_get: yes
|
||||
register: apt_update_status
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Remove packages not needed anymore
|
||||
- name: Upgrade system
|
||||
apt:
|
||||
upgrade: yes
|
||||
force_apt_get: yes
|
||||
autoremove: yes
|
||||
|
||||
- name: Reboot when packages were updated
|
||||
- name: Check if reboot is needed
|
||||
register: reboot_required_file
|
||||
stat:
|
||||
path: /var/run/reboot-required
|
||||
get_md5: no
|
||||
|
||||
- name: Reboot the server if kernel was updated
|
||||
reboot:
|
||||
post_reboot_delay: 60
|
||||
when: apt_update_status.changed
|
||||
msg: "Reboot initiated by Ansible for kernel updates"
|
||||
connect_timeout: 5
|
||||
reboot_timeout: 300
|
||||
pre_reboot_delay: 0
|
||||
post_reboot_delay: 30
|
||||
test_command: uptime
|
||||
when: reboot_required_file.stat.exists
|
||||
|
||||
- name: Install required packages for Docker
|
||||
apt:
|
||||
|
@ -40,7 +61,7 @@
|
|||
|
||||
- name: Add Docker Repository
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
||||
repo: 'deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable'
|
||||
state: present
|
||||
|
||||
- name: Update apt and install docker-ce
|
||||
|
|
Loading…
Reference in New Issue