Updated exam tasks

pull/3/head
Vladimir Protsenko 1 year ago
parent e3be92ec60
commit f378efa852

@ -1,11 +0,0 @@
---
- hosts: nodepgs
become: yes
tasks:
- import_tasks: tasks/setup_grub.yml
vars:
grub_timeout: 1
- import_tasks: tasks/install_selinux.yml
- import_tasks: tasks/setup_raid1_for_postgres.yml
- import_tasks: tasks/install_postgres.yml
- import_tasks: tasks/setup_weather_db.yml

@ -1,27 +0,0 @@
- name: Install gnupg
apt:
pkg: gnupg
- name: Install key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
state: present
- name: Add postgresql repository into sources list as pgdg file
ansible.builtin.apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main"
state: present
filename: pgdg
- name: Install postgre
apt:
pkg: postgresql-15*
register: postgre_installation
- name: Delete old configuration
shell: rm -rf /var/lib/postgresql/*
when: postgre_installation.changed
- name: Init PostgreSQL
shell: pg_createcluster 15 main --start
when: postgre_installation.changed

@ -1,20 +0,0 @@
- name: 'Install SELinux'
apt:
pkg:
- selinux-basics
- selinux-policy-default
- auditd
state: present
- name: 'Activate SELinux'
shell: selinux-activate
when: ansible_selinux.status == "disabled"
- name: 'Reboot after SElLinux install'
reboot:
when: ansible_selinux.status == "disabled"
- name: 'Check SELinux in permissive mode'
ansible.posix.selinux:
policy: default
state: permissive

@ -1,11 +0,0 @@
- name: "Get grub timeout value"
shell: cat /etc/default/grub | grep GRUB_TIMEOUT | sed 's/GRUB_TIMEOUT=//g'
register: current_grub_timeout
- name: 'Configure grub timeout if not already'
shell: sed 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT={{ timeout }}/g' -i /etc/default/grub
when: current_grub_timeout.stdout != "{{ grub_timeout }}"
- name: 'Update grub'
shell: update-grub
when: current_grub_timeout.stdout != "{{ grub_timeout }}"

@ -1,59 +0,0 @@
- name: 'Install mdadm'
apt:
pkg: mdadm
- name: 'Check raid 1 has mount point at /var/lib/postgresql'
command: /bin/mountpoint -q /var/lib/postgresql/
register: raid1_mounted
failed_when: False
- name: 'Configure md raid 1'
shell: mdadm --create /dev/md0 --raid-devices=2 --level=1 /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi[1,2] --run
register: "array_created"
when: ansible_facts['devices']['md0'] is undefined and
raid1_mounted.rc == 1
- name: 'Get configuration strings for configured raids'
command: "mdadm --detail --scan"
register: array_details
changed_when: false
- name: 'Persist configuration in /etc/mdadm/mdadm.conf '
lineinfile:
dest: "/etc/mdadm/mdadm.conf"
regexp: "^{{ item }}"
line: "{{ item }}"
state: "present"
with_items: '{{ array_details.stdout_lines }}'
when: array_created.changed
register: updated_mdadm_conf
- name: 'Updating Initramfs'
command: update-initramfs -u
when: updated_mdadm_conf is defined and
updated_mdadm_conf.changed
- name: 'Format raid1, ext4 filesystem'
community.general.filesystem:
fstype: ext4
dev: /dev/md0
- name: 'Update facts about node.'
setup:
- name: 'Create postrgresql folder'
file:
path: /var/lib/postgresql
state: directory
- name: 'Setup permanent mountpoint /var/lib/postgresql for raid1'
ansible.posix.mount:
path: /var/lib/postgresql
src: UUID={{ ansible_facts['devices']['md0']['links']['uuids'][0] }}
fstype: ext4
state: present
register: permanent_raid1_mount
- name: reboot
reboot:
when: permanent_raid1_mount.changed

@ -1,7 +0,0 @@
- name: Copy weather.sql
copy:
src: ./files/weather.sql
dest: /tmp/weather.sql
- name: import wether db to pg
shell: sudo -u postgres psql -f /tmp/weather.sql

@ -1,13 +1,13 @@
# Портфолио
## 1. proxmox
Web интерфейс созданного в задании Proxmox доступен по адресу https://proxmox.studX.startmyoffice.space.
Web интерфейс созданного в задании Proxmox доступен по адресу https://studX.myoffice.ru/proxmox/.
## 2. nginx_ha
Cайт доступен по адресу https://nginx-ha.studX.startmyoffice.space. При остановке активной машины должен обслуживаться резервным сервером.
Cайты доступены по адресу https://studX.myoffice.ru/ha/1/ и https://studX.myoffice.ru/ha/2/. При остановке активной машины должен обслуживаться резервным сервером.
## 3. docker
Cайт с картой еды в Сан-Франциско доступен по адресу https://foodtrucks.studX.startmyoffice.space.
Cайт с демонстрацией развёрнутого в docker приложения доступен по адресу https://studX.myoffice.ru/docker/.
## 4. postfix + dovecot
Из почтового клиента можно отправить почту с почтового ящика stud@studX.myoffice.ru и прочитать входящие сообщения.
Loading…
Cancel
Save