diff --git a/iso/bootstrap_admin_node.sh b/iso/bootstrap_admin_node.sh index 721a90e700..6d0bcbcf4f 100644 --- a/iso/bootstrap_admin_node.sh +++ b/iso/bootstrap_admin_node.sh @@ -21,37 +21,68 @@ apply_settings # Installing puppetmaster/cobbler node role echo;echo "Provisioning masternode role ..." ( -puppet apply -e "class {openstack::mirantis_repos: enable_epel => true }" -puppet apply -e "class {puppet: } -> class {puppet::thin:} -> class {puppet::nginx: puppet_master_hostname => \"$hstname.$domain\"}" -puppet apply -e 'class {puppetdb: }' -puppet apply -e 'class {puppet::master_config: }' +puppet apply -e " + class {openstack::mirantis_repos: enable_epel => true } + class {puppet: } -> class {puppet::thin:} -> class {puppet::nginx: puppet_master_hostname => \"$hstname.$domain\"} + class {puppetdb: }" +puppet apply -e " + class {puppet::master_config: } " # Walking aroung nginx's default server config rm -f /etc/nginx/conf.d/default.conf service nginx restart -puppet apply --debug -e "class {cobbler: server => \"$server\", domain_name => \"$domain_name\", name_server => \"$name_server\", \ - next_server => \"$next_server\", dhcp_start_address => \"$dhcp_start_address\" , dhcp_end_address => \"$dhcp_end_address\", \ - dhcp_netmask => \"$dhcp_netmask\", dhcp_gateway => \"$dhcp_gateway\" , cobbler_user => \"$cobbler_user\", cobbler_password =>\"$cobbler_password\", \ - pxetimeout => \"$pxetimeout\", dhcp_interface => \"$dhcp_interface\" }" +puppet apply -e " + class { cobbler: + server => \"$server\", + domain_name => \"$domain_name\", + name_server => \"$name_server\", + next_server => \"$next_server\", + dhcp_start_address => \"$dhcp_start_address\", + dhcp_end_address => \"$dhcp_end_address\", + dhcp_netmask => \"$dhcp_netmask\", + dhcp_gateway => \"$dhcp_gateway\", + cobbler_user => \"$cobbler_user\", + cobbler_password =>\"$cobbler_password\", + pxetimeout => \"$pxetimeout\", + dhcp_interface => \"$dhcp_interface\" }" -puppet apply -e " \ - class { 'cobbler::nat': nat_range => \"$mgmt_ip/$mgmt_mask\" } - cobbler_distro {'ubuntu_1204_x86_64': - kernel => '/var/www/ubuntu/netboot/linux', - initrd => '/var/www/ubuntu/netboot/initrd.gz', - breed => 'ubuntu', - arch => 'x86_64', - osversion => 'precise', - ksmeta => 'tree_host=172.18.67.168 tree_url=/ubuntu-repo/mirror.yandex.ru/ubuntu/', } - class { 'cobbler::profile::ubuntu_1204_x86_64': } - cobbler_distro {'centos63_x86_64': - kernel => '/var/www/centos/6.3/os/x86_64/isolinux/vmlinuz', - initrd => '/var/www/centos/6.3/os/x86_64/isolinux/initrd.img', - arch => 'x86_64', - breed => 'redhat', - osversion => 'rhel6', - ksmeta => 'tree=http://172.18.67.168/centos-repo/centos-6.3', } - class { 'cobbler::profile::centos63_x86_64': } - class { 'mcollective::rabbitmq': } class { 'mcollective::client': }" +puppet apply -e " + class { 'cobbler::nat': nat_range => \"$mgmt_ip/$mgmt_mask\" } + cobbler_distro {'ubuntu_1204_x86_64': + kernel => '/var/www/ubuntu/netboot/linux', + initrd => '/var/www/ubuntu/netboot/initrd.gz', + breed => 'ubuntu', + arch => 'x86_64', + osversion => 'precise', + ksmeta => 'tree_host=us.archive.ubuntu.com tree_url=/ubuntu', } + class { 'cobbler::profile::ubuntu_1204_x86_64': } + cobbler_distro {'centos63_x86_64': + kernel => '/var/www/centos/6.3/os/x86_64/isolinux/vmlinuz', + initrd => '/var/www/centos/6.3/os/x86_64/isolinux/initrd.img', + arch => 'x86_64', + breed => 'redhat', + osversion => 'rhel6', + ksmeta => 'tree=http://mirror.stanford.edu/yum/pub/centos', } + class { 'cobbler::profile::centos63_x86_64': }" + +puppet apply -e ' + $stompuser="mcollective" + $stomppassword="AeN5mi5thahz2Aiveexo" + $pskey="un0aez2ei9eiGaequaey4loocohjuch4Ievu3shaeweeg5Uthi" + $stomphost="127.0.0.1" + $stompport="61613" + + class { mcollective::rabbitmq: + stompuser => $stompuser, + stomppassword => $stomppassword, + } + + class { mcollective::client: + pskey => $pskey, + stompuser => $stompuser, + stomppassword => $stomppassword, + stomphost => $stomphost, + stompport => $stompport + } ' ) >> $log \ No newline at end of file diff --git a/iso/functions.sh b/iso/functions.sh index 9293c9547b..58613e610c 100644 --- a/iso/functions.sh +++ b/iso/functions.sh @@ -40,7 +40,7 @@ function default_settings { hostname="fuel-pm" domain="local" mgmt_if="eth0" - mgmt_ip="10.0.0.1" + mgmt_ip="10.0.0.100" mgmt_mask="255.255.0.0" ext_if="eth1" dhcp_start_address="10.0.0.201" @@ -78,6 +78,8 @@ function apply_settings { # Domain/Hostname apply sed -i -e 's#^\(HOSTNAME=\).*$#\1'"$hostname"'#' /etc/sysconfig/network + [ -z $mgmt_ip ] && echo "prepend domain-name-servers 127.0.0.1;" >> /etc/dhclient-$mgmt_if.conf + [ -z $ext_ip ] && echo "prepend domain-name-servers 127.0.0.1;" >> /etc/dhclient-$ext_if.conf [ -z $mgmt_ip ] || grep -q "^\s*$mgmt_ip\s+$hostname" /etc/hosts || echo "$mgmt_ip $hostname.$domain $hostname" >> /etc/hosts service network restart sed -i "s%\(^.*address is:\).*$%\1 `ip address show $ext_if | awk '/inet / {print \$2}' | cut -d/ -f1 -`%" /etc/issue diff --git a/iso/ks.cfg b/iso/ks.cfg index 1391270b85..120286a774 100644 --- a/iso/ks.cfg +++ b/iso/ks.cfg @@ -4,11 +4,11 @@ text reboot --eject lang en_US.UTF-8 selinux --disabled -url --url http://172.18.67.168/centos-repo/centos-6.3 -#url --url http://mirror.stanford.edu/yum/pub/centos/6.3/os/x86_64/ +#url --url http://172.18.67.168/centos-repo/centos-6.3 +url --url http://mirror.stanford.edu/yum/pub/centos/6.3/os/x86_64/ network --bootproto=dhcp -#repo --name=Base --mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=x86_64&repo=os -repo --name=Base --baseurl=http://172.18.67.168/centos-repo/centos-6.3 +repo --name=Base --mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=x86_64&repo=os +#repo --name=Base --baseurl=http://172.18.67.168/centos-repo/centos-6.3 repo --name=Updates --mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=x86_64&repo=updates repo --name=Mirantis --mirrorlist=http://download.mirantis.com/epel-fuel-folsom/mirror.internal.list repo --name=PuppetLabs --baseurl=http://yum.puppetlabs.com/el/6/products/x86_64/ @@ -87,10 +87,10 @@ puppetdb python-argparse mcollective mcollective-client -rubygem-astute -#ruby-devel -#gcc -#make +#rubygem-astute +ruby-devel +gcc +make man yum openssh-clients @@ -132,7 +132,7 @@ baseurl=http://yum.puppetlabs.com/el/6/products/x86_64/ gpgcheck=0 EOF -mkdir -p /etc/httpd/conf.d +#mkdir -p /etc/httpd/conf.d #cat > /etc/httpd/conf.d/distr.conf << EOF #Alias /ubuntu /var/www/ubuntu #Alias /centos /var/www/centos @@ -155,11 +155,13 @@ chmod 0777 /usr/local/sbin/bootstrap_admin_node.sh cp ${SOURCE}/bootstrap_admin_node.conf /etc/init/bootstrap_admin_node.conf echo "ENABLED=1" > /etc/sysconfig/bootstrap_admin_node +# Copying cobbler system script to sbin folder +cp /etc/puppet/modules/cobbler/examples/cobbler_system.py /usr/local/sbin + # Copying version.yaml file. It contains COMMIT_SHA of last commit. mkdir -p /etc/fuel cp ${SOURCE}/version.yaml /etc/fuel/version.yaml - # Prepare custom /etc/issue logon banner and script for changing IP in it cat > /etc/issue << EOF ###################################################