This repository has been archived by the owner on Jun 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
Modifies Ubuntu 18.04 task. #436
Open
rngkll
wants to merge
1
commit into
puppetlabs-toy-chest:master
Choose a base branch
from
rngkll:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo Razor policy successfully applied > /tmp/razor_complete.log | ||
echo Installed using <%= task.label %> - <%= task.description %> >> /tmp/razor_complete.log | ||
echo Repo: <%= repo_url %> >> /tmp/razor_complete.log | ||
echo Node: <%= node_url %> >> /tmp/razor_complete.log | ||
|
||
sed -i '/razor_postinstall/d' /etc/crontab | ||
|
||
curl -s <%= broker_install_url %> | bash | ||
if [ $? -ne 0 ]; then | ||
echo "Broker run failed; see /var/log/razor.log for more details" >> /tmp/razor_complete.log | ||
else | ||
echo Ran '<%= broker_install_url %>' >> /tmp/razor_complete.log | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
d-i console-setup/ask_detect boolean false | ||
d-i keyboard-configuration/layoutcode string us | ||
d-i netcfg/choose_interface select auto | ||
d-i netcfg/get_hostname string <%= node.metadata['hostname'] || node.hostname %> | ||
d-i netcfg/get_domain string <%= (node.metadata['hostname'] || node.hostname).split('.').drop(1).join('.') %> | ||
d-i netcfg/no_default_route boolean true | ||
# This is introduced in Trusty. | ||
d-i live-installer/net-image string <%= repo_url("install/filesystem.squashfs") %> | ||
d-i mirror/protocol string <%= repo_uri.scheme %> | ||
d-i mirror/country string manual | ||
d-i mirror/http/hostname string <%= "#{repo_uri.host}:#{repo_uri.port}" %> | ||
d-i mirror/http/directory string <%= repo_uri.path %> | ||
d-i clock-setup/utc boolean true | ||
d-i time/zone string <%= node.metadata['timezone'] || 'US/Pacific' %> | ||
d-i clock-setup/ntp boolean true | ||
d-i clock-setup/ntp-server string ntp.ubuntu.com | ||
d-i partman-auto/disk string /dev/sda | ||
d-i partman-auto/method string lvm | ||
d-i partman-lvm/device_remove_lvm boolean true | ||
d-i partman-md/device_remove_md boolean true | ||
d-i partman-auto-lvm/guided_size string max | ||
d-i partman-auto/choose_recipe select atomic | ||
d-i partman-auto/purge_lvm_from_device boolean true | ||
d-i partman/default_filesystem string ext4 | ||
d-i partman-auto/init_automatically_partition select biggest_free | ||
d-i partman-lvm/confirm boolean true | ||
d-i partman-lvm/confirm_nooverwrite boolean true | ||
d-i partman-partitioning/confirm_write_new_label boolean true | ||
d-i partman/choose_partition select finish | ||
d-i partman/confirm boolean true | ||
d-i partman/confirm_nooverwrite boolean true | ||
d-i partman-md/confirm boolean true | ||
d-i passwd/root-login boolean true | ||
d-i passwd/make-user boolean true | ||
d-i passwd/root-password password <%= node.metadata['root_password'] || node.root_password %> | ||
d-i passwd/root-password-again password <%= node.metadata['root_password'] || node.root_password %> | ||
d-i passwd/user-fullname string Ubuntu User | ||
d-i passwd/username string ubuntu | ||
d-i passwd/user-password password insecure | ||
d-i passwd/user-password-again password insecure | ||
d-i user-setup/allow-password-weak boolean true | ||
d-i apt-setup/restricted boolean true | ||
d-i pkgsel/include string curl openssh-server | ||
d-i grub-installer/only_debian boolean true | ||
d-i grub-installer/with_other_os boolean true | ||
d-i finish-install/reboot_in_progress note | ||
# Uncomment this for `nomodeset`. | ||
# d-i debian-installer/add-kernel-opts string nomodeset | ||
# Our callbacks | ||
d-i preseed/early_command string wget <%= log_url("preseed start") %> | ||
d-i preseed/late_command string wget <%= log_url("preseed end") %>; \ | ||
wget <%= file_url("os_boot") %> -O /target/usr/local/sbin/razor_postinstall.sh; \ | ||
printf %b '@reboot root (sleep 90; /bin/bash /usr/local/sbin/razor_postinstall.sh)\n' >> /target/etc/crontab; \ | ||
chmod +x /target/usr/local/sbin/razor_postinstall.sh; \ | ||
wget <%= stage_done_url("preseed") %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%# -*- shell-script -*- %> | ||
# Get current IP | ||
node_ip=$(ip addr show | grep -A 2 BROADCAST | grep inet | awk '{ print $2 }' | awk -F'/' '{print $1}') | ||
echo IP is $node_ip | ||
|
||
# Send IP up | ||
curl -s <%= store_url("ip" => "$node_ip") %> | ||
|
||
# Send final state | ||
curl -s <%= stage_done_url("store_ip") %> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the only line that has changed so far. Was the other method of stopping the postinstall script not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post install script was never called because ubuntu 18.04 uses systemd instead of init.
adding a line to the crontab works with systemd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah excellent, that makes sense. Is there a reason this wouldn't work for other Ubuntu versions too? This might be a more portable way to be standard across versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this with other than ubuntu 18.04, this might work for newer version but not sure for older.