Commit cf9556f6 authored by Martin van Es's avatar Martin van Es
Browse files

WIP

parent a91fac83
......@@ -6,6 +6,7 @@ local ansible_connection=local
# Hosts that receive the mdproxy role
[mdproxy]
local
# Hosts that receive the GeoDNS role
[geodns]
......
......@@ -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']}
......@@ -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
......@@ -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 }}"
......@@ -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]
......
......@@ -2,7 +2,7 @@
Description=Run GeoDNS update
[Timer]
OnCalendar=*-*-* *:0/5:00
OnCalendar=*-*-* *:02:00
Unit=geodns-update.service
[Install]
......
---
mdxsaas_repo: https://gitlab.geant.org/TI_Incubator/mdx-saas-config.git
mdxsaas_dir: /opt/mdx-saas
mdxsaas_version: main
---
- 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 }}"
......@@ -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"
[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
[Unit]
Description=Run mdproxy update
[Timer]
OnCalendar=*-*-* *:04:00
Unit=mdproxy-update.service
[Install]
WantedBy=timers.target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment