From 7eb2956b426eb7cd35446abcf1ac21a13fe5449c Mon Sep 17 00:00:00 2001 From: Valentin Gologuzov Date: Fri, 10 Oct 2014 14:25:12 +0200 Subject: [PATCH] [copr] custom variable copr_hostbase to setup hostname --- inventory/host_vars/209.132.184.142 | 3 +++ inventory/host_vars/209.132.184.144 | 4 ++++ .../host_vars/copr-be-dev.cloud.fedoraproject.org | 2 +- .../host_vars/copr-fe-dev.cloud.fedoraproject.org | 3 +++ roles/copr/base/tasks/main.yml | 11 +++++------ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/inventory/host_vars/209.132.184.142 b/inventory/host_vars/209.132.184.142 index a5208290db..375988eb0a 100644 --- a/inventory/host_vars/209.132.184.142 +++ b/inventory/host_vars/209.132.184.142 @@ -23,3 +23,6 @@ fedmsg_certs: owner: root group: copr +# Copr vars + +copr_hostbase: copr-be diff --git a/inventory/host_vars/209.132.184.144 b/inventory/host_vars/209.132.184.144 index 3fc35f8f48..a8b3508846 100644 --- a/inventory/host_vars/209.132.184.144 +++ b/inventory/host_vars/209.132.184.144 @@ -10,3 +10,7 @@ root_auth_users: bkabrda ryanlerch pingou msuchy sgallagh nb asamalik description: copr frontend server volumes: ['-d /dev/vdb vol-0000000f'] tcp_ports: [22, 80, 443] + +# Copr vars + +copr_hostbase: copr-fe diff --git a/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org b/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org index 747f540fb8..0e95a0efa0 100644 --- a/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org +++ b/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org @@ -11,4 +11,4 @@ description: copr dispatcher and repo server - dev instance tcp_ports: ['22', '80', '443'] # Copr vars -copr_hostname: copr-be-dev.cloud.fedoraproject.org +copr_hostbase: copr-be-dev diff --git a/inventory/host_vars/copr-fe-dev.cloud.fedoraproject.org b/inventory/host_vars/copr-fe-dev.cloud.fedoraproject.org index b5e8f7a84a..38293d8841 100644 --- a/inventory/host_vars/copr-fe-dev.cloud.fedoraproject.org +++ b/inventory/host_vars/copr-fe-dev.cloud.fedoraproject.org @@ -9,3 +9,6 @@ public_ip: 209.132.184.183 root_auth_users: bkabrda ryanlerch pingou msuchy tradej asamalik description: copr frontend server - dev instance tcp_ports: [22, 80, 443] + +# Copr vars +copr_hostbase: copr-fe-dev diff --git a/roles/copr/base/tasks/main.yml b/roles/copr/base/tasks/main.yml index b4e3779aab..709eeba836 100644 --- a/roles/copr/base/tasks/main.yml +++ b/roles/copr/base/tasks/main.yml @@ -7,12 +7,11 @@ - include: "{{ tasks }}/iptables.yml" - include: "{{ tasks }}/postfix_basic.yml" -#- name: setup correct hostname for copr machine -# hostname: name="{{ hostbase|regex_replace('.*-$', '')}}.cloud.fedoraproject.org" -# tags: -# - config - -- debug: "{{ hostbase|regex_replace('.*-$', '')}}.cloud.fedoraproject.org" +- name: setup correct hostname for copr machine + hostname: name="{{ copr_hostbase }}.cloud.fedoraproject.org" + # hostname: name="{{ hostbase|regex_replace('.*-$', '')}}.cloud.fedoraproject.org" + tags: + - config - name: copy .forward file copy: src="{{ _forward_src }}" dest="/root/.forward" owner=root group=root