summaryrefslogtreecommitdiffstats
path: root/foreman
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2015-09-09 17:59:42 -0400
committerTim Rozet <trozet@redhat.com>2015-09-11 13:44:13 -0400
commit1089c79563e61589d105accc3067f6ebbd3020ed (patch)
tree6776a64bd8bdf12d5fb02baca7d297e9f85e6b51 /foreman
parent55846e9216601a5e3eeb0b16d0ede70fb684c03a (diff)
Allows domain name to be configured
Users may now provide domain_name in the ksgen settings file (along with setting the correct and respective hostnames). This domain name will be used for all of the deployed machines. JIRA: BGS-86 Change-Id: I34b6da07dd565648399ea7a1abf2abe1ae62d91a Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'foreman')
-rwxr-xr-xforeman/ci/deploy.sh8
-rw-r--r--foreman/ci/opnfv_ksgen_settings.yml17
-rw-r--r--foreman/ci/opnfv_ksgen_settings_no_HA.yml9
-rwxr-xr-xforeman/ci/vm_nodes_provision.sh11
4 files changed, 26 insertions, 19 deletions
diff --git a/foreman/ci/deploy.sh b/foreman/ci/deploy.sh
index 29ad83c..a12688b 100755
--- a/foreman/ci/deploy.sh
+++ b/foreman/ci/deploy.sh
@@ -1091,8 +1091,12 @@ start_virtual_nodes() {
##modify provisioning to do puppet install, config, and foreman check-in
##substitute host_name and dns_server in the provisioning script
- host_string=config_nodes_${node}_hostname
- host_name=$(eval echo \$$host_string)
+ host_string=config_nodes_${node}_short_name
+ short_host_name=$(eval echo \$$host_string)
+ ##substitute domain_name
+ domain_name=$config_domain_name
+ sed -i 's/^domain_name=REPLACE/domain_name='$domain_name'/' vm_nodes_provision.sh
+ host_name=${short_host_name}.${domain_name}
sed -i 's/^host_name=REPLACE/host_name='$host_name'/' vm_nodes_provision.sh
##dns server should be the foreman server
sed -i 's/^dns_server=REPLACE/dns_server='${interface_ip_arr[0]}'/' vm_nodes_provision.sh
diff --git a/foreman/ci/opnfv_ksgen_settings.yml b/foreman/ci/opnfv_ksgen_settings.yml
index b41a41b..08b723e 100644
--- a/foreman/ci/opnfv_ksgen_settings.yml
+++ b/foreman/ci/opnfv_ksgen_settings.yml
@@ -45,6 +45,7 @@ global_params:
network_type: multi_network
default_gw:
no_dhcp: false
+domain_name: opnfv.com
foreman:
seed_values:
- { name: heat_cfn, oldvalue: true, newvalue: false }
@@ -100,8 +101,8 @@ workaround_vif_plugging: false
openstack_packstack_rpm: http://REPLACE_ME/brewroot/packages/openstack-puppet-modules/2013.2/9.el6ost/noarch/openstack-puppet-modules-2013.2-9.el6ost.noarch.rpm
nodes:
compute:
- name: oscompute11.opnfv.com
- hostname: oscompute11.opnfv.com
+ name: oscompute11.{{ domain_name }}
+ hostname: oscompute11.{{ domain_name }}
short_name: oscompute11
type: compute
host_type: baremetal
@@ -121,8 +122,8 @@ nodes:
- rdo
- neutron
controller1:
- name: oscontroller1.opnfv.com
- hostname: oscontroller1.opnfv.com
+ name: oscontroller1.{{ domain_name }}
+ hostname: oscontroller1.{{ domain_name }}
short_name: oscontroller1
type: controller
host_type: baremetal
@@ -144,8 +145,8 @@ nodes:
- rdo
- neutron
controller2:
- name: oscontroller2.opnfv.com
- hostname: oscontroller2.opnfv.com
+ name: oscontroller2.{{ domain_name }}
+ hostname: oscontroller2.{{ domain_name }}
short_name: oscontroller2
type: controller
host_type: baremetal
@@ -167,8 +168,8 @@ nodes:
- rdo
- neutron
controller3:
- name: oscontroller3.opnfv.com
- hostname: oscontroller3.opnfv.com
+ name: oscontroller3.{{ domain_name }}
+ hostname: oscontroller3.{{ domain_name }}
short_name: oscontroller3
type: controller
host_type: baremetal
diff --git a/foreman/ci/opnfv_ksgen_settings_no_HA.yml b/foreman/ci/opnfv_ksgen_settings_no_HA.yml
index 79db257..4c0511a 100644
--- a/foreman/ci/opnfv_ksgen_settings_no_HA.yml
+++ b/foreman/ci/opnfv_ksgen_settings_no_HA.yml
@@ -12,6 +12,7 @@ global_params:
network_type: multi_network
default_gw:
no_dhcp: false
+domain_name: opnfv.com
foreman:
seed_values:
- { name: heat_cfn, oldvalue: true, newvalue: false }
@@ -67,8 +68,8 @@ workaround_vif_plugging: false
openstack_packstack_rpm: http://REPLACE_ME/brewroot/packages/openstack-puppet-modules/2013.2/9.el6ost/noarch/openstack-puppet-modules-2013.2-9.el6ost.noarch.rpm
nodes:
compute:
- name: oscompute11.opnfv.com
- hostname: oscompute11.opnfv.com
+ name: oscompute11.{{ domain_name }}
+ hostname: oscompute11.{{ domain_name }}
short_name: oscompute11
type: compute
host_type: baremetal
@@ -88,8 +89,8 @@ nodes:
- rdo
- neutron
controller1:
- name: oscontroller1.opnfv.com
- hostname: oscontroller1.opnfv.com
+ name: oscontroller1.{{ domain_name }}
+ hostname: oscontroller1.{{ domain_name }}
short_name: oscontroller1
type: controller
host_type: baremetal
diff --git a/foreman/ci/vm_nodes_provision.sh b/foreman/ci/vm_nodes_provision.sh
index e64c0ad..0754e31 100755
--- a/foreman/ci/vm_nodes_provision.sh
+++ b/foreman/ci/vm_nodes_provision.sh
@@ -19,6 +19,7 @@ green=`tput setaf 2`
host_name=REPLACE
dns_server=REPLACE
host_ip=REPLACE
+domain_name=REPLACE
##END VARS
##set hostname
@@ -35,7 +36,7 @@ fi
##modify /etc/resolv.conf to point to foreman
echo "${blue} Configuring resolv.conf with DNS: $dns_server ${reset}"
cat > /etc/resolv.conf << EOF
-search ci.com opnfv.com
+search ci.com $domain_name
nameserver $dns_server
nameserver 8.8.8.8
@@ -94,10 +95,10 @@ pluginsync = true
report = true
ignoreschedules = true
daemon = false
-ca_server = foreman-server.opnfv.com
+ca_server = foreman-server.$domain_name
certname = $host_name
environment = production
-server = foreman-server.opnfv.com
+server = foreman-server.$domain_name
runinterval = 600
EOF
@@ -105,13 +106,13 @@ EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
-/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server foreman-server.opnfv.com --no-daemonize
+/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server foreman-server.$domain_name --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
-wget -q -O /dev/null --no-check-certificate http://foreman-server.opnfv.com:80/unattended/built
+wget -q -O /dev/null --no-check-certificate http://foreman-server.$domain_name:80/unattended/built
echo "Starting puppet"
systemctl start puppet