Commit 993a9034 by sungmin

* modified config file for uxenos install

- added playbook(install pengxapi, create vm)
- modified fai config
parent 03529570
{% raw %}
---
- name: get pm hostname
file: state=touch path=/root/{{pm_name}}{{item}}
with_items: "{{ vm_count }}"
- name: get bind gvm uuid
shell: /opt/pengx3/script/pengxcli gvm-list | grep {{gvm_name}} | grep -v UUID | awk '{print $1}'
register: gvm
- name: add vm
shell: /opt/pengx3/script/pengxcli vm-add {{pm_name}}-{{vm_name}}-{{item}} {{gvm.stdout}} {{storlink}} {{cpu}} {{mem}} {{mem}} {{vm_name}} {{br0}}
with_items: "{{ vm_count }}"
- name: get bind vm uuid
shell: /opt/pengx3/script/pengxcli vm-list | grep {{pm_name}}-{{vm_name}} | grep -v UUID | awk '{print $1}'
register: vm
- name: start vm
shell: /opt/pengx3/script/pengxcli vm-start {{item}}
with_items: "{{ [vm.stdout] }}"
...
{% endraw %}
---
# This playbook deploys CREATEVM
- name: create vm
hosts: all
roles:
- createvm
{% raw %}
---
#- name: copy pengxapi.deb
# copy:
# src: pengxapi.deb
# dest: /opt
- name: initialize pengxapi
apt:
name: pengxapi
state: absent
purge: yes
force: yes
- name: set first node no
debconf:
name: pengxapi
question: pengxapi/first_node
value: no
vtype: boolean
when: connect_db|succeeded
- name: set first node
debconf:
name: pengxapi
question: pengxapi/first_node
value: yes
vtype: boolean
when: connect_db|failed
- name: set db host
debconf:
name: pengxapi
question: pengxapi/db_host
value: "{{ db_host }}"
vtype: string
- name: set db name
debconf:
name: pengxapi
question: pengxapi/db_name
value: "{{ db_name }}"
vtype: string
- name: set db user
debconf:
name: pengxapi
question: pengxapi/db_user
value: "{{ db_user }}"
vtype: string
- name: set db passwd
debconf:
name: pengxapi
question: pengxapi/db_passwd
value: "{{ db_passwd }}"
vtype: password
- name: install pengxapi.deb
apt:
deb: /opt/pengxapi.deb
{% endraw %}
# This playbook deploys PENGXAPI
- name: Install Pengxapi
hosts: all
roles:
- common
- postgresql
- pengxapi
......@@ -32,7 +32,7 @@ case $OS in
echo PORCH
exit 0 ;;
UXENOS)
echo "FAIBASE UXENOS"
echo "FAIBASE DEBIAN UXENOS"
ifclass AMD64 && echo JESSIE64
echo PORCH
exit 0 ;;
......
kexec-tools kexec-tools/load_kexec false
kexec-tools kexec-tools/use_grub_config false
pengxconf pengxconf/dom0_vcpus string 1
pengxconf pengxconf/dom0_mem string 1
pengxconf pengxconf/crashkernel string 0
pengxconf pengxconf/services multiselect
The file could not be displayed because it is too large.
PACKAGES install
locales
less
sudo
openssh-server
......@@ -50,7 +51,6 @@ libxen-dev
linux-image-3.16.0-4-amd64
linux-headers-3.16.0-4-amd64
linux-kbuild-3.16
#linux-image-3.16.0-4-amd64-dbg
blktap-dkms
libusb-1.0-0-dev
......@@ -79,4 +79,19 @@ makedumpfile
kdump-tools
crash
## pengxapi3
nginx
sqlite3
python-psutil
python-netifaces
liblvm2app2.2
curl
postgresql-client
postgresql-server-dev-9.4
python3
python3-dev
python3-pip
python3-venv
python3-guestfs
#mcelog
......@@ -7,6 +7,7 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# create directory for deb files.
mkdir -p $target/debs
# copy uxen_deb.tar to $target/debs
tar -C $target/debs -xvf /var/lib/fai/config/debs/pengx_deb.tar
......@@ -15,11 +16,9 @@ cp $target/debs/kdump-config $target/usr/sbin/
# copy pengxai.deb
cp $target/debs/pengxapi.deb $target/opt
cp $target/debs/postgresql-9.4_9.4.6-0+deb8u1_amd64.deb $target/opt
# install deb files.
#$ROOTCMD DEBIAN_FRONTEND=noninteractive dpkg -i /debs/*
#$ROOTCMD dpkg -i /debs/*
$ROOTCMD dpkg -i /debs/pengxconf.deb
$ROOTCMD dpkg -i /debs/kexec-tools_2.0.7-5_amd64.deb
$ROOTCMD dpkg -i /debs/libcacard0_1%3a2.5.0-2~bpo8+1_amd64.deb
......
#! /bin/bash
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# set root password
$ROOTCMD usermod -p $ROOTPW root
exit $error
#!/bin/bash
#
# Capabilities get lost when creating the fai base.tar.xz image.
# Restore them here.
#
set -e
if [ ! -x $target/sbin/setcap ] ; then
exit 0
fi
for FILE in /bin/ping /bin/ping6 /usr/bin/fping /usr/bin/fping6; do
if [ -x $target/$FILE ] ; then
if $ROOTCMD /sbin/setcap cap_net_raw+ep $FILE; then
echo "Setcap worked! $FILE is not suid!"
fi
fi
done
if [ -x $target/usr/bin/systemd-detect-virt ] ; then
$ROOTCMD /sbin/setcap cap_dac_override,cap_sys_ptrace+ep /usr/bin/systemd-detect-virt
fi
......@@ -4,6 +4,11 @@
LOGFILE="$target/var/log/simple-cdd-postinst.log"
echo "pengx3.postinst begin" >> $LOGFILE
# add orchard user
echo "add orchard user"
$ROOTCMD useradd -d /home/orchard -s /bin/bash orchard
$ROOTCMD usermod -p $ORCHARDPW orchard
# install blktap-utils
$ROOTCMD apt-get -qq update
......@@ -11,16 +16,12 @@ $ROOTCMD apt-get install -y blktap-utils
echo "Finish to install blktap-utils." >> $LOGFILE
# remove nano
$ROOTCMD apt-get remove -y nano
# xen bridge setting on /etc/network/interfaces
INTERFACES="$target/etc/network/interfaces"
if [ -f $INTERFACES ]
then
ETH_NO=`grep '^iface.*eth' $INTERFACES|awk '{print $2}'|tr -d '\n'|tail -c 1`
perl -pi.bak -e "s/static/manual\\nauto xenbr$ETH_NO\\niface xenbr$ETH_NO inet static\\n \tbridge_ports eth$ETH_NO\\n \tbridge_maxwait 5/g" $INTERFACES
ETH=`grep '^iface.*eth' $INTERFACES|awk '{print $2}' | cut -c 4`
for ETH_NO in $ETH;do perl -pi.bak -e "s/eth$ETH_NO inet static/eth$ETH_NO inet manual\\nauto xenbr$ETH_NO\\niface xenbr$ETH_NO inet static\\n \tbridge_ports eth$ETH_NO\\n \tbridge_maxwait 5/g" $INTERFACES;done
echo "Finish to set up xen bridge in $INTERFACES." >> $LOGFILE
else
echo "interfaces file is not found($INTERFACES)." >> $LOGFILE
......
#! /bin/bash
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
#if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
#then
# cat > $target/etc/network/interfaces <<-EOF
# # generated by FAI
# auto lo $NIC1
# iface lo inet loopback
# iface $NIC1 inet dhcp
#EOF
#elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
#then
# PXE network config.
[ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
# generated by FAI
#auto $NIC1
#iface $NIC1 inet static
# address $IPADDR
# netmask $NETMASK
auto eth0
iface eth0 inet static
address $IPADDR
netmask $NETMASK
gateway $GATEWAY
EOF
[ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
if [ ! -L $target/etc/resolv.conf -a -e /etc/resolv.conf ]; then
cp -p /etc/resolv.conf $target/etc
fi
#fi
# Add service network interface (fixed to 'eth1' for now)
#if [ -f $FAI/svc-interface ]
#then
# echo "Add service interface"
# cat $FAI/svc-interface >> $target/etc/network/interfaces
#else
# echo "No svc-interface. So set gateway on NIC1."
# echo " gateway $GATEWAY" >> $target/etc/network/interfaces
#fi
# here fcopy is mostly used, when installing a client for running in a
# different subnet than during the installation
fcopy -iM /etc/resolv.conf
fcopy -iM /etc/network/interfaces /etc/networks
exit $error
#! /bin/bash
# (c) Thomas Lange, 2001-2015, lange@debian.org
# (c) Michael Goetze, 2010-2011, mgoetze@mgoetze.net
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# a list of modules which are loaded at boot time
for module in $MODULESLIST; do
ainsl -a /etc/modules "^$module$"
done
fcopy -Mv /etc/hostname || echo $HOSTNAME > $target/etc/hostname
ainsl -av /etc/mailname ${HOSTNAME}
if [ ! -e $target/etc/adjtime ]; then
printf "0.0 0 0.0\n0\nUTC" > $target/etc/adjtime
fi
if [ "$UTC" = "yes" ]; then
sed -i -e 's:^LOCAL$:UTC:' $target/etc/adjtime
else
sed -i -e 's:^UTC$:LOCAL:' $target/etc/adjtime
fi
# enable linuxlogo
#if [ -f $target/etc/inittab ]; then
# sed -i -e 's#/sbin/getty 38400#/sbin/getty -f /etc/issue.linuxlogo 38400#' ${target}/etc/inittab
#elif [ -f $target/lib/systemd/system/getty@.service ]; then
# sed -i -e 's#sbin/agetty --noclear#sbin/agetty -f /etc/issue.linuxlogo --noclear#' $target/lib/systemd/system/getty@.service
#fi
if [ ! -f $target/etc/machine-id -a -f $target/bin/systemd-machine-id-setup ]; then
$ROOTCMD systemd-machine-id-setup
fi
ln -fs /proc/mounts $target/etc/mtab
rm -f $target/etc/dpkg/dpkg.cfg.d/fai
[ $FAI_ACTION = "install" -a -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
ainsl -av /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
fcopy -Miv /etc/fai/fai.conf
echo "add orchard user"
$ROOTCMD adduser -c "orchard user" -d /home/orchard -s /bin/bash orchard
$ROOTCMD usermod -p "$ORCHARDPW" orchard
exit $error
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment