-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Ansible did not properly deploy with root user
- userdata now creates "ubuntu" user with sudo permissions (like AWS has) - ansible module now uses "become" instead of relying on root user Update: TFvars file has been updated with new instructions about setting region
- Loading branch information
Showing
4 changed files
with
13 additions
and
4 deletions.
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//region = "us-east-1" # See https://www.alibabacloud.com/help/doc-detail/40654.htm | ||
# To set the region, please set the ALICLOUD_REGION environment variable | ||
# See https://www.alibabacloud.com/help/doc-detail/40654.htm for valid regions | ||
//private_key_path = "/path/to/your/key" | ||
//public_key_path = "/path/to/your/key.pub" |
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,6 @@ | ||
#! /bin/sh | ||
useradd -s /bin/bash -m ubuntu | ||
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers | ||
mkdir /home/ubuntu/.ssh | ||
touch /home/ubuntu/.ssh/authorized_keys | ||
echo "${ssh_key}" | tee -a /home/ubuntu/.ssh/authorized_keys |