Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
5ddd81ae
Commit
5ddd81ae
authored
Oct 22, 2017
by
Bartłomiej Piotrowski
Browse files
Use more idiomatic way of checking for variable presence
parent
cf935250
Changes
4
Hide whitespace changes
Inline
Side-by-side
roles/borg-client/defaults/main.yml
View file @
5ddd81ae
---
backup_host
:
"
borg@vostok.archlinux.org"
backup_dir
:
"
/backup/{{inventory_hostname}}"
postgres_backup_dir
:
'
'
mysql_backup_dir
:
'
'
mysql_backup_defaults
:
'
'
roles/borg-client/tasks/main.yml
View file @
5ddd81ae
...
...
@@ -23,7 +23,7 @@
-
name
:
install postgres backup script
template
:
src=backup-postgres.sh.j2 dest=/usr/local/bin/backup-postgres.sh owner=root group=root mode=0755
when
:
postgres_backup_dir
!= ""
when
:
postgres_backup_dir
is defined
-
name
:
check whether postgres user exists
command
:
getent passwd postgres
...
...
@@ -32,19 +32,19 @@
-
name
:
make postgres backup directory
file
:
path=/var/lib/postgres/backup owner=postgres group=postgres state=directory
when
:
check_postgres_user|succeeded and postgres_backup_dir
!= ""
when
:
check_postgres_user|succeeded and postgres_backup_dir
is defined
-
name
:
install mysql backup script
template
:
src=backup-mysql.sh.j2 dest=/usr/local/bin/backup-mysql.sh owner=root group=root mode=0755
when
:
mysql_backup_dir
!= ""
when
:
mysql_backup_dir
is defined
-
name
:
install mysql backup config
template
:
src=backup-my.cnf.j2 dest={{mysql_backup_defaults}}
when
:
mysql_backup_defaults
!= ""
when
:
mysql_backup_defaults
is defined
-
name
:
create mysql backup directory
file
:
path={{mysql_backup_dir}} state=directory owner=root group=root
when
:
mysql_backup_dir
!= ""
when
:
mysql_backup_dir
is defined
-
name
:
install systemd timers for backup
copy
:
src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
...
...
roles/matrix/tasks/main.yml
View file @
5ddd81ae
...
...
@@ -2,7 +2,7 @@
-
name
:
create ssl cert
command
:
certbot certonly --email webmaster@archlinux.org --agree-tos --rsa-key-size 4096 --renew-by-default --webroot -w {{letsencrypt_validation_dir}} -d '{{ matrix_domain }}' creates='/etc/letsencrypt/live/{{ matrix_domain }}/fullchain.pem'
when
:
'
matrix_domain
!=
""
'
when
:
'
matrix_domain
is
defined
'
-
name
:
install packages
pacman
:
name=python2-virtualenv,git,npm
...
...
@@ -133,7 +133,7 @@
template
:
src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/matrix.conf owner=root group=root mode=0644
notify
:
-
reload nginx
when
:
'
matrix_domain
!=
""
'
when
:
'
matrix_domain
is
defined
'
-
name
:
install matrix units
copy
:
src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
...
...
roles/syncrepo/tasks/main.yml
View file @
5ddd81ae
...
...
@@ -2,7 +2,7 @@
-
name
:
create ssl cert
command
:
certbot certonly --email webmaster@archlinux.org --agree-tos --rsa-key-size 4096 --renew-by-default --webroot -w {{letsencrypt_validation_dir}} -d '{{ mirror_domain }}' creates='/etc/letsencrypt/live/{{ mirror_domain }}/fullchain.pem'
when
:
'
mirror_domain
!=
""
'
when
:
'
mirror_domain
is
defined
'
-
name
:
install rsync
pacman
:
name=rsync state=present
...
...
@@ -48,4 +48,4 @@
template
:
src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/syncrepo.conf owner=root group=root mode=0644
notify
:
-
reload nginx
when
:
'
mirror_domain
!=
""
'
when
:
'
mirror_domain
is
defined
'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment