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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃 Add backup roles #33

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

馃 Add backup roles #33

wants to merge 4 commits into from

Conversation

mfuhrmann
Copy link
Contributor

part of #32

@indigo423 see inline comments.


- name: Backup OpenNMS
hosts: core
user: root
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Depends if the Ansible user has enough permissions. For the copy jobs of the files it could work with ubuntu. But maybe not for the PSQL dump.
Right now it is set to root since I also don't have an ubuntu user.

vars:
timestamp: "{{ ansible_date_time.date }}_{{ ansible_date_time.hour }}{{ ansible_date_time.minute }}"

# - name: Backup PostgreSQL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

commented because the PG dump is not working yet. But you can see the structure I am following here.

@@ -0,0 +1,4 @@
---

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In best case we could define them globally instead of in each role.

- name: "Create a backup directory"
file:
path: "{{onms_backup_folder }}"
mode: 0777
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess not the final permissions. But for now sufficient.

ansible.builtin.include_tasks: ubuntu_debian.yml
when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"

- name: Run backups scripts for RedHat / CentOs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CentOS / Redhat is not tested yet.

ignore_errors: yes
changed_when: false

- name: Grep OpenNMS group ID
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The grep commands are redundant in CentOS and Ubuntu. Maybe we should move them to main.yaml.

ignore_errors: yes
changed_when: false

- name: Create latest passwd file
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would be cool to have an handler that always does this latest copy process. But I didn't find a solution for this right now. Also, we have those tasks in CentOS and Ubuntu tasks.

@mfuhrmann
Copy link
Contributor Author

@indigo423 Let's sync about my approach before continuing.

@indigo423 indigo423 changed the title #32 Add backup roles 馃 Add backup roles Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants