Authored by root

Enable center switch

... ... @@ -4,9 +4,8 @@
- name: "confirmation"
prompt: "Sync and reload dns server. Please Enter DNS to continue."
private: no
- name: "center"
prompt: "Select the zone center. Please Enter zone1 or zone2 to continue."
private: no
vars:
center: "zone1"
remote_user: root
roles:
- yoho.dns
... ...
---
# Playbook for center switch
- hosts: nameservers
vars_prompt:
- name: "center"
prompt: "Select the zone center. Please Enter zone1 or zone2 to continue."
private: no
remote_user: root
roles:
- yoho.switch
- import_playbook: yoho.dns.yml center=center
... ...
... ... @@ -14,10 +14,20 @@
timestamp: "{{ lookup('pipe','date +%Y-%m-%d-%H-%M-%S') }}"
zone_serical: "{{ ansible_date_time.epoch }}"
- name: sync bind9 zone files
- name: sync bind9 zone files with center zone1
template:
src: qcloud.zone.j2
dest: /Data/named/qcloud.zone
backup: yes
notify:
- reload bind
\ No newline at end of file
- reload bind
when: center == 'zone1'
- name: sync bind9 zone files with center zone2
template:
src: qcloud_az2.zone.j2
dest: /Data/named/qcloud.zone
backup: yes
notify:
- reload bind
when: center == 'zone2'
... ...
---
# tasks file for yoho.switch
\ No newline at end of file
# tasks file for yoho.switch
... ...