1
0
Fork 0
mirror of https://github.com/roles-ansible/role-postgresql-backup.git synced 2024-08-16 10:19:49 +02:00

initialize ansible role

This commit is contained in:
L3D 2020-07-08 14:01:03 +02:00 committed by L3D
parent 6f39f48d7a
commit 818129c9ac
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
7 changed files with 288 additions and 1 deletions

4
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,4 @@
# Feel free to add yourself after && during participating at this repo!
github: [do1jlr]
liberapay: L3D

217
.github/license.svg vendored Normal file
View file

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="83.946869"
height="20.137625"
version="1.1"
id="svg28"
sodipodi:docname="license.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata34">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="MIT (c) L3D &lt;l3d@c3woc.de&gt;" />
<dc:creator>
<cc:Agent>
<dc:title>3D &lt;l3d@c3woc.de&gt;</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>MIT License</dc:title>
</cc:Agent>
</dc:rights>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs32">
<linearGradient
inkscape:collect="always"
xlink:href="#b"
id="linearGradient4625"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
x1="0"
y1="-0.28392482"
x2="0"
y2="45.166359" />
<linearGradient
inkscape:collect="always"
xlink:href="#b"
id="linearGradient837"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
x1="0"
y1="-0.28392482"
x2="0"
y2="45.166359" />
<linearGradient
inkscape:collect="always"
xlink:href="#b"
id="linearGradient839"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
x1="0"
y1="-0.28392482"
x2="0"
y2="45.166359" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1916"
inkscape:window-height="1152"
id="namedview30"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="7.5888761"
inkscape:cx="39.713668"
inkscape:cy="14.182162"
inkscape:window-x="2560"
inkscape:window-y="22"
inkscape:window-maximized="0"
inkscape:current-layer="svg28"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<sodipodi:guide
position="47.649406,5.8374226"
orientation="0,1"
id="guide4567"
inkscape:locked="false" />
</sodipodi:namedview>
<linearGradient
id="b"
x2="0"
y2="45.166359"
gradientTransform="scale(2.258318,0.44280744)"
x1="0"
y1="-0.28392482"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
stop-color="#bbb"
stop-opacity=".1"
id="stop2" />
<stop
offset="1"
stop-opacity=".1"
id="stop4" />
</linearGradient>
<clipPath
id="a">
<rect
width="102"
height="20"
rx="3"
id="rect7"
x="0"
y="0"
style="fill:#ffffff" />
</clipPath>
<path
sodipodi:nodetypes="sccssss"
inkscape:connector-curvature="0"
id="path4637"
d="M 80.55806,0 H 48 v 20 h 32.55806 c 1.87153,0 3.378212,-1.506683 3.378212,-3.378212 V 3.3782117 C 83.936272,1.5066824 82.42959,0 80.55806,0 Z"
style="opacity:1;vector-effect:none;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
<path
style="opacity:1;vector-effect:none;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
d="M 3.3782117,0 H 49.936272 V 20 H 3.3782117 C 1.5066824,20 0,18.493317 0,16.621788 V 3.3782117 C 0,1.5066824 1.5066824,0 3.3782117,0 Z"
id="rect4634"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sccssss" />
<rect
ry="3.3782117"
y="0"
x="4.6019753e-15"
height="20.137625"
width="83.946869"
id="rect4641"
style="opacity:1;vector-effect:none;fill:url(#linearGradient837);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
<rect
style="opacity:1;vector-effect:none;fill:url(#linearGradient839);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
id="rect833"
width="83.946869"
height="20.137625"
x="4.6019753e-15"
y="0"
ry="3.3782117" />
<rect
ry="3.3782117"
y="0"
x="4.6019753e-15"
height="20.137625"
width="83.946869"
id="rect835"
style="opacity:1;vector-effect:none;fill:url(#linearGradient4625);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
<g
id="g4591"
transform="translate(6.0000004,0.1778004)">
<text
id="text4551"
y="15.101547"
x="49.939278"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;opacity:1;vector-effect:none;fill:#000000;fill-opacity:0.3;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;vector-effect:none;fill:#000000;fill-opacity:0.3;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
y="15.101547"
x="49.939278"
id="tspan4549"
sodipodi:role="line">MIT</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none"
x="59.774261"
y="14.119328"
id="text4547"><tspan
sodipodi:role="line"
id="tspan4545"
x="59.774261"
y="14.119328"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff">MIT</tspan></text>
</g>
<g
id="g4595"
transform="translate(3.9474745e-7,0.1778004)">
<text
x="245"
y="150"
transform="scale(0.1)"
textLength="370"
id="text18"
lengthAdjust="spacing"
style="font-size:110px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;text-anchor:middle;fill:#010101;fill-opacity:0.3">license</text>
<text
x="245"
y="140"
transform="scale(0.1)"
textLength="370"
id="text20"
lengthAdjust="spacing"
style="font-size:110px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;text-anchor:middle;fill:#ffffff">license</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

@ -1,6 +1,7 @@
MIT License
Copyright (c) 2020 L3D
Copyright (c) 2020 L3D <l3d@c3woc.de>
Copyright (c) 2020 L3D and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

6
defaults/main.yml Normal file
View file

@ -0,0 +1,6 @@
---
# should we do a version check? (recomended)
submodules_versioncheck: false
postgresql_backup:
foo: bar

8
tasks/main.yml Normal file
View file

@ -0,0 +1,8 @@
---
- name: combine postgresql_backup configuration
set_fact:
ranger: "{{ _postgresql_backup|combine(postgresql_backup, recursive=True) }}"
- include_tasks: versioncheck.yml
when: submodules_versioncheck|bool

44
tasks/versioncheck.yml Normal file
View file

@ -0,0 +1,44 @@
---
- name: Create directory for versionscheck
become: true
file:
path: '/etc/.ansible-version'
state: directory
mode: 0755
when: submodules_versioncheck|bool
- name: check playbook version
become: true
slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version
when: submodules_versioncheck|bool
ignore_errors: yes
- name: Print remote role version
debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck|bool
- name: Print locale role version
debug:
msg: "Local role version: '{{ playbook_version_number|string }}'."
when: submodules_versioncheck|bool
- name: Check if your version is outdated
fail:
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
- name: check if '/etc/ansible-version/' is empty
find:
paths: '/etc/ansible-version/'
register: filesFound
- name: write new version to remote disk
become: true
copy:
content: "{{ playbook_version_number }}"
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
when: submodules_versioncheck|bool

7
vars/main.yml Normal file
View file

@ -0,0 +1,7 @@
---
# versionscheck
playbook_version_number: 10 # should be int
playbook_version_path: 'role-postgresql-backup_roles-ansible_github.com.version' # unique string
_postgresql_backup:
foo: bar