Skip to content
Snippets Groups Projects
Commit cf9556f6 authored by Martin van Es's avatar Martin van Es
Browse files

WIP

parent a91fac83
Branches
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ local ansible_connection=local ...@@ -6,6 +6,7 @@ local ansible_connection=local
# Hosts that receive the mdproxy role # Hosts that receive the mdproxy role
[mdproxy] [mdproxy]
local
# Hosts that receive the GeoDNS role # Hosts that receive the GeoDNS role
[geodns] [geodns]
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
hosts: geodns hosts: geodns
gather_facts: false gather_facts: false
roles: roles:
- {role: local, tags: ['local']}
- {role: geodns, tags: ['geodns']} - {role: geodns, tags: ['geodns']}
- name: MDSigner - name: MDSigner
...@@ -21,5 +22,6 @@ ...@@ -21,5 +22,6 @@
hosts: mdproxy hosts: mdproxy
gather_facts: false gather_facts: false
roles: roles:
- {role: local, tags: ['local']}
- {role: apache, tags: ['apache']} - {role: apache, tags: ['apache']}
- {role: mdproxy, tags: ['mdproxy']} - {role: mdproxy, tags: ['mdproxy']}
...@@ -8,7 +8,3 @@ geodns_version: v3.2.0 ...@@ -8,7 +8,3 @@ geodns_version: v3.2.0
geodns_config: "{{ geodns_dir}}/config" geodns_config: "{{ geodns_dir}}/config"
geolite_dir: "{{ geodns_dir }}/GeoLite2DB" 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 @@ ...@@ -3,7 +3,6 @@
apt: apt:
state: present state: present
name: name:
- ansible
- netcat-openbsd - netcat-openbsd
- name: Install Ansible community.general - name: Install Ansible community.general
...@@ -101,15 +100,3 @@ ...@@ -101,15 +100,3 @@
- geodns-update.timer - geodns-update.timer
notify: notify:
- "enable geodns job" - "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 ...@@ -5,7 +5,7 @@ Description=GeoDNS update
Type=oneshot Type=oneshot
WorkingDirectory={{ mdxsaas_dir }} WorkingDirectory={{ mdxsaas_dir }}
ExecStart=git pull 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 ExecStartPost=/bin/systemctl restart geodns
[Install] [Install]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Description=Run GeoDNS update Description=Run GeoDNS update
[Timer] [Timer]
OnCalendar=*-*-* *:0/5:00 OnCalendar=*-*-* *:02:00
Unit=geodns-update.service Unit=geodns-update.service
[Install] [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 @@ ...@@ -13,7 +13,11 @@
- name: Copy mdproxy service files - name: Copy mdproxy service files
ansible.builtin.template: ansible.builtin.template:
src: "mdproxy.service.j2" src: "{{ item }}.j2"
dest: "/etc/systemd/system/mdproxy.service" dest: "/etc/systemd/system/{{ item }}"
with_items:
- mdproxy.service
- mdproxy-update.service
- mdproxy-update.timer
notify: notify:
- "enable mdproxy job" - "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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment