Skip to content

Commit

Permalink
Merge branch 'main' into feature/example-config-19
Browse files Browse the repository at this point in the history
  • Loading branch information
widhalmt authored Sep 25, 2023
2 parents 6d2928d + de2d190 commit 9a3d9c2
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
8 changes: 4 additions & 4 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:
strategy:
max-parallel: 4
matrix:
distro: [centos7, rockylinux8, ubuntu2004, ubuntu1804]
distro: [rockylinux8, rockylinux9, ubuntu2004, ubuntu2204]
scenario: [default]

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.10.11

- name: Install dependencies
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.sw?
*~
*log.txt
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Thomas Widhalm <thomas.widhalm@netways.de> <widhalmt@widhalm.or.at>
Afeef Ghannam <afeef.ghannam@netways.de> <39904920+afeefghannam89@users.noreply.github.com>
Tobias Bauriedel <tobias.bauriedel@netways.de> <tobias.bauriedel@netways.de>
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Afeef Ghannam <afeef.ghannam@netways.de>
Marc Rupprecht <marc.rupprecht@netways.de>
Thomas Widhalm <thomas.widhalm@netways.de>
Tobias Bauriedel <tobias.bauriedel@netways.de>
File renamed without changes.
33 changes: 33 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace: netways
name: backup
version: 0.1.0-beta
readme: README.md
authors:
- Thomas Widhalm <thomas.widhalm@netways.de>
description: >
This collection provides easy backup solutions as a
better than nothing approach.
license:
- GPL-3.0-or-later
tags:
- backup
- rsnapshot
- tools
- storage
dependencies: {}
repository: https://github.com/NETWAYS/ansible-collection-backup
documentation: https://github.com/NETWAYS/ansible-collection-backup/tree/main/docs
homepage: http://netways.de
issues: https://github.com/NETWAYS/ansible-collection-backup/issues
build_ignore:
- yamllint.yaml
- .cache
- molecule
- tests
- .gitignore
- .github
- .gitlab-ci.yml
- __pycache__
- 'venv*'
- .idea
- '*.tar.gz'
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
include_role:
name: rsnapshot

- name: "Include Bachup"
- name: "Include Backup"
include_role:
name: backup
5 changes: 4 additions & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---
dependency:
name: galaxy
options:
requirements-file: requirements.yml
driver:
name: docker
platforms:
- name: backup-default
- name: "backup-default-${MOLECULE_DISTRO}"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
Expand Down
3 changes: 3 additions & 0 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
roles:
- geerlingguy.mysql
11 changes: 6 additions & 5 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: all
- name: Tests
hosts: all
vars:
system_time: "{{ lookup('pipe','date +%Y%m%d') }}"
tasks:
Expand All @@ -15,7 +16,7 @@
stat:
path: /opt/backup/rsnapshot/hourly.0/backup-defaul/root/rsnapshot/timestamp.hourly

- name: .my.cnf exists
- name: .my.cnf exists
command: cat /root/.my.cnf

- name: Create test table in database and insert test value
Expand Down Expand Up @@ -44,22 +45,22 @@
community.mysql.mysql_db:
name: testDatabase
state: import
target: /opt/mysqlbackup/mysqldump_{{system_time}}.sql.bz2
target: /opt/mysqlbackup/mysqldump_{{ system_time }}.sql.bz2
when: ansible_os_family == 'Debian'

- name: Restore database
community.mysql.mysql_db:
name: testDatabase
state: import
target: /opt/mysqlbackup/mysqldump_{{system_time}}.sql
target: /opt/mysqlbackup/mysqldump_{{ system_time }}.sql
when: ansible_os_family == 'RedHat'

- name: Simple select query to acme db
community.mysql.mysql_query:
login_db: testDatabase
query: SELECT message FROM test
register: mysql_query_output

- name: Print the mysql query
debug:
var: mysql_query_output

0 comments on commit 9a3d9c2

Please sign in to comment.