mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
aws userdata bugfix
This commit is contained in:
@@ -34,6 +34,7 @@ import (
|
||||
*/
|
||||
|
||||
type TSudoPolicy string
|
||||
type TSshPwauth string
|
||||
|
||||
const (
|
||||
CLOUD_CONFIG_HEADER = "#cloud-config\n"
|
||||
@@ -43,6 +44,10 @@ const (
|
||||
USER_SUDO = TSudoPolicy("sudo")
|
||||
USER_SUDO_DENY = TSudoPolicy("sudo_deny")
|
||||
USER_SUDO_NONE = TSudoPolicy("")
|
||||
|
||||
SSH_PASSWORD_AUTH_ON = TSshPwauth("true")
|
||||
SSH_PASSWORD_AUTH_OFF = TSshPwauth("false")
|
||||
SSH_PASSWORD_AUTH_UNCHANGED = TSshPwauth("unchanged")
|
||||
)
|
||||
|
||||
type SWriteFile struct {
|
||||
@@ -74,7 +79,7 @@ type SCloudConfig struct {
|
||||
Packages []string
|
||||
PhoneHome *SPhoneHome
|
||||
DisableRoot int
|
||||
SshPwauth int
|
||||
SshPwauth TSshPwauth
|
||||
}
|
||||
|
||||
func NewWriteFile(path string, content string, perm string, owner string, isBase64 bool) SWriteFile {
|
||||
|
||||
@@ -43,7 +43,7 @@ func TestSCloudConfig_UserData(t *testing.T) {
|
||||
Url: "http://www.yunion.io/$INSTANCE_ID",
|
||||
},
|
||||
DisableRoot: 0,
|
||||
SshPwauth: 1,
|
||||
SshPwauth: SSH_PASSWORD_AUTH_ON,
|
||||
}
|
||||
userData := config.UserData()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user