From: Robert Waffen Date: Mon, 22 Jun 2020 08:59:17 +0000 (+0200) Subject: remove manage_records.rb X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=cfdeaf4eaa954618b1e600715ccb3065ec28b134;p=pixelpark%2Fadmin-tools.git remove manage_records.rb - move to public admin-tools --- diff --git a/Readme.md b/Readme.md index cff907e..e69de29 100644 --- a/Readme.md +++ b/Readme.md @@ -1,25 +0,0 @@ -# BMF / BMAS - -## bin/manage_records.rb - -Das script setzt anhand von yaml dateien cnames auf vorhandene a records - -yaml format: - - --- - ein_a_record: - - ein_cname - - zwei_cnames - - zweiter_a_records: - - drei_cnames - -Die bisherig config liegt hier im projekt in etc/dns/\*.yaml - -Ausführung: - - # einmalig zum installieren der abhängkieten - bundle install --path vendor/gems - - # bei jeder änderung der yaml files dann auszuführen - bundle exec ruby bin/manage_records.rb etc/dns/test_bmas.yaml diff --git a/bin/manage_records.rb b/bin/manage_records.rb deleted file mode 100755 index afc64cf..0000000 --- a/bin/manage_records.rb +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env ruby - -require 'yaml' -require 'resolv' -require 'net/ssh' -require 'pp' - -################################################################################ - -action = 'add-record' -data = YAML.load_file(ARGV[0]) -debug = true -pdns_cmds = [] -record_type = "CNAME" -ssh_output = [] -ttl = "3600" -user = 'robert.waffen' -zone = "pixelpark.net" -@dnsmaster = "dnsmaster.pp-dns.com" - -################################################################################ - -def check_rr_set(rrset) - Resolv::DNS.open({:nameserver=>[@dnsmaster]}) do |r| - r.getaddresses(rrset) - end -end - -data.map do |key, value| - puts "canme target: #{key}" if debug - - value.each do |cname| - puts "cname is #{cname}.#{zone}" if debug - test_record = check_rr_set "#{cname}.#{zone}" - pp test_record if debug - - if test_record.empty? - pdns_cmds << "pdnsutil #{action} #{zone} #{cname} #{record_type} #{ttl} #{key}.#{zone}." - end - end -end - -unless pdns_cmds.empty? - pdns_cmds << "pdnsutil increase-serial #{zone}" - pdns_cmds << "pdns_control notify #{zone}" -end - -puts pdns_cmds if debug - -Net::SSH.start(@dnsmaster, user) do |ssh| - pdns_cmds.each do |command| - ssh_output << ssh.exec!("sudo #{command}") - end -end - -puts ssh_output diff --git a/etc/dns/dev_bmas.yaml b/etc/dns/dev_bmas.yaml deleted file mode 100644 index 7de5165..0000000 --- a/etc/dns/dev_bmas.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -dev-bmas10: - - dev-standardlsg-preview-bmas10 - - dev-standardlsg-editor-bmas10 - - dev-standardlsg-www-bmas10 - - dev-bmas-preview-bmas10 - - dev-bmas-editor-bmas10 - - dev-bmas-www-bmas10 - - dev-repository-preview-bmas10 - - dev-editor-preview-bmas10 - - dev-service-preview-bmas10 - - dev-solr-preview-bmas10 - - dev-delivery-preview-bmas10 - - dev-workflow-preview-bmas10 - - dev-newsletter-preview-bmas10 - - dev-repository-master-bmas10 - - dev-service-master-bmas10 - - dev-solr-master-bmas10 - - dev-delivery1-master-bmas10 - - dev-delivery2-master-bmas10 - - dev-repository-replication-bmas10 - - dev-solr-replication-bmas10 - - dev-delivery1-replication-bmas10 - - dev-delivery2-replication-bmas10 - - dev-adminportal-database-bmas10 - - dev-site-database-bmas10 - - dev-preview-database-bmas10 - - dev-master-database-bmas10 - - dev-replication-database-bmas10 - - dev-maildistributor-database-bmas10 - - dev-workflow-database-bmas10 - - dev-adminportal-service-bmas10 - - dev-serviceportal-service-bmas10 - - dev-maildistributor-service-bmas10 - - dev-cas-preview-service-bmas10 - - dev-cas-live-service-bmas10 - - dev-ldap-preview-service-bmas10 - - dev-ldap-live-service-bmas10 - - dev-mail-extern-bmas10 - - dev-esf-preview-bmas10 - - dev-esf-editor-bmas10 - - dev-esf-www-bmas10 - - dev-inqa-preview-bmas10 - - dev-inqa-editor-bmas10 - - dev-inqa-www-bmas10 - - dev-bmas2020-preview-bmas10 - - dev-bmas2020-editor-bmas10 - - dev-bmas2020-www-bmas10 diff --git a/etc/dns/dev_bmf.yaml b/etc/dns/dev_bmf.yaml deleted file mode 100644 index 61b35f4..0000000 --- a/etc/dns/dev_bmf.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -dev-bmf10: - - dev-standardlsg-preview-bmf10 - - dev-standardlsg-editor-bmf10 - - dev-standardlsg-www-bmf10 - - dev-bmf-preview-bmf10 - - dev-bmf-editor-bmf10 - - dev-bmf-www-bmf10 - - dev-amthb-preview-bmf10 - - dev-amthb-editor-bmf10 - - dev-amthb-www-bmf10 - - dev-lsth-preview-bmf10 - - dev-lsth-www-bmf10 - - dev-esth-preview-bmf10 - - dev-esth-www-bmf10 - - dev-ksth-preview-bmf10 - - dev-ksth-www-bmf10 - - dev-gewsth-preview-bmf10 - - dev-gewsth-www-bmf10 - - dev-repository-preview-bmf10 - - dev-editor-preview-bmf10 - - dev-service-preview-bmf10 - - dev-solr-preview-bmf10 - - dev-delivery-preview-bmf10 - - dev-workflow-preview-bmf10 - - dev-newsletter-preview-bmf10 - - dev-repository-master-bmf10 - - dev-service-master-bmf10 - - dev-solr-master-bmf10 - - dev-delivery1-master-bmf10 - - dev-delivery2-master-bmf10 - - dev-repository-replication-bmf10 - - dev-solr-replication-bmf10 - - dev-delivery1-replication-bmf10 - - dev-delivery2-replication-bmf10 - - dev-adminportal-database-bmf10 - - dev-site-database-bmf10 - - dev-preview-database-bmf10 - - dev-master-database-bmf10 - - dev-replication-database-bmf10 - - dev-maildistributor-database-bmf10 - - dev-workflow-database-bmf10 - - dev-adminportal-service-bmf10 - - dev-serviceportal-service-bmf10 - - dev-maildistributor-service-bmf10 - - dev-cas-preview-service-bmf10 - - dev-cas-live-service-bmf10 - - dev-ldap-preview-service-bmf10 - - dev-ldap-live-service-bmf10 - - dev-mail-extern-bmf10 - - dev-usth-preview-bmf10 - - dev-usth-www-bmf10 - - dev-ao-preview-bmf10 - - dev-ao-www-bmf10 diff --git a/etc/dns/dev_tst.yaml b/etc/dns/dev_tst.yaml deleted file mode 100644 index 83220fc..0000000 --- a/etc/dns/dev_tst.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -www: - - robert - - waffen diff --git a/etc/dns/live_bmas.yaml b/etc/dns/live_bmas.yaml deleted file mode 100644 index fbf7a25..0000000 --- a/etc/dns/live_bmas.yaml +++ /dev/null @@ -1,73 +0,0 @@ ---- -master01-bmas10-de: - - master-database-bmas10 - - repository-master-bmas10 - - service-master-bmas10 - - site-database-bmas10 - - solr-master-bmas10 - -red-bmas10-de: - - adminportal-database-bmas10 - - adminportal-service-bmas10 - - amthb-editor-bmas10 - - amthb-preview-bmas10 - - bmas-editor-bmas10 - - bmas-preview-bmas10 - - cas-live-service-bmas10 - - cas-preview-service-bmas10 - - delivery-preview-bmas10 - - editor-preview-bmas10 - - maildistributor-database-bmas10 - - maildistributor-service-bmas10 - - newsletter-preview-bmas10 - - preview-database-bmas10 - - repository-preview-bmas10 - - service-preview-bmas10 - - serviceportal-service-bmas10 - - solr-preview-bmas10 - - workflow-database-bmas10 - - workflow-preview-bmas10 - - ldap-preview-service-bmas10 - - ldap-live-service-bmas10 - - esf-preview-bmas10 - - esf-editor-bmas10 - - inqa-preview-bmas10 - - inqa-editor-bmas10 - - bmas2020-preview-bmas10 - - bmas2020-editor-bmas10 - -slave01-bmas10-de: - - replication-database-bmas10 - - repository-replication-bmas10 - -www01-bmas10-de: - - bmas-www01-bmas10 - - delivery1-master-bmas10 - - esf-www01-bmas10 - - inqa-www01-bmas10 - - bmas2020-www01-bmas10 - -www02-bmas10-de: - - bmas-www02-bmas10 - - delivery2-master-bmas10 - - esf-www02-bmas10 - - inqa-www02-bmas10 - - bmas2020-www02-bmas10 - -www03-bmas10-de: - - bmas-www03-bmas10 - - delivery1-replication-bmas10 - - esf-www03-bmas10 - - inqa-www03-bmas10 - - bmas2020-www03-bmas10 - -www04-bmas10-de: - - bmas-www04-bmas10 - - delivery2-replication-bmas10 - - esf-www04-bmas10 - - inqa-www04-bmas10 - - bmas2020-www04-bmas10 - -bmas-www-bmas10: - # - inqa-www-bmas10 - - bmas2020-www-bmas10 diff --git a/etc/dns/live_bmf.yaml b/etc/dns/live_bmf.yaml deleted file mode 100644 index e30b0a1..0000000 --- a/etc/dns/live_bmf.yaml +++ /dev/null @@ -1,92 +0,0 @@ ---- -master01-bmf10-de: - - master-database-bmf10 - - repository-master-bmf10 - - service-master-bmf10 - - site-database-bmf10 - - solr-master-bmf10 - -red-bmf10-de: - - adminportal-database-bmf10 - - adminportal-service-bmf10 - - amthb-editor-bmf10 - - amthb-preview-bmf10 - - ao-preview-bmf10 - - bmf-editor-bmf10 - - bmf-preview-bmf10 - - cas-live-service-bmf10 - - cas-preview-service-bmf10 - - delivery-preview-bmf10 - - editor-preview-bmf10 - - esth-preview-bmf10 - - gewsth-preview-bmf10 - - ksth-preview-bmf10 - - lsth-preview-bmf10 - - maildistributor-database-bmf10 - - maildistributor-service-bmf10 - - newsletter-preview-bmf10 - - preview-database-bmf10 - - repository-preview-bmf10 - - service-preview-bmf10 - - serviceportal-service-bmf10 - - solr-preview-bmf10 - - usth-preview-bmf10 - - workflow-database-bmf10 - - workflow-preview-bmf10 - -slave01-bmf10-de: - - replication-database-bmf10 - - repository-replication-bmf10 - -www01-bmf10-de: - - amthb-www01-bmf10 - - ao-www01-bmf10 - - bmf-www01-bmf10 - - delivery1-master-bmf10 - - esth-www01-bmf10 - - gewsth-www01-bmf10 - - ksth-www01-bmf10 - - lsth-www01-bmf10 - - usth-www01-bmf10 - -www02-bmf10-de: - - amthb-www02-bmf10 - - ao-www02-bmf10 - - bmf-www02-bmf10 - - delivery2-master-bmf10 - - esth-www02-bmf10 - - gewsth-www02-bmf10 - - ksth-www02-bmf10 - - lsth-www02-bmf10 - - usth-www02-bmf10 - -www03-bmf10-de: - - amthb-www03-bmf10 - - ao-www03-bmf10 - - bmf-www03-bmf10 - - delivery1-replication-bmf10 - - esth-www03-bmf10 - - gewsth-www03-bmf10 - - ksth-www03-bmf10 - - lsth-www03-bmf10 - - usth-www03-bmf10 - -www04-bmf10-de: - - amthb-www04-bmf10 - - ao-www04-bmf10 - - bmf-www04-bmf10 - - delivery2-replication-bmf10 - - esth-www04-bmf10 - - gewsth-www04-bmf10 - - ksth-www04-bmf10 - - lsth-www04-bmf10 - - usth-www04-bmf10 - -bmf-www-bmf10: - - amthb-www-bmf10 - - ao-www-bmf10 - - esth-www-bmf10 - - gewsth-www-bmf10 - - ksth-www-bmf10 - - lsth-www-bmf10 - - usth-www-bmf10 diff --git a/etc/dns/test_bmas.yaml b/etc/dns/test_bmas.yaml deleted file mode 100644 index 24ae007..0000000 --- a/etc/dns/test_bmas.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -test-master01-bmas10-de: - - test-master-database-bmas10 - - test-site-database-bmas10 - - test-repository-master-bmas10 - - test-service-master-bmas10 - - test-solr-master-bmas10 - -test-red-bmas10-de: - - test-preview-database-bmas10 - - test-adminportal-database-bmas10 - - test-maildistributor-database-bmas10 - - test-workflow-database-bmas10 - - test-adminportal-service-bmas10 - - test-cas-preview-service-bmas10 - - test-cas-live-service-bmas10 - - test-service-preview-bmas10 - - test-solr-preview-bmas10 - - test-maildistributor-service-bmas10 - - test-editor-preview-bmas10 - - test-workflow-preview-bmas10 - - test-repository-preview-bmas10 - - test-delivery-preview-bmas10 - - test-newsletter-preview-bmas10 - - test-serviceportal-service-bmas10 - - test-bmas-preview-bmas10 - - test-bmas-editor-bmas10 - - test-ldap-preview-service-bmas10 - - test-ldap-live-service-bmas10 - - test-esf-preview-bmas10 - - test-esf-editor-bmas10 - - test-inqa-preview-bmas10 - - test-inqa-editor-bmas10 - - test-bmas2020-preview-bmas10 - - test-bmas2020-editor-bmas10 - -test-slave01-bmas10-de: - - test-replication-database-bmas10 - - test-repository-replication-bmas10 - -test-www01-bmas10-de: - - test-delivery1-master-bmas10 - - test-bmas-www01-bmas10 - - test-bmas-www01-bmas10 - - test-esf-www01-bmas10 - - test-inqa-www01-bmas10 - - test-bmas2020-www01-bmas10 - -test-www02-bmas10-de: - - test-delivery1-replication-bmas10 - - test-bmas-www02-bmas10 - - test-bmas-www02-bmas10 - - test-esf-www02-bmas10 - - test-inqa-www02-bmas10 - - test-bmas2020-www02-bmas10 - -test-bmas-www-bmas10: - - test-inqa-www-bmas10 - - test-bmas2020-www-bmas10 diff --git a/etc/dns/test_bmf.yaml b/etc/dns/test_bmf.yaml deleted file mode 100644 index 6b2b63e..0000000 --- a/etc/dns/test_bmf.yaml +++ /dev/null @@ -1,78 +0,0 @@ ---- -test-master01-bmf10-de: - - test-master-database-bmf10 - - test-site-database-bmf10 - - test-repository-master-bmf10 - - test-service-master-bmf10 - - test-solr-master-bmf10 - -test-red-bmf10-de: - - test-preview-database-bmf10 - - test-adminportal-database-bmf10 - - test-maildistributor-database-bmf10 - - test-workflow-database-bmf10 - - test-adminportal-service-bmf10 - - test-cas-preview-service-bmf10 - - test-cas-live-service-bmf10 - - test-service-preview-bmf10 - - test-solr-preview-bmf10 - - test-maildistributor-service-bmf10 - - test-editor-preview-bmf10 - - test-workflow-preview-bmf10 - - test-repository-preview-bmf10 - - test-delivery-preview-bmf10 - - test-newsletter-preview-bmf10 - - test-serviceportal-service-bmf10 - - test-bmf-preview-bmf10 - - test-bmf-editor-bmf10 - - test-ldap-preview-service-bmf10 - - test-ldap-live-service-bmf10 - -# customer - - test-bmf-preview-bmf10 - - test-lsth-preview-bmf10 - - test-amthb-preview-bmf10 - - test-esth-preview-bmf10 - - test-ksth-preview-bmf10 - - test-gewsth-preview-bmf10 - - test-usth-preview-bmf10 - - test-ao-preview-bmf10 - - test-bmf-editor-bmf10 - - test-amthb-editor-bmf10 - -test-slave01-bmf10-de: - - test-replication-database-bmf10 - - test-repository-replication-bmf10 - -test-www01-bmf10-de: - - test-delivery1-master-bmf10 - - test-bmf-www01-bmf10 - - test-bmf-www01-bmf10 - - test-amthb-www01-bmf10 - - test-lsth-www01-bmf10 - - test-esth-www01-bmf10 - - test-ksth-www01-bmf10 - - test-gewsth-www01-bmf10 - - test-usth-www01-bmf10 - - test-ao-www01-bmf10 - -test-www02-bmf10-de: - - test-delivery1-replication-bmf10 - - test-bmf-www02-bmf10 - - test-bmf-www02-bmf10 - - test-amthb-www02-bmf10 - - test-lsth-www02-bmf10 - - test-esth-www02-bmf10 - - test-ksth-www02-bmf10 - - test-gewsth-www02-bmf10 - - test-usth-www02-bmf10 - - test-ao-www02-bmf10 - -test-bmf-www-bmf10: - - test-amthb-www-bmf10 - - test-ao-www-bmf10 - - test-esth-www-bmf10 - - test-gewsth-www-bmf10 - - test-ksth-www-bmf10 - - test-lsth-www-bmf10 - - test-usth-www-bmf10