Add ssh console to anaconda and preseed
Adds ssh console to CentOS and Ubuntu nodes during provisioning. SSH is accessible from Fuel master node via Admin network IPs with Fuel root RSA ssh key. Password authentication is not available. Anaconda/Debian-installer stop commands have been removed from the login profiles. Orchestrator should execute something like the following in order to pause provisioning on the node: - CentOS/RH: "killall -STOP anaconda" - Ubuntu: "killall -STOP debootstrap dpkg" Change-Id: Ic34b7e6f154c084bd03c29cc5ce1d22edfc165ad Closes-Bug: #1277447
This commit is contained in:
parent
facc9ae5b5
commit
a61eeea68a
@ -65,9 +65,11 @@ class cobbler::snippets {
|
||||
cobbler_snippet {"ubuntu_puppet_config":}
|
||||
cobbler_snippet {"ubuntu_mcollective_config":}
|
||||
cobbler_snippet {"ubuntu_network":}
|
||||
cobbler_snippet {"ubuntu_network_console_and_syslog":}
|
||||
cobbler_snippet {"ubuntu_partition":}
|
||||
cobbler_snippet {"ubuntu_partition_late":}
|
||||
cobbler_snippet {"ubuntu_static_net":}
|
||||
cobbler_snippet {"anaconda_ssh_console":}
|
||||
|
||||
case $operatingsystem {
|
||||
/(?i)(debian|ubuntu)/: {
|
||||
|
@ -37,6 +37,10 @@ text
|
||||
# SKIP CONFIGURING X
|
||||
skipx
|
||||
|
||||
# SSH user and some unknown random password,
|
||||
# we're going to use SSH keys anyway
|
||||
sshpw --username root --iscrypted $6$tCD3X7ji$1urw6qEMDkVxOkD33k2jjklHSDG2hg2234kJHESJ3hwhsjHshSJshHSJSh333je34DHJHDr4je4AMP85NxQe61
|
||||
|
||||
%include /tmp/partition.ks
|
||||
|
||||
# COBBLER EMBEDDED SNIPPET: 'network_config'
|
||||
@ -74,6 +78,10 @@ $SNIPPET('kickstart_start')
|
||||
# INTO KICKSTART BY 'network_config' SNIPPET
|
||||
$SNIPPET('pre_install_network_config')
|
||||
|
||||
# CONFIGURES SSH KEY ACCESS FOR SSHD CONSOLE
|
||||
# DURING OPERATING SYSTEM INSTALLATION
|
||||
$SNIPPET('anaconda_ssh_console')
|
||||
|
||||
# COBBLER EMBEDDED SNIPPET: 'pre_install_partition'
|
||||
# DETECTS HARD DRIVES AND SETS FIRST OF THEM
|
||||
# AS INSTALLATION TARGET AND BOOTLOADER INSTALLATION TARGET
|
||||
|
@ -26,7 +26,7 @@ d-i clock-setup/utc boolean true
|
||||
d-i clock-setup/ntp boolean false
|
||||
d-i time/zone string <%= @ks_system_timezone %>
|
||||
|
||||
d-i preseed/early_command string /usr/bin/killall -s KILL syslogd ; /sbin/syslogd -m 0 -O /var/log/syslog -S -R @@server@@
|
||||
$SNIPPET('ubuntu_network_console_and_syslog')
|
||||
|
||||
$SNIPPET('ubuntu_partition')
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
#set $authorized_keys = str(open("/etc/cobbler/authorized_keys", "r").read())
|
||||
mkdir -p --mode=700 /root/.ssh
|
||||
cat > /root/.ssh/authorized_keys2 <<EOF
|
||||
$authorized_keys
|
||||
EOF
|
||||
chmod 600 /root/.ssh/authorized_keys2
|
@ -0,0 +1,16 @@
|
||||
#import random
|
||||
#import string
|
||||
#set $authorized_keys = str(open("/etc/cobbler/authorized_keys", "r").read()).rstrip()
|
||||
#set $random_pass = ''.join(random.choice(string.lowercase) for i in range(16))
|
||||
|
||||
d-i anna/choose_modules string network-console
|
||||
d-i network-console/password password $random_pass
|
||||
d-i network-console/password-again password $random_pass
|
||||
d-i network-console/start select continue
|
||||
|
||||
d-i preseed/early_command string /bin/mkdir /.ssh ; \
|
||||
/bin/echo "$authorized_keys" > /.ssh/authorized_keys ; \
|
||||
/bin/sed -e "s#PasswordAuthentication yes#PasswordAuthentication no#" -i /etc/ssh/sshd_config ; \
|
||||
/usr/bin/killall -s HUP sshd ; \
|
||||
/usr/bin/killall -s KILL syslogd ; \
|
||||
/sbin/syslogd -m 0 -O /var/log/syslog -S -R @@server@@
|
@ -122,7 +122,7 @@ class nailgun::cobbler(
|
||||
|
||||
cobbler_profile { "centos-x86_64":
|
||||
kickstart => "/var/lib/cobbler/kickstarts/centos-x86_64.ks",
|
||||
kopts => "biosdevname=0",
|
||||
kopts => "biosdevname=0 sshd=1",
|
||||
distro => "centos-x86_64",
|
||||
ksmeta => "",
|
||||
menu => true,
|
||||
|
Loading…
Reference in New Issue
Block a user