Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ansible #932

Closed
wants to merge 5 commits into from
Closed

add ansible #932

wants to merge 5 commits into from

Conversation

AndriiKhomik
Copy link
Collaborator

dev

JIRA

Code reviewers

  • @github_username

Second Level Review

  • @github_username

Summary of issue

ToDo

Summary of change

ToDo

Testing approach

ToDo

CHECK LIST

  • СI passed
  • Сode coverage >=95%
  • PR is reviewed manually again (to make sure you have 100% ready code)
  • All reviewers agreed to merge the PR
  • I've checked new feature as logged in and logged out user if needed
  • PR meets all conventions

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.93%. Comparing base (a2e8d45) to head (e8cee8f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #932   +/-   ##
=======================================
  Coverage   87.93%   87.93%           
=======================================
  Files          71       71           
  Lines        1003     1003           
=======================================
  Hits          882      882           
  Misses        121      121           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

if 5 restarts within 5 cycles
then timeout

alert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert
alert

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Виористовується для тригеру повідомлень

if failed
port 5432

then alert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
then alert
then alert

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Виористовується для тригеру повідомлень

check process nginx with pidfile /run/nginx.pid
start program = "/usr/sbin/service nginx start" with timeout 60 seconds
stop program = "/usr/sbin/service nginx stop"
if failed host 127.0.0.1 port 443 protocol https for 3 cycles then restart
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if failed host 127.0.0.1 port 443 protocol https for 3 cycles then restart
if failed host 127.0.0.1 port 443 protocol https for 3 cycles then restart

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Конфіг для перезавантаження сервісу, пропоную залишити

ansible_host: 185.233.37.137
ansible_user: deploy
ansible_ssh_private_key: ~/.ssh/ansible
ansible_connection: ssh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ansible_connection: ssh
ansible_connection: ssh

check process nginx with pidfile /run/nginx.pid
start program = "/usr/sbin/service nginx start" with timeout 60 seconds
stop program = "/usr/sbin/service nginx stop"
if failed host 127.0.0.1 port 443 protocol https for 3 cycles then restart
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а чому тут алерт не даєш?

Comment on lines +2 to +5
- name: Restart monit
service:
name: monit
state: restarted
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а що це таке?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хандлер для перезавантаження моніту при встановленні, використовуєтьс в головному конфігураційному файлі

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нам цей файлик точно потрібен?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

диви, а чому б не використати команду з пакет менеджером, щоб встановити моніт?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нам цей файлик точно потрібен?

Я не видаляв стандартно згенеровані роллю файли. Зараз він не використовується, в майбутньому невідомо чи буде потрібен. Видаляти?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

диви, а чому б не використати команду з пакет менеджером, щоб встановити моніт?

Вона і використовується:
apt:
name: monit

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а що це за файлик?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Файлик згенерований автоматично. Не обов'язковий але рекомендовано щоб він був. Видаляти?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mmonit to the production (ansible too?) to monitor nginx (postgresql, redis too?)
2 participants