Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Trust and Identity Incubator
mdx-saas-config
Commits
cf9556f6
Commit
cf9556f6
authored
Mar 30, 2022
by
Martin van Es
Browse files
WIP
parent
a91fac83
Changes
11
Hide whitespace changes
Inline
Side-by-side
inventory/local
View file @
cf9556f6
...
...
@@ -6,6 +6,7 @@ local ansible_connection=local
# Hosts that receive the mdproxy role
[mdproxy]
local
# Hosts that receive the GeoDNS role
[geodns]
...
...
playbook.yml
View file @
cf9556f6
...
...
@@ -8,6 +8,7 @@
hosts
:
geodns
gather_facts
:
false
roles
:
-
{
role
:
local
,
tags
:
[
'
local'
]}
-
{
role
:
geodns
,
tags
:
[
'
geodns'
]}
-
name
:
MDSigner
...
...
@@ -21,5 +22,6 @@
hosts
:
mdproxy
gather_facts
:
false
roles
:
-
{
role
:
local
,
tags
:
[
'
local'
]}
-
{
role
:
apache
,
tags
:
[
'
apache'
]}
-
{
role
:
mdproxy
,
tags
:
[
'
mdproxy'
]}
roles/geodns/defaults/main.yml
View file @
cf9556f6
...
...
@@ -8,7 +8,3 @@ geodns_version: v3.2.0
geodns_config
:
"
{{
geodns_dir}}/config"
geolite_dir
:
"
{{
geodns_dir
}}/GeoLite2DB"
mdxsaas_repo
:
https://gitlab.geant.org/TI_Incubator/mdx-saas-config.git
mdxsaas_dir
:
/opt/mdx-saas
mdxsaas_version
:
main
roles/geodns/tasks/main.yml
View file @
cf9556f6
...
...
@@ -3,7 +3,6 @@
apt
:
state
:
present
name
:
-
ansible
-
netcat-openbsd
-
name
:
Install Ansible community.general
...
...
@@ -101,15 +100,3 @@
-
geodns-update.timer
notify
:
-
"
enable
geodns
job"
-
name
:
Clone MDX-SAAS-config repository
ansible.builtin.git
:
repo
:
"
{{
mdxsaas_repo
}}"
dest
:
"
{{
mdxsaas_dir
}}"
version
:
"
{{
mdxsaas_version
}}"
register
:
mdxsaas_git
-
name
:
Write MDX-SAAS repo version
ansible.builtin.shell
:
cmd
:
"
git
rev-parse
HEAD
>
{{
geodns_config
}}/revision"
chdir
:
"
{{
mdxsaas_dir
}}"
roles/geodns/templates/geodns-update.service.j2
View file @
cf9556f6
...
...
@@ -5,7 +5,7 @@ Description=GeoDNS update
Type=oneshot
WorkingDirectory={{ mdxsaas_dir }}
ExecStart=git pull
ExecStart=ansible-playbook playbook.yml -i inventory/local --tags geodns --limit local
ExecStart=ansible-playbook playbook.yml -i inventory/local --tags
local,
geodns --limit local
ExecStartPost=/bin/systemctl restart geodns
[Install]
...
...
roles/geodns/templates/geodns-update.timer.j2
View file @
cf9556f6
...
...
@@ -2,7 +2,7 @@
Description=Run GeoDNS update
[Timer]
OnCalendar=*-*-* *:0
/5
:00
OnCalendar=*-*-* *:0
2
:00
Unit=geodns-update.service
[Install]
...
...
roles/local/defaults/main.yml
0 → 100644
View file @
cf9556f6
---
mdxsaas_repo
:
https://gitlab.geant.org/TI_Incubator/mdx-saas-config.git
mdxsaas_dir
:
/opt/mdx-saas
mdxsaas_version
:
main
roles/local/tasks/main.yml
0 → 100644
View file @
cf9556f6
---
-
name
:
Install packages
apt
:
state
:
present
name
:
-
ansible
-
name
:
Clone MDX-SAAS-config repository
ansible.builtin.git
:
repo
:
"
{{
mdxsaas_repo
}}"
dest
:
"
{{
mdxsaas_dir
}}"
version
:
"
{{
mdxsaas_version
}}"
register
:
mdxsaas_git
-
name
:
Write MDX-SAAS repo version
ansible.builtin.shell
:
cmd
:
"
git
rev-parse
HEAD
>
{{
geodns_config
}}/revision"
chdir
:
"
{{
mdxsaas_dir
}}"
roles/mdproxy/tasks/main.yml
View file @
cf9556f6
...
...
@@ -13,7 +13,11 @@
-
name
:
Copy mdproxy service files
ansible.builtin.template
:
src
:
"
mdproxy.service.j2"
dest
:
"
/etc/systemd/system/mdproxy.service"
src
:
"
{{
item
}}.j2"
dest
:
"
/etc/systemd/system/{{
item
}}"
with_items
:
-
mdproxy.service
-
mdproxy-update.service
-
mdproxy-update.timer
notify
:
-
"
enable
mdproxy
job"
roles/mdproxy/templates/mdproxy-update.service.j2
0 → 100644
View file @
cf9556f6
[Unit]
Description=mdproxy update
[Service]
Type=oneshot
WorkingDirectory={{ mdxsaas_dir }}
ExecStart=git pull
ExecStart=ansible-playbook playbook.yml -i inventory/local --tags local,mdproxy --limit local
ExecStartPost=/bin/systemctl restart mdproxy
[Install]
WantedBy=multi-user.target
roles/mdproxy/templates/mdproxy-update.timer.j2
0 → 100644
View file @
cf9556f6
[Unit]
Description=Run mdproxy update
[Timer]
OnCalendar=*-*-* *:04:00
Unit=mdproxy-update.service
[Install]
WantedBy=timers.target
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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