diff options
author | Jake Buchholz <tomalok@gmail.com> | 2019-06-03 21:19:59 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2019-07-05 12:52:57 -0700 |
commit | 3ceb90d1ffdce6c878cb0afcdfe76a9f4cc4cc79 (patch) | |
tree | b61b1097269adf20ac58c9f8e0914795c361356d /tiny-ec2-bootstrap | |
parent | 959968fa54455ca71276d5cef1308d61517576b4 (diff) | |
download | tiny-ec2-bootstrap-3ceb90d1ffdce6c878cb0afcdfe76a9f4cc4cc79.tar.bz2 tiny-ec2-bootstrap-3ceb90d1ffdce6c878cb0afcdfe76a9f4cc4cc79.tar.xz tiny-ec2-bootstrap-3ceb90d1ffdce6c878cb0afcdfe76a9f4cc4cc79.zip |
make ec2 user configurable
Diffstat (limited to 'tiny-ec2-bootstrap')
-rw-r--r-- | tiny-ec2-bootstrap | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tiny-ec2-bootstrap b/tiny-ec2-bootstrap index c03fcd3..83aeba7 100644 --- a/tiny-ec2-bootstrap +++ b/tiny-ec2-bootstrap | |||
@@ -64,13 +64,17 @@ start() { | |||
64 | # Don't bootstrap if the host has already been bootstrapped | 64 | # Don't bootstrap if the host has already been bootstrapped |
65 | [ -f "/var/lib/cloud/.bootstrap-complete" ] && return 0 | 65 | [ -f "/var/lib/cloud/.bootstrap-complete" ] && return 0 |
66 | 66 | ||
67 | # load configuration, set defaults | ||
68 | [ -f "/etc/conf.d/tiny-ec2-bootstrap" ] && . /etc/conf.d/tiny-ec2-bootstrap | ||
69 | EC2_USER=${EC2_USER:-alpine} | ||
70 | |||
67 | [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud | 71 | [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud |
68 | 72 | ||
69 | ebegin "Disabling root password"; _disable_password root; eend $? | 73 | ebegin "Disabling root password"; _disable_password root; eend $? |
70 | ebegin "Disabling alpine password"; _disable_password alpine; eend $? | 74 | ebegin "Disabling $EC2_USER password"; _disable_password "$EC2_USER"; eend $? |
71 | ebegin "Resizing root partition"; _resize_root_partition; eend $? | 75 | ebegin "Resizing root partition"; _resize_root_partition; eend $? |
72 | ebegin "Setting ec2 hostname"; _update_hostname; eend $? | 76 | ebegin "Setting ec2 hostname"; _update_hostname; eend $? |
73 | ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? | 77 | ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "$EC2_USER"; eend $? |
74 | ebegin "Running ec2 user data script"; _run_userdata; eend $? | 78 | ebegin "Running ec2 user data script"; _run_userdata; eend $? |
75 | 79 | ||
76 | touch "/var/lib/cloud/.bootstrap-complete" | 80 | touch "/var/lib/cloud/.bootstrap-complete" |